Clean up PathingBehavior#findPath
This commit is contained in:
parent
bc82276e62
commit
aa2caf63d3
@ -33,6 +33,7 @@ import baritone.pathing.path.PathExecutor;
|
||||
import baritone.utils.BlockStateInterface;
|
||||
import baritone.utils.Helper;
|
||||
import baritone.utils.PathRenderer;
|
||||
import baritone.utils.interfaces.IGoalRenderPos;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.chunk.EmptyChunk;
|
||||
@ -309,18 +310,9 @@ public final class PathingBehavior extends Behavior implements Helper {
|
||||
}
|
||||
if (Baritone.settings().simplifyUnloadedYCoord.get()) {
|
||||
BlockPos pos = null;
|
||||
if (goal instanceof GoalBlock) {
|
||||
pos = ((GoalBlock) goal).getGoalPos();
|
||||
}
|
||||
if (goal instanceof GoalTwoBlocks) {
|
||||
pos = ((GoalTwoBlocks) goal).getGoalPos();
|
||||
}
|
||||
if (goal instanceof GoalNear) {
|
||||
pos = ((GoalNear) goal).getGoalPos();
|
||||
}
|
||||
if (goal instanceof GoalGetToBlock) {
|
||||
pos = ((GoalGetToBlock) goal).getGoalPos();
|
||||
}
|
||||
if (goal instanceof IGoalRenderPos)
|
||||
pos = ((IGoalRenderPos) goal).getGoalPos();
|
||||
|
||||
// TODO simplify each individual goal in a GoalComposite
|
||||
if (pos != null && world().getChunk(pos) instanceof EmptyChunk) {
|
||||
logDebug("Simplifying " + goal.getClass() + " to GoalXZ due to distance");
|
||||
|
@ -73,6 +73,7 @@ public class GoalBlock implements Goal, IGoalRenderPos {
|
||||
/**
|
||||
* @return The position of this goal as a {@link BlockPos}
|
||||
*/
|
||||
@Override
|
||||
public BlockPos getGoalPos() {
|
||||
return new BlockPos(x, y, z);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class GoalGetToBlock implements Goal, IGoalRenderPos {
|
||||
this.z = pos.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getGoalPos() {
|
||||
return new BetterBlockPos(x, y, z);
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ public class GoalNear implements Goal, IGoalRenderPos {
|
||||
return GoalBlock.calculate(diffX, diffY, diffZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getGoalPos() {
|
||||
return new BlockPos(x, y, z);
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ public class GoalTwoBlocks implements Goal, IGoalRenderPos {
|
||||
return GoalBlock.calculate(xDiff, yDiff, zDiff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getGoalPos() {
|
||||
return new BlockPos(x, y, z);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user