diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index 3d781d4c9..ce9f7aac3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -4,9 +4,6 @@ import java.util.EnumMap; import java.util.HashSet; import java.util.Iterator; -import net.minecraft.server.v1_8_R3.BlockPosition; -import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction; - import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Effect; @@ -18,13 +15,13 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers; import org.bukkit.entity.Chicken; +import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; @@ -53,13 +50,14 @@ import mineplex.core.reward.RewardRarity; import mineplex.core.treasure.TreasureType; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; - import nautilus.game.arcade.ArcadeManager; -import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.uhc.UHC; import nautilus.game.arcade.managers.events.SpecialEntityDeathEvent; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction; public class HolidayManager implements Listener { @@ -105,7 +103,7 @@ public class HolidayManager implements Listener private EternalGiveawayManager _eternalGiveawayManager; public HashSet _active = new HashSet<>(); - public HashSet _activeEntities = new HashSet<>(); + public HashSet _activeEntities = new HashSet<>(); private HashSet _items = new HashSet<>(); @@ -139,6 +137,8 @@ public class HolidayManager implements Listener public void reset(GameStateChangeEvent event) { _active.clear(); + _activeEntities.forEach(entity -> entity.remove()); + _activeEntities.clear(); _lastSpawn = System.currentTimeMillis(); } @@ -254,7 +254,7 @@ public class HolidayManager implements Listener if (game.GetState() != GameState.Live) return; - if (game.GetType().equals(GameType.UHC)) + if (game instanceof UHC) return; if (!UtilTime.elapsed(_lastSpawn, 90000))