From 8c3ed77c7ce66de8809c61191edf4882a71fa9d6 Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 30 Jan 2013 03:17:18 +0100 Subject: [PATCH] Also remove clear parkedInfo in case of reload or data removal. --- .../nocheatplus/checks/moving/MovingListener.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 9d2d78e4..7466f8b9 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -47,6 +47,7 @@ import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.combined.BedLeave; import fr.neatmonster.nocheatplus.checks.combined.Combined; import fr.neatmonster.nocheatplus.checks.combined.CombinedData; +import fr.neatmonster.nocheatplus.command.INotifyReload; import fr.neatmonster.nocheatplus.compat.MCAccess; import fr.neatmonster.nocheatplus.components.IData; import fr.neatmonster.nocheatplus.components.IHaveCheckType; @@ -84,7 +85,7 @@ import fr.neatmonster.nocheatplus.utilities.StringUtil; * * @see MovingEvent */ -public class MovingListener extends CheckListener implements TickListener, IRemoveData, IHaveCheckType{ +public class MovingListener extends CheckListener implements TickListener, IRemoveData, IHaveCheckType, INotifyReload{ /** * Coupling from and to PlayerLocation objects with a block cache for easy storage and reuse. @@ -1210,5 +1211,15 @@ public class MovingListener extends CheckListener implements TickListener, IRemo @Override public void removeAllData() { hoverTicks.clear(); + parkedInfo.clear(); + } + + @Override + public void onReload() { + for (final MoveInfo info : parkedInfo){ + // Just in case. + info.cleanup(); + } + parkedInfo.clear(); } }