From 94a0f5584046f6986bb1850d1dc64497fcf4ac0c Mon Sep 17 00:00:00 2001 From: Nameless-123 <53367549+Nameless-123@users.noreply.github.com> Date: Mon, 20 Apr 2020 17:20:15 +0200 Subject: [PATCH] undid eqyptian braces I hope you're happy now https://github.com/gnembon/fabric-carpet/pull/232#discussion_r411022932 --- .../java/carpet/commands/DrawCommand.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/carpet/commands/DrawCommand.java b/src/main/java/carpet/commands/DrawCommand.java index 853b8e6f..0dd280ff 100644 --- a/src/main/java/carpet/commands/DrawCommand.java +++ b/src/main/java/carpet/commands/DrawCommand.java @@ -159,12 +159,14 @@ public class DrawCommand { } private static int drawSphere(ServerCommandSource source, BlockPos pos, int radius, BlockStateArgument block, - Predicate replacement) { + Predicate replacement) + { return drawSphere(source, pos, (double) radius, (double) radius, (double) radius, block, replacement, false); } private static int drawSphere(ServerCommandSource source, BlockPos pos, double radiusX, double radiusY, - double radiusZ, BlockStateArgument block, Predicate replacement, boolean solid) { + double radiusZ, BlockStateArgument block, Predicate replacement, boolean solid) + { int affected = 0; ServerWorld world = source.getWorld(); @@ -209,25 +211,30 @@ public class DrawCommand { } if (!solid) { - if (lengthSq(nextXn, yn, zn) <= 1 && lengthSq(xn, nextYn, zn) <= 1 - && lengthSq(xn, yn, nextZn) <= 1) { + if (lengthSq(nextXn, yn, zn) <= 1 && lengthSq(xn, nextYn, zn) <= 1 && lengthSq(xn, yn, nextZn) <= 1) + { continue; } } CarpetSettings.impendingFillSkipUpdates = !CarpetSettings.fillUpdates; - for (int xmod = -1; xmod < 2; xmod += 2) { - for (int ymod = -1; ymod < 2; ymod += 2) { - for (int zmod = -1; zmod < 2; zmod += 2) { + for (int xmod = -1; xmod < 2; xmod += 2) + { + for (int ymod = -1; ymod < 2; ymod += 2) + { + for (int zmod = -1; zmod < 2; zmod += 2) + { mbpos.set(pos.getX() + xmod * x, pos.getY() + ymod * y, pos.getZ() + zmod * z); if (replacement == null || replacement.test(new CachedBlockPosition(world, mbpos, true))) { BlockEntity tileentity = world.getBlockEntity(mbpos); - if (tileentity instanceof Inventory) { + if (tileentity instanceof Inventory) + { ((Inventory) tileentity).clear(); } - if (block.setBlockState(world, mbpos, 2)) { + if (block.setBlockState(world, mbpos, 2)) + { list.add(mbpos.toImmutable()); ++affected; }