diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/SiegeManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/SiegeManager.java index 9744381f6..dedfd4a62 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/SiegeManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/SiegeManager.java @@ -1,7 +1,5 @@ package mineplex.game.clans.clans.siege; -import java.util.Stack; - import org.bukkit.Location; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Entity; @@ -188,8 +186,6 @@ public class SiegeManager extends MiniPlugin private void saveSiegeWeapons() { - final Stack queue = new Stack<>(); - for (final SiegeWeapon weapon : LiveSiegeWeapons.values()) { final SiegeWeaponToken token = weapon.toToken(); @@ -197,28 +193,10 @@ public class SiegeManager extends MiniPlugin if (UnsyncedSiegeWeapons.containsKey(Integer.valueOf(token.UniqueId))) continue; - queue.push(() -> { + runAsync(() -> { _repository.updateWeapon(token); }); } - - - runAsync(() -> { - while (!queue.isEmpty()) - { - queue.pop().run(); - } - - _repository.getWeaponsByServer(_clansManager.getServerId(), tokens -> { - tokens.forEach(token -> { - if (!LiveSiegeWeapons.containsKey(Integer.valueOf(token.UniqueId)) && !UnsyncedSiegeWeapons.containsKey(Integer.valueOf(token.UniqueId))) - { - System.out.println("LiveSiegeWeapons no longer contains old weapon " + token.UniqueId + ", deleting."); - _repository.deleteWeapon(token.UniqueId); - } - }); - }); - }); } @EventHandler