Skip to content

Commit dc92503

Browse files
committed
Still need to fix the math, but at least it does not crash!
1 parent 76cc66e commit dc92503

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

src/main/java/me/redcarlos/netherfreedom/modules/main/BaritoneMiner.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import meteordevelopment.meteorclient.settings.*;
2020
import meteordevelopment.meteorclient.systems.modules.Module;
2121
import meteordevelopment.meteorclient.systems.modules.Modules;
22-
import meteordevelopment.meteorclient.utils.misc.HorizontalDirection;
2322
import meteordevelopment.meteorclient.utils.misc.Keybind;
2423
import meteordevelopment.meteorclient.utils.player.FindItemResult;
2524
import meteordevelopment.meteorclient.utils.player.InvUtils;
@@ -115,7 +114,6 @@ public BaritoneMiner() {
115114
}
116115

117116
private Direction toEndOfLineDir, toAdvanceDir, shulkerPlaceDir = null;
118-
private HorizontalDirection dir = null;
119117
private BlockPos endOfLinePos, barPos, offsetPos, currPlayerPos, shulkerPlacePos, savedPos = null;
120118
private boolean offsetting, bindPressed, isPaused, refilling, placedShulker, defined = false;
121119
private int length, initialNetherrack, initialPicksBroken = 0;
@@ -129,8 +127,6 @@ public void onActivate() {
129127
baritoneSettings.allowPlace.value = true;
130128
baritoneSettings.mineScanDroppedItems.value = true;
131129

132-
dir = HorizontalDirection.get(mc.player.getYaw());
133-
134130
if (!defined && !pathStart.get()) {
135131
start();
136132
} else if (!defined && pathStart.get()) {
@@ -353,12 +349,11 @@ private void start() {
353349
setGoal(barPos);
354350
}
355351

356-
357352
// Finds the direction for one block to get to the other
358353
private Direction findBlockDir(BlockPos originBlock, BlockPos goalBlock) {
359354
// Very bad this can very easily break if the 2 blocks positions are not inline with each other
360355
BlockPos vec3d = BlockPos.ofFloored(Math.signum(goalBlock.getX() - originBlock.getX()), 0, Math.signum(goalBlock.getZ() - originBlock.getZ()));
361-
return Direction.getFacing(Vec3d.of(vec3d)).getOpposite();
356+
return Direction.getFacing(Vec3d.of(vec3d));
362357
}
363358

364359
/**
@@ -381,12 +376,8 @@ private void setGoal(BlockPos goal) {
381376
private int findDistance(BlockPos pos1, BlockPos pos2, Direction dir) {
382377
int dist = 0;
383378
switch (dir) {
384-
case NORTH, SOUTH -> {
385-
dist = Math.abs(pos1.getZ() - pos2.getZ());
386-
}
387-
case EAST, WEST -> {
388-
dist = Math.abs(pos1.getX() - pos2.getX());
389-
}
379+
case NORTH -> dist = Math.abs(pos1.getZ() - pos2.getZ());
380+
case WEST -> dist = Math.abs(pos1.getX() - pos2.getX());
390381
}
391382
return dist;
392383
}

0 commit comments

Comments
 (0)