Teleporting between worlds is a thing

This commit is contained in:
selfslaughter 2020-04-23 21:27:37 +10:00
parent 1f5f99e1dc
commit 7791e19ac8

View File

@ -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);
}