mirror of https://github.com/cabaletta/baritone
Merge pull request #4068 from babbaj/elytra
add dimension checks to elytra
This commit is contained in:
commit
6ffe31b59e
|
@ -54,6 +54,9 @@ public class ElytraCommand extends Command {
|
|||
if (iGoal == null) {
|
||||
throw new CommandInvalidStateException("No goal has been set");
|
||||
}
|
||||
if (ctx.player().dimension != -1) {
|
||||
throw new CommandInvalidStateException("Only works in the nether");
|
||||
}
|
||||
try {
|
||||
elytra.pathTo(iGoal);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
|
|
|
@ -259,6 +259,9 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
|
|||
|
||||
@Override
|
||||
public void pathTo(BlockPos destination) {
|
||||
if (ctx.player() == null || ctx.player().dimension != -1) {
|
||||
return;
|
||||
}
|
||||
this.onLostControl();
|
||||
this.behavior = new ElytraBehavior(this.baritone, this, destination);
|
||||
if (ctx.world() != null) {
|
||||
|
|
Loading…
Reference in New Issue