Make elytra API changes
This commit is contained in:
@@ -64,7 +64,6 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
|
||||
private final NetherPathfinderContext context;
|
||||
private final PathManager pathManager;
|
||||
private int sinceFirework;
|
||||
private boolean pawsed = false;
|
||||
|
||||
public ElytraBehavior(Baritone baritone) {
|
||||
super(baritone);
|
||||
@@ -180,6 +179,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
|
||||
this.path = Collections.emptyList();
|
||||
this.playerNear = 0;
|
||||
this.completePath = true;
|
||||
this.destination = null;
|
||||
}
|
||||
|
||||
private void setPath(final UnpackedSegment segment) {
|
||||
@@ -305,33 +305,22 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
|
||||
.forEach(this.context::queueForPacking);
|
||||
}
|
||||
|
||||
public void path(BlockPos destination) {
|
||||
pawsed = false;
|
||||
@Override
|
||||
public void pathTo(BlockPos destination) {
|
||||
this.pathManager.pathToDestination(destination);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
this.visiblePath = Collections.emptyList();
|
||||
this.pathManager.clear();
|
||||
this.aimPos = null;
|
||||
this.sinceFirework = 0;
|
||||
pawsed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return !this.pathManager.getPath().isEmpty() && !isPaused();
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
this.pawsed = true;
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
this.pawsed = false;
|
||||
}
|
||||
|
||||
public boolean isPaused() {
|
||||
return this.pawsed;
|
||||
return !this.pathManager.getPath().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,7 +328,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
|
||||
if (event.getType() == TickEvent.Type.OUT) {
|
||||
return;
|
||||
}
|
||||
if (isPaused()) return;
|
||||
|
||||
this.clearLines.clear();
|
||||
this.blockedLines.clear();
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ElytraCommand extends Command {
|
||||
if (y <= 0 || y >= 128) {
|
||||
throw new CommandInvalidStateException("The y of the goal is not between 0 and 128");
|
||||
}
|
||||
((Baritone) baritone).getElytraBehavior().path(new BlockPos(x, y, z));
|
||||
((Baritone) baritone).getElytraBehavior().pathTo(new BlockPos(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,6 @@ public class ExecutionControlCommands {
|
||||
throw new CommandInvalidStateException("Already paused");
|
||||
}
|
||||
paused[0] = true;
|
||||
baritone.getElytraBehavior().pause();
|
||||
logDirect("Paused");
|
||||
}
|
||||
|
||||
@@ -124,7 +123,6 @@ public class ExecutionControlCommands {
|
||||
throw new CommandInvalidStateException("Not paused");
|
||||
}
|
||||
paused[0] = false;
|
||||
baritone.getElytraBehavior().resume();
|
||||
logDirect("Resumed");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user