Fixed disguises leaving extra tags

Fixed memory problem in Arcade.
This commit is contained in:
Jonathan Williams 2014-09-06 03:39:20 -07:00
parent f3da99d539
commit 558231457c
3 changed files with 16 additions and 2 deletions

View File

@ -67,7 +67,12 @@ public class CustomTagFix extends MiniPlugin
final String entityName = spawnPacket.l.getString(10);
if (spawnPacket.l.getByte(11) == 1 || spawnPacket.l.getByte(3) == 1)
{
{
if (_entityMap.containsKey(spawnPacket.a))
{
verifier.bypassProcess(new PacketPlayOutEntityDestroy(_entityMap.get(spawnPacket.a)));
}
int newId = _fakeIdCounter++;
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier);
_entityMap.put(spawnPacket.a, newId);

View File

@ -1172,7 +1172,7 @@ public abstract class Game implements Listener
}
}
}
}
}
public Collection<StatTracker<? extends Game>> getStatTrackers()
{
@ -1199,4 +1199,12 @@ public abstract class Game implements Listener
event.setCancelled(true);
}
}
public void deRegisterStats()
{
for (StatTracker<? extends Game> tracker : _statTrackers)
HandlerList.unregisterAll(tracker);
_statTrackers.clear();
}
}

View File

@ -269,6 +269,7 @@ public class GameManager implements Listener
return;
event.GetGame().DeregisterKits();
event.GetGame().deRegisterStats();
}
@EventHandler