Change listener to monitor and make sure that PlayerPortalEvent isn't cancelled before removing disguises
This commit is contained in:
parent
b9087f6fc3
commit
69ea8ed2a0
@ -249,9 +249,10 @@ public class DisguiseListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onWorldSwitch(PlayerPortalEvent event) {
|
||||
if (DisguiseConfig.isUndisguiseOnWorldChange() && event.getFrom().getWorld() != event.getTo().getWorld()) {
|
||||
if (!event.isCancelled() && DisguiseConfig.isUndisguiseOnWorldChange()
|
||||
&& event.getFrom().getWorld() != event.getTo().getWorld()) {
|
||||
for (Disguise disguise : DisguiseAPI.getDisguises(event.getPlayer())) {
|
||||
disguise.removeDisguise();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user