Skip to content

Commit

Permalink
fixup! Add a hollowcuboid iteration helper
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridDog committed Apr 23, 2024
1 parent f6b4a0f commit 278574b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions worldedit/primitives.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function worldedit.cube(pos, width, height, length, node_name, hollow)
-- Set up voxel manipulator
local basepos = vector.subtract(pos,
{x = math.floor(width / 2), y = 0, z = math.floor(length / 2)})
local endpos = vector.add(basepos, {x=width, y=height, z=length})
local endpos = vector.add(basepos,
{x = width - 1, y = height - 1, z = length - 1})
local manip, area = mh.init(basepos, endpos)
local data = mh.get_empty_data(area)

Expand All @@ -32,7 +33,7 @@ function worldedit.cube(pos, width, height, length, node_name, hollow)

for vi in iterfunc do
data[vi] = node_id
count = count+1
count = count + 1
end

mh.finish(manip, data)
Expand Down

0 comments on commit 278574b

Please sign in to comment.