From 72572bb5c816ad1b7734544960b171d8edf29b2d Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:18:18 +0200 Subject: [PATCH] Use proper creative mode check (#59) --- .gitignore | 1 - cavestuff/nodes.lua | 2 +- dryplants/juncus.lua | 2 +- dryplants/reedmace.lua | 2 +- modpack.txt | 0 trunks/nodes.lua | 2 +- 6 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 .gitignore delete mode 100644 modpack.txt diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b25c15b..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*~ diff --git a/cavestuff/nodes.lua b/cavestuff/nodes.lua index a5211d7..e3e2df0 100644 --- a/cavestuff/nodes.lua +++ b/cavestuff/nodes.lua @@ -112,7 +112,7 @@ minetest.register_node("cavestuff:stalactite_1",{ name = "cavestuff:stalactite_"..math.random(1,3), param2 = minetest.dir_to_wallmounted(vector.multiply(dir, -1)) }) - if not minetest.setting_getbool("creative_mode") then + if not minetest.is_creative_enabled(playername) then itemstack:take_item() end end diff --git a/dryplants/juncus.lua b/dryplants/juncus.lua index 8c36092..a2f0166 100644 --- a/dryplants/juncus.lua +++ b/dryplants/juncus.lua @@ -64,7 +64,7 @@ minetest.register_node("dryplants:juncus", { else minetest.swap_node(right_here, {name="dryplants:juncus"}) end - if not minetest.setting_getbool("creative_mode") then + if not minetest.is_creative_enabled(playername) then itemstack:take_item() end return itemstack diff --git a/dryplants/reedmace.lua b/dryplants/reedmace.lua index 6d5ecda..e9547be 100644 --- a/dryplants/reedmace.lua +++ b/dryplants/reedmace.lua @@ -318,7 +318,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{ collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, on_punch = function(self, puncher) if puncher:is_player() and puncher:get_inventory() then - if not minetest.setting_getbool("creative_mode") then + if not minetest.is_creative_enabled(puncher:get_player_name()) then puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling") end self.object:remove() diff --git a/modpack.txt b/modpack.txt deleted file mode 100644 index e69de29..0000000 diff --git a/trunks/nodes.lua b/trunks/nodes.lua index 31bd817..909a3c1 100644 --- a/trunks/nodes.lua +++ b/trunks/nodes.lua @@ -54,7 +54,7 @@ for i in pairs(NoDe) do local direction = minetest.dir_to_facedir(placer:get_look_dir()) if minetest.get_node(pt.above).name=="air" then minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.is_creative_enabled(playername) then itemstack:take_item() end return itemstack