From 0a7f3829f39c377d2b322422ecc654e305872cbd Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Thu, 16 Feb 2023 00:49:24 +0100 Subject: [PATCH] added item drop pickup mod as submodule, fixed "Deprecated call to "get_entity_name" error spam, increased sussy imposter spawning rate but decreased chance of spawn on each iteration --- .gitmodules | 3 +++ mods/amogus_generator/init.lua | 10 +++++++--- mods/item_drop | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 mods/item_drop diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d15883d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mods/item_drop"] + path = mods/item_drop + url = https://github.com/minetest-mods/item_drop.git diff --git a/mods/amogus_generator/init.lua b/mods/amogus_generator/init.lua index b2e65a4..93bcaf1 100644 --- a/mods/amogus_generator/init.lua +++ b/mods/amogus_generator/init.lua @@ -540,8 +540,8 @@ minetest.register_abm({ label = "Spawn Imposter", nodenames = {"air"}, neighbors = {"group:stone"}, - interval = 30, - chance = 60, + interval = 5, + chance = 500, action = function(pos) -- avoid spawning inside liquids if minetest.registered_nodes[minetest.get_node(pos).name].liquidtype == "none" then @@ -552,7 +552,11 @@ minetest.register_abm({ local entities = minetest.get_objects_inside_radius(pos, 20) local bat_count = 0 for _, entity in pairs(entities) do - if entity:get_entity_name() == "amogus_entities:sussy_imposter" then + -- get name while handling .name indexing error caused by get_luaentity() returning nil + -- i cant use get_entity_name() because its deprecated and spams logs + local name = entity:get_luaentity() and entity:get_luaentity().name or "" + + if name == "amogus_entities:sussy_imposter" then bat_count = bat_count + 1 if bat_count >= 3 then return diff --git a/mods/item_drop b/mods/item_drop new file mode 160000 index 0000000..8bebf63 --- /dev/null +++ b/mods/item_drop @@ -0,0 +1 @@ +Subproject commit 8bebf6324efa4bdb3f99c77300f3ef328b849e83