From 278574bcb5c828b4462604f92e01d8c87d006f16 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Tue, 23 Apr 2024 20:18:58 +0200 Subject: [PATCH] fixup! Add a hollowcuboid iteration helper --- worldedit/primitives.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit/primitives.lua b/worldedit/primitives.lua index dc0ac2f..8d1a3c3 100644 --- a/worldedit/primitives.lua +++ b/worldedit/primitives.lua @@ -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) @@ -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)