mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2025-01-09 17:10:19 +01:00
Use proper creative mode check (#59)
This commit is contained in:
parent
6a3c47157f
commit
72572bb5c8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
*~
|
|
@ -112,7 +112,7 @@ minetest.register_node("cavestuff:stalactite_1",{
|
|||||||
name = "cavestuff:stalactite_"..math.random(1,3),
|
name = "cavestuff:stalactite_"..math.random(1,3),
|
||||||
param2 = minetest.dir_to_wallmounted(vector.multiply(dir, -1))
|
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()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,7 +64,7 @@ minetest.register_node("dryplants:juncus", {
|
|||||||
else
|
else
|
||||||
minetest.swap_node(right_here, {name="dryplants:juncus"})
|
minetest.swap_node(right_here, {name="dryplants:juncus"})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.is_creative_enabled(playername) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
|
@ -318,7 +318,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
|
|||||||
collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
|
collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
|
||||||
on_punch = function(self, puncher)
|
on_punch = function(self, puncher)
|
||||||
if puncher:is_player() and puncher:get_inventory() then
|
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")
|
puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling")
|
||||||
end
|
end
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
@ -54,7 +54,7 @@ for i in pairs(NoDe) do
|
|||||||
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
if minetest.get_node(pt.above).name=="air" then
|
if minetest.get_node(pt.above).name=="air" then
|
||||||
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
|
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()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
|
Loading…
Reference in New Issue
Block a user