Fixed issue with portals mainly from the nether to the end.

This commit is contained in:
Brianna 2021-01-26 10:50:50 -06:00
parent c61e14c0c3
commit 3f0f93ef12
2 changed files with 5 additions and 5 deletions

View File

@ -46,9 +46,10 @@ public class MoveListeners implements Listener {
Location from = event.getFrom();
Location to = event.getTo();
if (from.getBlockX() == to.getBlockX() && from.getBlockY() == to.getBlockY() && from.getBlockZ() == to.getBlockZ()) {
if (from.getBlockX() == to.getBlockX()
&& from.getBlockY() == to.getBlockY()
&& from.getBlockZ() == to.getBlockZ())
return;
}
PlayerDataManager playerDataManager = plugin.getPlayerDataManager();
MessageManager messageManager = plugin.getMessageManager();
@ -56,7 +57,6 @@ public class MoveListeners implements Listener {
PermissionManager permissionManager = plugin.getPermissionManager();
SoundManager soundManager = plugin.getSoundManager();
WorldManager worldManager = plugin.getWorldManager();
FileManager fileManager = plugin.getFileManager();
if (!worldManager.isIslandWorld(player.getWorld())) return;

View File

@ -124,9 +124,9 @@ public class PortalListeners implements Listener {
IslandWorld toWorld = IslandWorld.Normal;
if (block.getType().equals(CompatibleMaterial.NETHER_PORTAL.getMaterial())) {
toWorld = fromWorld.equals(IslandWorld.Normal) ? IslandWorld.Nether : IslandWorld.Normal;
toWorld = fromWorld.equals(IslandWorld.Nether) ? IslandWorld.Normal : IslandWorld.Nether;
} else if (block.getType().equals(CompatibleMaterial.END_PORTAL.getMaterial())) {
toWorld = fromWorld.equals(IslandWorld.Normal) ? IslandWorld.End : IslandWorld.Normal;
toWorld = fromWorld.equals(IslandWorld.End) ? IslandWorld.Normal : IslandWorld.End;
}
if(!perms){