From 4bd420570e5a01582d09465eb2e8334eada6c4e4 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 16 Sep 2014 12:55:38 +1200 Subject: [PATCH] Move undisguising on world change to world change event --- .../libraryaddict/disguise/DisguiseListener.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseListener.java b/src/me/libraryaddict/disguise/DisguiseListener.java index e26905a9..c1538c42 100644 --- a/src/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/me/libraryaddict/disguise/DisguiseListener.java @@ -163,15 +163,6 @@ public class DisguiseListener implements Listener { } } - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onPortalEnter(PlayerPortalEvent event) { - if (DisguiseConfig.isUndisguiseOnWorldChange() && event.getFrom().getWorld() != event.getTo().getWorld()) { - for (Disguise disguise : DisguiseAPI.getDisguises(event.getPlayer())) { - disguise.removeDisguise(); - } - } - } - @EventHandler public void onRespawn(PlayerRespawnEvent event) { Disguise[] disguises = DisguiseAPI.getDisguises(event.getPlayer()); @@ -331,6 +322,11 @@ public class DisguiseListener implements Listener { if (DisguiseConfig.isBedPacketsEnabled()) { chunkMove(event.getPlayer(), event.getPlayer().getLocation(), null); } + if (DisguiseConfig.isUndisguiseOnWorldChange() && event.getFrom().getWorld() != event.getTo().getWorld()) { + for (Disguise disguise : DisguiseAPI.getDisguises(event.getPlayer())) { + disguise.removeDisguise(); + } + } } public void setDisguiseClone(final String player, Boolean[] options) {