Player Changing world should be nicer for teleports
This commit is contained in:
parent
f060b27be6
commit
f6140620c8
@ -277,9 +277,9 @@ public class DisguiseListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onTeleport(final PlayerTeleportEvent event) {
|
public void onTeleport(final PlayerTeleportEvent event) {
|
||||||
if (DisguiseConfig.isBedPacketsEnabled()) {
|
|
||||||
Location to = event.getTo();
|
Location to = event.getTo();
|
||||||
Location from = event.getFrom();
|
Location from = event.getFrom();
|
||||||
|
if (DisguiseConfig.isBedPacketsEnabled()) {
|
||||||
int x1 = (int) Math.floor(to.getX() / 16D) - 17;
|
int x1 = (int) Math.floor(to.getX() / 16D) - 17;
|
||||||
int x2 = (int) Math.floor(from.getX() / 16D) - 17;
|
int x2 = (int) Math.floor(from.getX() / 16D) - 17;
|
||||||
int z1 = (int) Math.floor(to.getZ() / 16D) - 17;
|
int z1 = (int) Math.floor(to.getZ() / 16D) - 17;
|
||||||
@ -297,6 +297,12 @@ public class DisguiseListener implements Listener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (DisguiseConfig.isUndisguiseOnWorldChange() && to.getWorld() != null && from.getWorld() != null
|
||||||
|
&& to.getWorld() != from.getWorld()) {
|
||||||
|
for (Disguise disguise : DisguiseAPI.getDisguises(event.getPlayer())) {
|
||||||
|
disguise.removeDisguise();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
Loading…
Reference in New Issue
Block a user