mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-01 23:11:11 +01:00
Check if item is a slab or not
This commit is contained in:
parent
9da07af370
commit
07d2759ae4
1 changed files with 9 additions and 7 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue