From 69f703616c177c390dceb2d4c655f978357ee310 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 19 Oct 2018 16:33:29 +0200 Subject: [PATCH] Remove item spawner node after item was spawned --- mods/tutorial/init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mods/tutorial/init.lua b/mods/tutorial/init.lua index de5e3e0..3c743a0 100644 --- a/mods/tutorial/init.lua +++ b/mods/tutorial/init.lua @@ -1180,7 +1180,15 @@ minetest.register_node("tutorial:itemspawner", { local ent = objs[o]:get_luaentity() if ent then if ent.name == "__builtin:item" and ent.itemstring == itemstring then - meta:set_int("spawned", 1) + if not edit_item_spawners then + -- Remove node when item was spawned successfully. + -- So it doesn't get in the way. + minetest.remove_node(pos) + return + else + -- Keep node in editing mode + meta:set_int("spawned", 1) + end end end end