From 24336d43c4dc69b99505cb0a73f559328e4a3c74 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 15 Aug 2017 02:51:40 +0200 Subject: [PATCH] Support creative mode for minecarts --- mods/ENTITIES/mcl_minecarts/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 2f33e871c8..e203470ae1 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -82,8 +82,10 @@ function mcl_minecarts.cart:on_punch(puncher, time_from_last_punch, tool_capabil end end + if not minetest.settings:get_bool("creative_mode") then + minetest.add_item(self.object:getpos(), "mcl_minecarts:minecart") + end self.object:remove() - puncher:get_inventory():add_item("main", "mcl_minecarts:minecart") return end @@ -295,7 +297,9 @@ minetest.register_craftitem("mcl_minecarts:minecart", { minetest.add_entity(pointed_thing.above, "mcl_minecarts:minecart") else return end - itemstack:take_item() + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end return itemstack end, groups = { minecart = 1, transport = 1},