mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-22 10:15:54 +01:00
Fix Asynchronous command dispatch!
(PaperMC) (SD-7259)
Bukkit API calls need to be done syncronous. There are possibly some more async calls to the API that we didn't discover until now
This commit is contained in:
parent
c367287ffa
commit
d9af9a06d8
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user