Hotfix for island disappeared bug

This commit is contained in:
Fabrizio La Rosa 2020-06-16 04:17:49 +02:00
parent 0c1b75d222
commit fa5f34a889

View File

@ -242,9 +242,11 @@ public class Move implements Listener {
e.setCancelled(true);
skyblock.getMessageManager().sendMessage(player,
skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Disappeared.Message"));
skyblock.getSoundManager().playSound(player, CompatibleSound.ENTITY_ENDERMAN_TELEPORT.getSound(), 1.0F, 1.0F);
Bukkit.getScheduler().runTaskLater(skyblock, () -> {
if (e.getTo() != null && worldManager.isIslandWorld(e.getTo().getWorld()) && skyblock.getIslandManager().getIslandAtLocation(e.getTo()) == null)
skyblock.getMessageManager().sendMessage(player,
skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")).getFileConfiguration().getString("Island.WorldBorder.Disappeared.Message"));
skyblock.getSoundManager().playSound(player, CompatibleSound.ENTITY_ENDERMAN_TELEPORT.getSound(), 1.0F, 1.0F);
}, 10L); // 2 ticks are good, 10 because we don't know the cause yet
}
}