mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 10:45:54 +01:00
Heavier checks for portals teleporting to real Nether/End
This commit is contained in:
parent
d40ac674b7
commit
b46473e9fd
@ -61,13 +61,23 @@ public class Teleport implements Listener {
|
||||
islandManager.loadPlayer(player);
|
||||
|
||||
|
||||
// Fix for bug that tp you in the real Nether/End when entering in a portal in an island
|
||||
// Fix for bug that tp you in the real Nether/End when entering in a portal in an island // TODO Simplify
|
||||
if (event.getTo() != null && (worldManager.isIslandWorld(event.getFrom().getWorld())
|
||||
&& !worldManager.isIslandWorld(event.getTo().getWorld())
|
||||
&& (event.getFrom().getBlock().getType().equals(CompatibleMaterial.END_PORTAL.getMaterial())
|
||||
|| event.getFrom().getBlock().getType().equals(CompatibleMaterial.NETHER_PORTAL.getMaterial())) && (event.getTo().getWorld() != null
|
||||
|| event.getFrom().getBlock().getType().equals(CompatibleMaterial.NETHER_PORTAL.getMaterial()))
|
||||
&& (event.getTo().getWorld() != null
|
||||
&& event.getTo().getWorld().getEnvironment().equals(World.Environment.NETHER)
|
||||
|| event.getTo().getWorld().getEnvironment().equals(World.Environment.THE_END)))) {
|
||||
|| event.getTo().getWorld().getEnvironment().equals(World.Environment.THE_END)))
|
||||
|| event.getTo() != null
|
||||
&& (worldManager.isIslandWorld(event.getFrom().getWorld())
|
||||
&& !worldManager.isIslandWorld(event.getTo().getWorld())
|
||||
&& (event.getCause().equals(PlayerTeleportEvent.TeleportCause.NETHER_PORTAL)
|
||||
|| event.getCause().equals(PlayerTeleportEvent.TeleportCause.END_PORTAL)
|
||||
|| event.getCause().equals(PlayerTeleportEvent.TeleportCause.NETHER_PORTAL))
|
||||
&& (event.getTo().getWorld() != null
|
||||
&& event.getTo().getWorld().getEnvironment().equals(World.Environment.NETHER)
|
||||
|| event.getTo().getWorld().getEnvironment().equals(World.Environment.THE_END)))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user