mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-07-23 18:10:22 +02:00
Compare commits
3 Commits
d1cbd420bb
...
supports_m
Author | SHA1 | Date | |
---|---|---|---|
40b49ee9bc | |||
4f2c7b18cc | |||
b2e086f9ec |
@ -196,7 +196,7 @@ end
|
|||||||
-- @return The number of nodes.
|
-- @return The number of nodes.
|
||||||
function worldedit.allocate(origin_pos, value)
|
function worldedit.allocate(origin_pos, value)
|
||||||
local nodes = load_schematic(value)
|
local nodes = load_schematic(value)
|
||||||
if not nodes then return nil end
|
if not nodes or #nodes == 0 then return nil end
|
||||||
return worldedit.allocate_with_nodes(origin_pos, nodes)
|
return worldedit.allocate_with_nodes(origin_pos, nodes)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -227,6 +227,7 @@ end
|
|||||||
function worldedit.deserialize(origin_pos, value)
|
function worldedit.deserialize(origin_pos, value)
|
||||||
local nodes = load_schematic(value)
|
local nodes = load_schematic(value)
|
||||||
if not nodes then return nil end
|
if not nodes then return nil end
|
||||||
|
if #nodes == 0 then return #nodes end
|
||||||
|
|
||||||
local pos1, pos2 = worldedit.allocate_with_nodes(origin_pos, nodes)
|
local pos1, pos2 = worldedit.allocate_with_nodes(origin_pos, nodes)
|
||||||
worldedit.keep_loaded(pos1, pos2)
|
worldedit.keep_loaded(pos1, pos2)
|
||||||
|
@ -6,6 +6,7 @@ minetest.register_node("worldedit:placeholder", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
|
pointable = false,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory=1},
|
||||||
})
|
})
|
||||||
|
@ -1163,9 +1163,15 @@ minetest.register_chatcommand("/allocate", {
|
|||||||
return
|
return
|
||||||
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
||||||
worldedit.player_notify(name, "File was created with newer version of WorldEdit!")
|
worldedit.player_notify(name, "File was created with newer version of WorldEdit!")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
local nodepos1, nodepos2, count = worldedit.allocate(pos, value)
|
local nodepos1, nodepos2, count = worldedit.allocate(pos, value)
|
||||||
|
|
||||||
|
if not nodepos1 then
|
||||||
|
worldedit.player_notify(name, "Schematic empty, nothing allocated")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
worldedit.pos1[name] = nodepos1
|
worldedit.pos1[name] = nodepos1
|
||||||
worldedit.mark_pos1(name)
|
worldedit.mark_pos1(name)
|
||||||
worldedit.pos2[name] = nodepos2
|
worldedit.pos2[name] = nodepos2
|
||||||
|
Reference in New Issue
Block a user