fixed leak
This commit is contained in:
parent
b6f6d4458e
commit
51227ae4f3
@ -2,6 +2,7 @@ package mineplex.core.gadget.gadgets;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -152,6 +153,8 @@ public class MorphTitan extends MorphGadget
|
||||
|
||||
//Sound
|
||||
stand.getWorld().playSound(stand.getLocation(), Sound.ZOMBIE_REMEDY, 6f, 0.75f);
|
||||
|
||||
stand.remove();
|
||||
}
|
||||
|
||||
//Disguise
|
||||
@ -215,4 +218,24 @@ public class MorphTitan extends MorphGadget
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void clean(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
Iterator<Player> playerIter = _targets.keySet().iterator();
|
||||
|
||||
while (playerIter.hasNext())
|
||||
{
|
||||
Player player = playerIter.next();
|
||||
|
||||
if (!player.isOnline())
|
||||
{
|
||||
Entity ent = _targets.get(player);
|
||||
ent.remove();
|
||||
playerIter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user