Skip to content

Commit

Permalink
Removed code duplicate (isGrounded)
Browse files Browse the repository at this point in the history
  • Loading branch information
omnivoyant authored Jun 24, 2022
1 parent 78aaeca commit 7b42c92
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -159,9 +158,7 @@ private Task placeMLGBucketTask(AltoClef mod, BlockPos toPlaceOn) {
}
}
}
// Try to capture tall grass as well...
BlockPos[] toCheckLook = new BlockPos[] {toPlaceOn, toPlaceOn.up(), toPlaceOn.up(2)};
if (hasClutch && Arrays.stream(toCheckLook).anyMatch(check -> mod.getClientBaritone().getPlayerContext().isLookingAt(check))) {
if (hasClutch && mod.getClientBaritone().getPlayerContext().isLookingAt(toPlaceOn)) {
Debug.logMessage("HIT: " + willLandIn);
_placedPos = willLandIn;
mod.getInputControls().tryPress(Input.CLICK_RIGHT);
Expand Down Expand Up @@ -490,7 +487,7 @@ protected void onStop(AltoClef mod, Task interruptTask) {

@Override
public boolean isFinished(AltoClef mod) {
return mod.getPlayer().isSwimming() || mod.getPlayer().isTouchingWater() || mod.getPlayer().isOnGround() || mod.getPlayer().isClimbing();
return EntityHelper.isGrounded(mod);
}

@Override
Expand Down

0 comments on commit 7b42c92

Please # to comment.