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:
Christian Koop 2021-04-08 18:34:20 +02:00
parent c367287ffa
commit d9af9a06d8
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -276,9 +276,11 @@ public class IslandManager {
Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> Bukkit.getServer().getScheduler().runTaskLater(plugin, () ->
plugin.getBiomeManager().setBiome(island, IslandWorld.Normal, compatibleBiome, () -> { plugin.getBiomeManager().setBiome(island, IslandWorld.Normal, compatibleBiome, () -> {
if (structure.getCommands() != null) { if (structure.getCommands() != null) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
for (String commandList : structure.getCommands()) { for (String commandList : structure.getCommands()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), commandList.replace("%player", player.getName())); Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), commandList.replace("%player", player.getName()));
} }
});
} }
}), 20L); }), 20L);