mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-10-03 00:47:32 +02:00
Fix for Residence compatibility
This commit is contained in:
parent
341edb3c3b
commit
66e3dfbc01
@ -54,17 +54,20 @@ public class Teleport implements Listener {
|
|||||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
|
||||||
FileConfiguration configLoad = config.getFileConfiguration();
|
FileConfiguration configLoad = config.getFileConfiguration();
|
||||||
|
|
||||||
|
if(worldManager.isIslandWorld(event.getFrom().getWorld())
|
||||||
|
|| (event.getTo() != null && worldManager.isIslandWorld(event.getTo().getWorld()))) {
|
||||||
Bukkit.getScheduler().runTaskLater(skyblock, () -> islandManager.updateFlight(player), 1L);
|
Bukkit.getScheduler().runTaskLater(skyblock, () -> islandManager.updateFlight(player), 1L);
|
||||||
|
}
|
||||||
islandManager.loadPlayer(player);
|
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
|
||||||
if (worldManager.isIslandWorld(event.getFrom().getWorld())
|
if (event.getTo() != null && (worldManager.isIslandWorld(event.getFrom().getWorld())
|
||||||
&& !worldManager.isIslandWorld(event.getTo().getWorld())
|
&& !worldManager.isIslandWorld(event.getTo().getWorld())
|
||||||
&& (event.getFrom().getBlock().getType().equals(CompatibleMaterial.END_PORTAL.getMaterial())
|
&& (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.NETHER)
|
||||||
|| event.getTo().getWorld().getEnvironment().equals(World.Environment.THE_END))) {
|
|| event.getTo().getWorld().getEnvironment().equals(World.Environment.THE_END)))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user