From b74432e4af000316f786f32528f298f37eb3da63 Mon Sep 17 00:00:00 2001 From: Jaranamo1 <91566571+Jaranamo1@users.noreply.github.com> Date: Sun, 13 Aug 2023 11:48:26 +0100 Subject: [PATCH] Improve AnchorAura (#3677) --- .../meteorclient/systems/modules/combat/AnchorAura.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AnchorAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AnchorAura.java index c272a4ba7d..38b1a947da 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AnchorAura.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AnchorAura.java @@ -322,6 +322,12 @@ private BlockPos findPlacePos(BlockPos targetPlacePos) { if (isValidPlace(targetPlacePos.down())) return targetPlacePos.down(); else if (isValidPlace(targetPlacePos.up(2))) return targetPlacePos.up(2); break; + case Around: + if (isValidPlace(targetPlacePos.north())) return targetPlacePos.north(); + else if (isValidPlace(targetPlacePos.east())) return targetPlacePos.east(); + else if (isValidPlace(targetPlacePos.west())) return targetPlacePos.west(); + else if (isValidPlace(targetPlacePos.south())) return targetPlacePos.south(); + break; } return null; } @@ -349,7 +355,7 @@ private boolean getDamageBreak(BlockPos pos) { } private boolean isValidPlace(BlockPos pos) { - return (mc.world.getBlockState(pos).isAir() || mc.world.getBlockState(pos).getFluidState().getFluid() instanceof FlowableFluid) && Math.sqrt(mc.player.getBlockPos().getSquaredDistance(pos)) <= placeRange.get() && getDamagePlace(pos); + return Math.sqrt(mc.player.getBlockPos().getSquaredDistance(pos)) <= placeRange.get() && getDamagePlace(pos) && BlockUtils.canPlace(pos, true); } private boolean isValidBreak(BlockPos pos) { @@ -385,6 +391,7 @@ public String getInfoString() { public enum PlaceMode { Above, + Around, AboveAndBelow, All }