From 39bfb76cfbf73e021775596bd7c03a653d9d80de Mon Sep 17 00:00:00 2001 From: Thomas--S Date: Wed, 12 Apr 2017 21:13:39 +0200 Subject: [PATCH] Take Item from Cable Plate Stack on Place (#345) (when not in Creative) and Change drop to recipe. --- technic/machines/register/cables.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index b0e2e06..d65c399 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -182,7 +182,7 @@ function technic.register_cable(tier, size) tiles = {"technic_"..ltier.."_cable.png"}, groups = table.copy(groups), sounds = default.node_sound_wood_defaults(), - drop = "technic:"..ltier.."_cable", + drop = "technic:"..ltier.."_cable_plate_1", paramtype = "light", sunlight_propagates = true, drawtype = "nodebox", @@ -210,6 +210,10 @@ function technic.register_cable(tier, size) end end minetest.set_node(pointed_thing.above, {name = "technic:"..ltier.."_cable_plate_"..num}) + if not (creative and creative.is_enabled_for(placer)) then + itemstack:take_item() + end + return itemstack end else def.groups.not_in_creative_inventory = 1 @@ -227,6 +231,13 @@ function technic.register_cable(tier, size) {"", "", c}, } }) + + minetest.register_craft({ + output = c, + recipe = { + {"technic:"..ltier.."_cable_plate_1"}, + } + }) end