1
0
Fork 0

Check if item is a slab or not

This commit is contained in:
Chris Page 2023-08-01 18:05:01 +01:00 committed by the-real-herowl
parent 7c5584d6c5
commit 4ba2d64748
1 changed files with 9 additions and 7 deletions

View File

@ -109,10 +109,8 @@ local function update_stonecutter_slots(meta)
local name = input:get_name() local name = input:get_name()
local name_stripped = get_item_string_name(input:to_string()) local name_stripped = get_item_string_name(input:to_string())
local cuttable_recipes = {} local cuttable_recipes = {}
local new_output = ItemStack(meta:get_string("cut_stone")) local new_output = meta:get_string("cut_stone")
print(name)
if is_input_in_table(name) then if is_input_in_table(name) then
if name_stripped ~= "" then if name_stripped ~= "" then
local stair = "mcl_stairs:stair_"..name_stripped local stair = "mcl_stairs:stair_"..name_stripped
@ -145,10 +143,14 @@ local function update_stonecutter_slots(meta)
else else
meta:set_string("formspec", show_stonecutter_formspec(nil)) meta:set_string("formspec", show_stonecutter_formspec(nil))
end end
if new_output = '' then
if new_output then cut_item = ItemStack(new_output)
new_output:set_count(2) if string.find(new_output, "mcl_stairs:slab_") then
inv:set_stack("output", 1, new_output) cut_item:set_count(2)
else
cut_item:set_count(1)
end
inv:set_stack("output", 1, cut_item)
end end
end end