Fix patch 1 for issue #29, Clear all y axis data on teleport/switch worlds.

This commit is contained in:
Super Spy committed 2012-06-03 11:58:46 -05:00
1 parent a14f1cffdb
commit 92dfa04802
2 files changed
+14

No files matched your search

@@ -59,6 +59,12 @@ public class PlayerListener extends EventListener
} }
} }
@EventHandler
public void onPlayerChangeWorlds(PlayerChangedWorldEvent event)
{
backend.logTeleport(event.getPlayer());
}
@EventHandler @EventHandler
public void onPlayerToggleSneak(PlayerToggleSneakEvent event) public void onPlayerToggleSneak(PlayerToggleSneakEvent event)
{ {
@@ -762,6 +762,14 @@ public class Backend
public void logTeleport(final Player player) public void logTeleport(final Player player)
{ {
logEvent(movingExempt,player,TELEPORT_TIME); logEvent(movingExempt,player,TELEPORT_TIME);
/* Data for fly/speed should be reset */
nofallViolation.remove(player.getName());
flightViolation.remove(player.getName());
yAxisViolations.remove(player.getName());
yAxisLastViolation.remove(player.getName());
lastYcoord.remove(player.getName());
lastYtime.remove(player.getName());
} }
public void logExitFly(final Player player) public void logExitFly(final Player player)