Teleporting between worlds is a thing
This commit is contained in:
parent
1f5f99e1dc
commit
7791e19ac8
@ -27,7 +27,8 @@ public class OnPlayerTeleportEvent implements Listener {
|
||||
*/
|
||||
private void handlePlayer(PlayerTeleportEvent event, Player player) {
|
||||
Location storedLoc = MemoryStorage.teleportLoc.remove(player);
|
||||
if (storedLoc == null || event.getTo().distanceSquared(storedLoc) > 1) {
|
||||
Location to = event.getTo();
|
||||
if (storedLoc == null || storedLoc.getWorld() != to.getWorld() || to.distanceSquared(storedLoc) > 1) {
|
||||
MessageManager.sendFMessage(player, ConfigC.error_teleportBlocked);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user