Skip to content

Commit

Permalink
IllegalStateException crash fix - thanks Nirox!
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed May 14, 2024
1 parent 97e4b08 commit 192b129
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
Binary file modified dist/baritone-api-1.0.0.jar
Binary file not shown.
Binary file modified dist/baritone-api-forge-1.0.0.jar
Binary file not shown.
Binary file modified dist/baritone-deobf-1.0.0.jar
Binary file not shown.
Binary file modified dist/baritone-standalone-1.0.0.jar
Binary file not shown.
Binary file modified dist/baritone-standalone-forge-1.0.0.jar
Binary file not shown.
Binary file modified dist/baritone-unoptimized-1.0.0.jar
Binary file not shown.
12 changes: 6 additions & 6 deletions dist/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
9d0650c1b2cdb25fc899163b93711a6243d8dc1f baritone-api-1.0.0.jar
f571f1b3e869962eadc78227ba034df733631289 baritone-deobf-1.0.0.jar
090f3754e3f65082de79acd81c671e2147789106 baritone-api-forge-1.0.0.jar
9baa2c6a32df462f2e4e0caedb6f5ca69764cafc baritone-standalone-1.0.0.jar
350d6bad357927f3f02b7625aa75c16edce2b1ee baritone-standalone-forge-1.0.0.jar
e6750c08310e354035dc5915fd7c87ac286e6880 baritone-unoptimized-1.0.0.jar
a502d3e35833c1c568256379d7957b753c50362d baritone-api-1.0.0.jar
1eee831f9b7e812dac99431b424f0a08218e82ba baritone-deobf-1.0.0.jar
e1b425684c3cca89bd6353e36b8b7c649c5e49b4 baritone-api-forge-1.0.0.jar
6818a55dc4eee1031fba2228d5f3452e21bb8ce3 baritone-standalone-1.0.0.jar
3fc8e268463d0b602fd47659d2483850e466b9b1 baritone-standalone-forge-1.0.0.jar
ff0b0494547a23873fd3d2a5b5af52074d892270 baritone-unoptimized-1.0.0.jar
13 changes: 9 additions & 4 deletions src/api/java/baritone/api/utils/Rotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ public class Rotation {
private final float pitch;

public Rotation(float yaw, float pitch) {
this.yaw = yaw;
this.pitch = pitch;
if (Float.isInfinite(yaw) || Float.isNaN(yaw) || Float.isInfinite(pitch) || Float.isNaN(pitch)) {
throw new IllegalStateException(yaw + " " + pitch);
if (Float.isInfinite(yaw) || Float.isNaN(yaw)) {
this.yaw = 0;
} else {
this.yaw = yaw;
}
if (Float.isInfinite(pitch) || Float.isNaN(pitch)) {
this.pitch = 0;
} else {
this.pitch = pitch;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

@Mixin(EntityPlayerSP.class)
public class MixinEntityPlayerSP {

Expand Down Expand Up @@ -74,6 +77,4 @@ private boolean isKeyDown(KeyBinding instance) {
}
return instance.isKeyDown();
}


}

0 comments on commit 192b129

Please sign in to comment.