Move undisguising on world change to world change event
This commit is contained in:
parent
4ab9b14993
commit
4bd420570e
@ -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
|
@EventHandler
|
||||||
public void onRespawn(PlayerRespawnEvent event) {
|
public void onRespawn(PlayerRespawnEvent event) {
|
||||||
Disguise[] disguises = DisguiseAPI.getDisguises(event.getPlayer());
|
Disguise[] disguises = DisguiseAPI.getDisguises(event.getPlayer());
|
||||||
@ -331,6 +322,11 @@ public class DisguiseListener implements Listener {
|
|||||||
if (DisguiseConfig.isBedPacketsEnabled()) {
|
if (DisguiseConfig.isBedPacketsEnabled()) {
|
||||||
chunkMove(event.getPlayer(), event.getPlayer().getLocation(), null);
|
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) {
|
public void setDisguiseClone(final String player, Boolean[] options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user