Skip to content

Commit

Permalink
Add hidden config to stop throwing errors for passengers (#3445)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy committed Jul 2, 2020
1 parent 65f8883 commit 0b4ee9e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Essentials/src/com/earth2me/essentials/AsyncTeleport.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected void nowAsync(IUser teleportee, ITarget target, TeleportCause cause, C
}
teleportee.setLastLocation();

if (!teleportee.getBase().isEmpty()) {
if (!ess.getSettings().isForcePassengerTeleport() && !teleportee.getBase().isEmpty()) {
if (!ess.getSettings().isTeleportPassengerDismount()) {
future.completeExceptionally(new Exception(tl("passengerTeleportFail")));
return;
Expand Down
2 changes: 2 additions & 0 deletions Essentials/src/com/earth2me/essentials/ISettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public interface ISettings extends IConf {

boolean isTeleportPassengerDismount();

boolean isForcePassengerTeleport();

double getTeleportCooldown();

double getTeleportDelay();
Expand Down
5 changes: 5 additions & 0 deletions Essentials/src/com/earth2me/essentials/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ public boolean isTeleportPassengerDismount() {
return config.getBoolean("teleport-passenger-dismount", true);
}

@Override
public boolean isForcePassengerTeleport() {
return config.getBoolean("force-passenger-teleportation", false);
}

@Override
public double getTeleportDelay() {
return config.getDouble("teleport-delay", 0);
Expand Down

0 comments on commit 0b4ee9e

Please sign in to comment.