From 74deeea904737c34a6f4dd5bda146feb9a05756a Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Wed, 6 Sep 2023 20:58:18 +0100 Subject: [PATCH] cleanup blockutils --- .../meteorclient/utils/world/BlockUtils.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/utils/world/BlockUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/world/BlockUtils.java index ab6e3c2d89..e7a53280c3 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/world/BlockUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/world/BlockUtils.java @@ -270,24 +270,12 @@ public static Direction getDirection(BlockPos pos) { Vec3d eyesPos = new Vec3d(mc.player.getX(), mc.player.getY() + mc.player.getEyeHeight(mc.player.getPose()), mc.player.getZ()); if ((double) pos.getY() > eyesPos.y) { if (mc.world.getBlockState(pos.add(0, -1, 0)).isReplaceable()) return Direction.DOWN; - else return getOppositeDirection(); + else return mc.player.getHorizontalFacing().getOpposite(); } - if (!mc.world.getBlockState(pos.add(0, 1, 0)).isReplaceable()) return getOppositeDirection(); + if (!mc.world.getBlockState(pos.add(0, 1, 0)).isReplaceable()) return mc.player.getHorizontalFacing().getOpposite(); return Direction.UP; } - // Example: If the player is facing east, then that means they would click the west side of a block. - private static Direction getOppositeDirection() { - return switch (mc.player.getHorizontalFacing()) { - case DOWN -> Direction.UP; - case UP -> Direction.DOWN; - case NORTH -> Direction.SOUTH; - case SOUTH -> Direction.NORTH; - case WEST -> Direction.EAST; - case EAST -> Direction.WEST; - }; - } - public enum MobSpawn { Never, Potential,