Merge branch 'SD-7259' into development

This commit is contained in:
Christian Koop 2021-04-09 18:30:14 +02:00
commit 49ed7c6449
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 20 additions and 12 deletions

View File

@ -275,12 +275,14 @@ public class IslandManager {
Bukkit.getServer().getScheduler().runTaskLater(plugin, () ->
plugin.getBiomeManager().setBiome(island, IslandWorld.Normal, compatibleBiome, () -> {
if (structure.getCommands() != null) {
for (String commandList : structure.getCommands()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), commandList.replace("%player", player.getName()));
}
}
}), 20L);
if (structure.getCommands() != null) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
for (String commandList : structure.getCommands()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), commandList.replace("%player", player.getName()));
}
});
}
}), 20L);
// Recalculate island level after 5 seconds
if (configLoad.getBoolean("Island.Levelling.ScanAutomatically"))
@ -1611,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));
}
});
}
}
@ -1621,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;