Fix exit-deny-message using wrong region set on enderpearl/chorus-fruit.

This commit is contained in:
wizjany 2019-10-06 11:25:59 -04:00
parent e792dd6f98
commit 4c9812db04

View File

@ -379,7 +379,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event) {
String message = null;
if (!setFrom.testState(localPlayer, Flags.ENDERPEARL)) {
cancel = true;
message = set.queryValue(localPlayer, Flags.EXIT_DENY_MESSAGE);
message = setFrom.queryValue(localPlayer, Flags.EXIT_DENY_MESSAGE);
} else if (!set.testState(localPlayer, Flags.ENDERPEARL)) {
cancel = true;
message = set.queryValue(localPlayer, Flags.ENTRY_DENY_MESSAGE);
@ -392,14 +392,13 @@ public void onPlayerTeleport(PlayerTeleportEvent event) {
return;
}
}
}
if (event.getCause() == TeleportCause.CHORUS_FRUIT) {
} else if (event.getCause() == TeleportCause.CHORUS_FRUIT) {
if (!WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(localPlayer, localPlayer.getWorld())) {
boolean cancel = false;
String message = null;
if (!setFrom.testState(localPlayer, Flags.CHORUS_TELEPORT)) {
cancel = true;
message = set.queryValue(localPlayer, Flags.EXIT_DENY_MESSAGE);
message = setFrom.queryValue(localPlayer, Flags.EXIT_DENY_MESSAGE);
} else if (!set.testState(localPlayer, Flags.CHORUS_TELEPORT)) {
cancel = true;
message = set.queryValue(localPlayer, Flags.ENTRY_DENY_MESSAGE);