From 8b4fa4bedbec0e47ea802bc0aef9f0fac06d778d Mon Sep 17 00:00:00 2001 From: Marco-Byte-1 <65880363+Marco-Byte-1@users.noreply.github.com> Date: Tue, 23 Feb 2021 18:39:32 +0530 Subject: [PATCH] Cuboid.java generate Fix --- .../io/github/paldiu/simplexcore/math/Cuboid.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java b/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java index 5383204..4fd8516 100644 --- a/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java +++ b/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java @@ -34,16 +34,14 @@ public final class Cuboid { int b = t2 + y; int c = t3 + z; - while (t1 < a) { - while (t2 < b) { - while (t3 < c) { - t3++; - location.getWorld().getBlockAt(t1, t2, t3).setType(material); + for (int currentX = t1; currentX < a; currentX++) { + for (int currentY = t2; currentY < b; currentY++) { + for (int currentZ = t3; currentZ < c; currentZ++) { + location.getWorld().getBlockAt(currentX, currentY, currentZ).setType(material); } - t2++; } - t1++; } + }; Constants.getScheduler().runTaskLaterAsynchronously(Constants.getPlugin(), task, Constants.getTimeValues().SECOND());