add dimension checks

This commit is contained in:
Babbaj 2023-07-23 20:46:12 -04:00
parent dbf38efd83
commit 293b556b56
No known key found for this signature in database
GPG Key ID: F044309848A07CAC
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) {