some fixes

This commit is contained in:
cora 2022-11-14 20:41:18 +01:00
parent 4f342a1237
commit 6f2cc2fd8e
4 changed files with 21 additions and 4 deletions

View File

@ -8,12 +8,11 @@ minetest.register_on_mods_loaded(function()
for k,v in pairs(minetest.registered_abms) do
local n=v.label
local olda=v.action
max_times[n] = 0
minetest.registered_abms[k].action=function(pos, node, aoc, aocw)
local t1=os.clock()
local r=olda(pos, node, aoc, aocw)
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
count[n]=count[n]+1
total=total+times[n]

View File

@ -1,5 +1,15 @@
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", {
params = "",
description = "Gets current biome",

View File

@ -6,9 +6,16 @@ minetest.register_chatcommand("mobtest",{
local p=minetest.get_player_by_name(n)
local pos=p:get_pos()
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))
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})

View File

@ -1 +1,2 @@
name = mobtest
depends = mcl_mobs