From 0815e3c1951e78e505bfa69f41e84e6a56204f27 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 5 Jun 2019 12:08:19 -0700 Subject: [PATCH] thank u intellij very cool suggestion --- .../baritone/pathing/movement/movements/MovementPillar.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java index 1d849353..4b8f18cf 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementPillar.java @@ -37,7 +37,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import java.util.Objects; -import java.util.Optional; public class MovementPillar extends Movement { @@ -240,10 +239,7 @@ public class MovementPillar extends Movement { Block fr = frState.getBlock(); // TODO: Evaluate usage of getMaterial().isReplaceable() if (!(fr instanceof BlockAir || frState.getMaterial().isReplaceable())) { - Optional reachable = RotationUtils.reachable(ctx.player(), src, ctx.playerController().getBlockReachDistance()); - if (reachable.isPresent()) { - state.setTarget(new MovementState.MovementTarget(reachable.get(), true)); - } + RotationUtils.reachable(ctx.player(), src, ctx.playerController().getBlockReachDistance()).map(rot -> new MovementState.MovementTarget(rot, true)).ifPresent(state::setTarget); state.setInput(Input.JUMP, false); // breaking is like 5x slower when you're jumping state.setInput(Input.CLICK_LEFT, true); blockIsThere = false;