mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2025-01-09 17:40:32 +01:00
Refactor code and fix bugs
This commit is contained in:
parent
2ef8b69ea1
commit
16e2b86f94
15
init.lua
15
init.lua
@ -269,7 +269,6 @@ advschem.add_form("main", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local update_positions = false
|
|
||||||
-- Save size vector values
|
-- Save size vector values
|
||||||
if (fields.save or fields.key_enter_field == "x" or
|
if (fields.save or fields.key_enter_field == "x" or
|
||||||
fields.key_enter_field == "y" or fields.key_enter_field == "z")
|
fields.key_enter_field == "y" or fields.key_enter_field == "z")
|
||||||
@ -286,9 +285,6 @@ advschem.add_form("main", {
|
|||||||
if z then
|
if z then
|
||||||
meta.z_size = math.max(z, 1)
|
meta.z_size = math.max(z, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set positions to be updated
|
|
||||||
update_positions = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Save schematic name
|
-- Save schematic name
|
||||||
@ -300,6 +296,7 @@ advschem.add_form("main", {
|
|||||||
-- Export schematic
|
-- Export schematic
|
||||||
if fields.export and meta.schem_name and meta.schem_name ~= "" then
|
if fields.export and meta.schem_name and meta.schem_name ~= "" then
|
||||||
local pos1, pos2 = advschem.size(pos)
|
local pos1, pos2 = advschem.size(pos)
|
||||||
|
pos1, pos2 = advschem.sort_pos(pos1, pos2)
|
||||||
local path = export_path_full .. DIR_DELIM
|
local path = export_path_full .. DIR_DELIM
|
||||||
minetest.mkdir(path)
|
minetest.mkdir(path)
|
||||||
|
|
||||||
@ -351,11 +348,6 @@ advschem.add_form("main", {
|
|||||||
if not fields.quit then
|
if not fields.quit then
|
||||||
advschem.show_formspec(pos, minetest.get_player_by_name(name), "main")
|
advschem.show_formspec(pos, minetest.get_player_by_name(name), "main")
|
||||||
end
|
end
|
||||||
|
|
||||||
if update_positions then
|
|
||||||
local pos1, pos2 = advschem.size(pos)
|
|
||||||
pos1, pos2 = advschem.sort_pos(pos1, pos2)
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -788,11 +780,6 @@ minetest.register_node("advschem:creator", {
|
|||||||
meta:set_int("y_size", 1)
|
meta:set_int("y_size", 1)
|
||||||
meta:set_int("z_size", 1)
|
meta:set_int("z_size", 1)
|
||||||
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
inv:set_size("probability", 1)
|
|
||||||
|
|
||||||
local pos1, pos2 = advschem.size(pos)
|
|
||||||
|
|
||||||
-- Don't take item from itemstack
|
-- Don't take item from itemstack
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user