Move undisguising on world change to world change event

This commit is contained in:
libraryaddict 2014-09-16 12:55:38 +12:00
parent 4ab9b14993
commit 4bd420570e

View File

@ -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) {