Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public Command.Builder<CommandSender> populateBuilder(Command.Builder<CommandSen
},
"Player has teleportation disabled"
),
new ArgumentPredicate<>(
false,
(context, player) -> {
if (context.getSender().hasPermission(TELEPORT_ALL_PERM)) {
return true;
}
AdminModule adminModule = basicsModule.getPlugin().getModule(AdminModule.class);
if (adminModule != null) {
return adminModule.getPunishmentManager().getPunishments(player.getUniqueId()).getJailPunishment() == null;
}
return true;
},
"Player has teleportation disabled"
),
new ArgumentPredicate<>(
false,
(context, player) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ public NabsBeGoneCommand(NabModeModule nabModeModule) {

private void sendAway(Player player) {
Location backLocation = basicsModule.getBackManager().getBackLocation(player);
if (backLocation == null || nabDimensionManager.getNabWorld().equals(backLocation.getWorld())) {
backLocation = player.getRespawnLocation();
Location respawnLocation = player.getRespawnLocation();
if (respawnLocation != null && nabDimensionManager.getNabWorld().equals(respawnLocation.getWorld())) {
player.setRespawnLocation(null);
} else if (backLocation == null || nabDimensionManager.getNabWorld().equals(backLocation.getWorld())) {
backLocation = respawnLocation;
}
if (backLocation == null) {
backLocation = basicsModule.getSpawnManager().getSpawnLocation();
Expand Down