if already looking at the block, no need to change rotation
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package baritone.bot.behavior.impl;
|
package baritone.bot.behavior.impl;
|
||||||
|
|
||||||
|
import baritone.bot.pathing.movement.MovementHelper;
|
||||||
import baritone.bot.utils.BlockStateInterface;
|
import baritone.bot.utils.BlockStateInterface;
|
||||||
import baritone.bot.utils.Helper;
|
import baritone.bot.utils.Helper;
|
||||||
import baritone.bot.utils.Rotation;
|
import baritone.bot.utils.Rotation;
|
||||||
@@ -35,6 +36,9 @@ public final class LookBehaviorUtils implements Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<Rotation> reachable(BlockPos pos) {
|
public static Optional<Rotation> reachable(BlockPos pos) {
|
||||||
|
if (pos.equals(MovementHelper.whatAmILookingAt().orElse(null))) {
|
||||||
|
return Optional.of(new Rotation(mc.player.rotationYaw, mc.player.rotationPitch));
|
||||||
|
}
|
||||||
Optional<Rotation> possibleRotation = reachableCenter(pos);
|
Optional<Rotation> possibleRotation = reachableCenter(pos);
|
||||||
if (possibleRotation.isPresent())
|
if (possibleRotation.isPresent())
|
||||||
return possibleRotation;
|
return possibleRotation;
|
||||||
@@ -67,6 +71,7 @@ public final class LookBehaviorUtils implements Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if coordinate is reachable with the given block-face rotation offset
|
* Checks if coordinate is reachable with the given block-face rotation offset
|
||||||
|
*
|
||||||
* @param pos
|
* @param pos
|
||||||
* @param offset
|
* @param offset
|
||||||
* @return
|
* @return
|
||||||
@@ -84,6 +89,7 @@ public final class LookBehaviorUtils implements Helper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if center of block at coordinate is reachable
|
* Checks if center of block at coordinate is reachable
|
||||||
|
*
|
||||||
* @param pos
|
* @param pos
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user