Merge pull request #1949 from Ichbinjoe/2.x_feature_jail_no_teleport

[Feature] Add config optn. to disable jail free tp
This commit is contained in:
Joseph Hirschfeld 2019-04-17 02:04:16 -04:00 committed by GitHub
commit 8c0aa840ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 5 deletions

View file

@ -522,12 +522,14 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
setJailed(false);
sendMessage(tl("haveBeenReleased"));
setJail(null);
try {
getTeleport().back();
} catch (Exception ex) {
if (ess.getSettings().isTeleportBackWhenFreedFromJail()) {
try {
getTeleport().respawn(null, TeleportCause.PLUGIN);
} catch (Exception ex1) {
getTeleport().back();
} catch (Exception ex) {
try {
getTeleport().respawn(null, TeleportCause.PLUGIN);
} catch (Exception ex1) {
}
}
}
return true;