some fixes
This commit is contained in:
parent
4f342a1237
commit
6f2cc2fd8e
|
@ -8,12 +8,11 @@ minetest.register_on_mods_loaded(function()
|
||||||
for k,v in pairs(minetest.registered_abms) do
|
for k,v in pairs(minetest.registered_abms) do
|
||||||
local n=v.label
|
local n=v.label
|
||||||
local olda=v.action
|
local olda=v.action
|
||||||
max_times[n] = 0
|
|
||||||
minetest.registered_abms[k].action=function(pos, node, aoc, aocw)
|
minetest.registered_abms[k].action=function(pos, node, aoc, aocw)
|
||||||
local t1=os.clock()
|
local t1=os.clock()
|
||||||
local r=olda(pos, node, aoc, aocw)
|
local r=olda(pos, node, aoc, aocw)
|
||||||
times[n]=os.clock()-t1
|
times[n]=os.clock()-t1
|
||||||
if times[n] > max_times[n] then max_times[n] = times[n] end
|
if times[n] > ( max_times[n] or 0 ) then max_times[n] = times[n] end
|
||||||
if not count[n] then count[n] = 0 end
|
if not count[n] then count[n] = 0 end
|
||||||
count[n]=count[n]+1
|
count[n]=count[n]+1
|
||||||
total=total+times[n]
|
total=total+times[n]
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
local S = minetest.get_translator("mcl_burning")
|
local S = minetest.get_translator("mcl_burning")
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_chatcommand("mgflags", {
|
||||||
|
params = "",
|
||||||
|
description = "Get Mapgen flags",
|
||||||
|
privs = {debug = true},
|
||||||
|
func = function(name)
|
||||||
|
minetest.chat_send_player(name,dump(minetest.get_mapgen_setting("mg_flags")))
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("biome", {
|
minetest.register_chatcommand("biome", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Gets current biome",
|
description = "Gets current biome",
|
||||||
|
|
|
@ -6,9 +6,16 @@ minetest.register_chatcommand("mobtest",{
|
||||||
local p=minetest.get_player_by_name(n)
|
local p=minetest.get_player_by_name(n)
|
||||||
local pos=p:get_pos()
|
local pos=p:get_pos()
|
||||||
for k,v in pairs(minetest.registered_entities) do
|
for k,v in pairs(minetest.registered_entities) do
|
||||||
if v.horny ~= nil then
|
if v.is_mob then
|
||||||
local spos=vector.add(pos,vector.new(math.random(100)-50,0,math.random(100)-50))
|
local spos=vector.add(pos,vector.new(math.random(100)-50,0,math.random(100)-50))
|
||||||
minetest.add_entity(spos, v.name)
|
local o = mcl_mobs.spawn(spos,v.name)
|
||||||
|
if o then
|
||||||
|
local l=o:get_luaentity()
|
||||||
|
if l and l.on_activate then
|
||||||
|
l.on_activate(l)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end})
|
end})
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
name = mobtest
|
name = mobtest
|
||||||
|
depends = mcl_mobs
|
||||||
|
|
Loading…
Reference in New Issue