Remove SG wolf pet on quit
This commit is contained in:
parent
ec30269a14
commit
06ebbbbc73
@ -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;
|
||||
@ -313,6 +312,20 @@ public class PerkWolfPet extends Perk
|
||||
wolves.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
ArrayList<Wolf> wolves = _wolfMap.remove(event.getPlayer());
|
||||
|
||||
if (wolves == null)
|
||||
return;
|
||||
|
||||
for (Wolf wolf : wolves)
|
||||
wolf.remove();
|
||||
|
||||
wolves.clear();
|
||||
}
|
||||
|
||||
public boolean IsMinion(Entity ent)
|
||||
{
|
||||
for (ArrayList<Wolf> minions : _wolfMap.values())
|
||||
|
Loading…
Reference in New Issue
Block a user