mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 22:11:10 +01:00
Fix some anvil renaming issues
This commit is contained in:
parent
fda5ed9e1c
commit
256dd1e26a
1 changed files with 4 additions and 1 deletions
|
@ -34,7 +34,7 @@ local function update_anvil_slots(meta)
|
||||||
input2 = inv:get_stack("input", 2)
|
input2 = inv:get_stack("input", 2)
|
||||||
output = inv:get_stack("output", 1)
|
output = inv:get_stack("output", 1)
|
||||||
local new_output, name_item
|
local new_output, name_item
|
||||||
local check_rename = false
|
local just_rename = false
|
||||||
|
|
||||||
-- Both input slots occupied
|
-- Both input slots occupied
|
||||||
if (not input1:is_empty() and not input2:is_empty()) then
|
if (not input1:is_empty() and not input2:is_empty()) then
|
||||||
|
@ -108,6 +108,7 @@ local function update_anvil_slots(meta)
|
||||||
else
|
else
|
||||||
name_item = input1
|
name_item = input1
|
||||||
end
|
end
|
||||||
|
just_rename = true
|
||||||
else
|
else
|
||||||
new_output = ""
|
new_output = ""
|
||||||
end
|
end
|
||||||
|
@ -132,6 +133,8 @@ local function update_anvil_slots(meta)
|
||||||
-- Double-save the name internally, too
|
-- Double-save the name internally, too
|
||||||
meta:set_string("name", new_name)
|
meta:set_string("name", new_name)
|
||||||
new_output = name_item
|
new_output = name_item
|
||||||
|
elseif just_rename then
|
||||||
|
new_output = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue