From 06ebbbbc730d85dd588be523c8439a3f460f4ea7 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 17 Mar 2015 18:30:17 +1300 Subject: [PATCH] Remove SG wolf pet on quit --- .../game/arcade/kit/perks/PerkWolfPet.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java index 2f3751622..68d1c8b4e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java @@ -8,7 +8,6 @@ import org.bukkit.DyeColor; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; @@ -16,13 +15,13 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftWolf; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.entity.Skeleton; import org.bukkit.entity.Wolf; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerQuitEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; @@ -312,6 +311,20 @@ public class PerkWolfPet extends Perk wolves.clear(); } + + @EventHandler + public void PlayerQuit(PlayerQuitEvent event) + { + ArrayList wolves = _wolfMap.remove(event.getPlayer()); + + if (wolves == null) + return; + + for (Wolf wolf : wolves) + wolf.remove(); + + wolves.clear(); + } public boolean IsMinion(Entity ent) {