Skip to content

Commit

Permalink
more clean
Browse files Browse the repository at this point in the history
  • Loading branch information
olim88 committed Aug 30, 2024
1 parent 673ec46 commit 98b5322
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/de/hysky/skyblocker/skyblock/SmoothAOTE.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private static void calculateTeleportUse(Hand hand) {
}

//work out start pos of warp and set start time. if there is an active warp going on make the end of that the start of the next one
if (teleportsAhead == 0) {
if (teleportsAhead == 0 || startPos == null || teleportVector == null) {
//start of teleport sequence
startPos = CLIENT.player.getPos().add(0, 1.62, 0); // the eye poss should not be affected by crouching
cameraStartPos = CLIENT.player.getEyePos();
Expand Down Expand Up @@ -272,12 +272,11 @@ private static Vec3d raycast(int distance, Vec3d direction, Vec3d startPos) {
if (CLIENT.world == null) {
return null;
}
for (double offset = 0; offset <= distance; offset += 1) {
for (double offset = 0; offset <= distance; offset ++) {
BlockPos checkPos = BlockPos.ofFloored(startPos.add(direction.multiply(offset)));

//there are block in the way return the previce location
//there are block in the way return the last location
if (!CLIENT.world.getBlockState(checkPos).isAir() || !CLIENT.world.getBlockState(checkPos.up()).isAir()) { //todo some transparent blocks can be teleported in (Buttons could be more)
System.out.println(startPos.add(direction.multiply(offset - 1)) + "hit block");
if (offset == 0) {
// no teleport can happen
return null;
Expand Down

0 comments on commit 98b5322

Please sign in to comment.