diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 16:07:46 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 16:07:46 +0200 |
commit | f26c7b84a9e2d72d4ba3e7b03283697bfe610ea8 (patch) | |
tree | 0ea9c8e17821496a369de02058f5335189e9a314 /src/main | |
parent | 9bf3a34c63179cfa7df0272c10e1ad09268f42ab (diff) | |
download | NotEnoughUpdates-f26c7b84a9e2d72d4ba3e7b03283697bfe610ea8.tar.gz NotEnoughUpdates-f26c7b84a9e2d72d4ba3e7b03283697bfe610ea8.tar.bz2 NotEnoughUpdates-f26c7b84a9e2d72d4ba3e7b03283697bfe610ea8.zip |
finalize
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java index 22d8e59c..24496593 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -37,7 +37,6 @@ public class CrystalMetalDetectorSolver { if (inRange(calculatedDist, dist) && treasureAllowed(pos) && !possibleBlocks.contains(pos) && mc.theWorld.getBlockState(above).getBlock().getRegistryName().equals("minecraft:air")) { possibleBlocks.add(pos); - System.out.println(calculatedDist); } xOffset++; } @@ -52,7 +51,6 @@ public class CrystalMetalDetectorSolver { if (inRange(calculatedDist, dist) && treasureAllowed(pos) && !possibleBlocks.contains(pos) && mc.theWorld.getBlockState(above).getBlock().getRegistryName().equals("minecraft:air")) { possibleBlocks.add(pos); - System.out.println(calculatedDist); } xOffset++; } @@ -63,10 +61,18 @@ public class CrystalMetalDetectorSolver { locations.add(mc.thePlayer.getPosition()); List<BlockPos> temp = new ArrayList<>(); for (BlockPos pos : possibleBlocks) { - if (inRange(calculateDistance(new Vec3(pos).addVector(0, 1d, 0), new Vec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)), dist)) { + if (round(calculateDistance(new Vec3(pos).addVector(0, 1d, 0), new Vec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)), 1) + == dist) { temp.add(pos); } } + if(temp.size() == 0) { + for (BlockPos pos : possibleBlocks) { + if (inRange(calculateDistance(new Vec3(pos).addVector(0, 1d, 0), new Vec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)), dist)) { + temp.add(pos); + } + } + } possibleBlocks = temp; sendMessage(); } @@ -125,6 +131,6 @@ public class CrystalMetalDetectorSolver { } private static boolean inRange(float number, float dist) { - return dist + 0.1D >= number && dist - 0.1D <= number; + return dist + 0.15D >= number && dist - 0.15D <= number; } } |