Merge pull request #4068 from babbaj/elytra

add dimension checks to elytra
This commit is contained in:
leijurv 2023-07-23 17:47:46 -07:00 committed by GitHub
commit 6ffe31b59e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {