Fix async API call for WorldBorder updates

This commit is contained in:
Christian Koop 2021-04-08 18:34:59 +02:00
parent d9af9a06d8
commit 3704efaf69
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 12 additions and 6 deletions

View File

@ -1613,9 +1613,11 @@ public class IslandManager {
for (IslandWorld worldList : IslandWorld.getIslandWorlds()) {
if (worldList != IslandWorld.Nether || ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) {
for (Player all : getPlayersAtIsland(island)) {
WorldBorder.send(all, island.getBorderColor(), island.getSize(), island.getLocation(worldManager.getIslandWorld(all.getWorld()), IslandEnvironment.Island).clone().add(increment, 0, increment));
}
Bukkit.getScheduler().runTask(plugin, () -> {
for (Player all : getPlayersAtIsland(island)) {
WorldBorder.send(all, island.getBorderColor(), island.getSize(), island.getLocation(worldManager.getIslandWorld(all.getWorld()), IslandEnvironment.Island).clone().add(increment, 0, increment));
}
});
}
}
@ -1623,9 +1625,11 @@ public class IslandManager {
} else {
for (IslandWorld worldList : IslandWorld.getIslandWorlds()) {
if (worldList != IslandWorld.Nether || ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) {
for (Player all : getPlayersAtIsland(island)) {
WorldBorder.send(all, null, 1.4999992E7D, new Location(all.getWorld(), 0, 0, 0));
}
Bukkit.getScheduler().runTask(plugin, () -> {
for (Player all : getPlayersAtIsland(island)) {
WorldBorder.send(all, null, 1.4999992E7D, new Location(all.getWorld(), 0, 0, 0));
}
});
}
}

View File

@ -1,7 +1,9 @@
package com.songoda.skyblock.utils.world;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.utils.version.NMSUtil;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;