mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-12 17:13:22 +01:00
Changes to support the latest schematic probability specification.
This commit is contained in:
parent
9ab52df56a
commit
272541c9da
@ -148,7 +148,9 @@ worldedit.copy = function(pos1, pos2, axis, amount)
|
|||||||
local newindex2 = newindex1 + (index2 + offset[other1]) * stride[other1]
|
local newindex2 = newindex1 + (index2 + offset[other1]) * stride[other1]
|
||||||
for index3 = 1, extent[other2] do
|
for index3 = 1, extent[other2] do
|
||||||
local i = newindex2 + (index3 + offset[other2]) * stride[other2]
|
local i = newindex2 + (index3 + offset[other2]) * stride[other2]
|
||||||
nodes[i] = get_node(pos)
|
local node = get_node(pos)
|
||||||
|
node.param1 = 255 --node will always appear
|
||||||
|
nodes[i] = node
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -295,7 +297,7 @@ worldedit.scale = function(pos1, pos2, factor)
|
|||||||
|
|
||||||
--prepare schematic of large node
|
--prepare schematic of large node
|
||||||
local get_node, get_meta, place_schematic = minetest.get_node, minetest.get_meta, minetest.place_schematic
|
local get_node, get_meta, place_schematic = minetest.get_node, minetest.get_meta, minetest.place_schematic
|
||||||
local placeholder_node = {name="", param1=0, param2=0}
|
local placeholder_node = {name="", param1=255, param2=0}
|
||||||
local nodes = {}
|
local nodes = {}
|
||||||
for i = 1, factor ^ 3 do
|
for i = 1, factor ^ 3 do
|
||||||
nodes[i] = placeholder_node
|
nodes[i] = placeholder_node
|
||||||
@ -324,7 +326,7 @@ worldedit.scale = function(pos1, pos2, factor)
|
|||||||
|
|
||||||
--create large node
|
--create large node
|
||||||
placeholder_node.name = node.name
|
placeholder_node.name = node.name
|
||||||
placeholder_node.param1, placeholder_node.param2 = node.param1, node.param2
|
placeholder_node.param2 = node.param2
|
||||||
bigpos.x, bigpos.y, bigpos.z = posx, posy, posz
|
bigpos.x, bigpos.y, bigpos.z = posx, posy, posz
|
||||||
place_schematic(bigpos, schematic)
|
place_schematic(bigpos, schematic)
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ worldedit.hollow_cylinder = function(pos, axis, length, radius, nodename) --wip:
|
|||||||
manip:read_from_map(pos1, pos2)
|
manip:read_from_map(pos1, pos2)
|
||||||
|
|
||||||
--create schematic for single node column along the axis
|
--create schematic for single node column along the axis
|
||||||
local node = {name=nodename, param1=0, param2=0}
|
local node = {name=nodename, param1=255, param2=0}
|
||||||
local nodes = {}
|
local nodes = {}
|
||||||
for i = 1, length do
|
for i = 1, length do
|
||||||
nodes[i] = node
|
nodes[i] = node
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
worldedit = worldedit or {}
|
worldedit = worldedit or {}
|
||||||
|
local minetest = minetest --local copy of global
|
||||||
|
|
||||||
local get_pointed = function(pos, nearest, distance)
|
local get_pointed = function(pos, nearest, distance)
|
||||||
if distance > 100 then
|
if distance > 100 then
|
||||||
@ -6,7 +7,7 @@ local get_pointed = function(pos, nearest, distance)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--check for collision with node
|
--check for collision with node
|
||||||
local nodename = env:get_node(pos).name
|
local nodename = minetest.get_node(pos).name
|
||||||
if nodename ~= "air"
|
if nodename ~= "air"
|
||||||
and nodename ~= "default:water_source"
|
and nodename ~= "default:water_source"
|
||||||
and nodename ~= "default:water_flowing" then
|
and nodename ~= "default:water_flowing" then
|
||||||
|
Loading…
Reference in New Issue
Block a user