Skip to content

Commit c8131d2

Browse files
committed
Don't skip first move event
1 parent e20c4fd commit c8131d2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/com/laytonsmith/abstraction/bukkit/events/drivers/BukkitPlayerListener.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,12 @@ public void onPlayerMove(PlayerMoveEvent event) {
291291
String p = event.getPlayer().getName();
292292
for(Integer threshold : PlayerEvents.GetThresholdList()) {
293293
Map<String, MCLocation> lastLocations = PlayerEvents.GetLastLocations(threshold);
294+
MCLocation last;
294295
if(!lastLocations.containsKey(p)) {
295-
lastLocations.put(p, new BukkitMCLocation(from));
296-
continue;
297-
}
298-
MCLocation last = lastLocations.get(p);
299-
if (!to.getWorld().getName().equals(last.getWorld().getName())) {
300-
lastLocations.put(p, new BukkitMCLocation(to));
301-
continue;
296+
last = new BukkitMCLocation(from);
297+
lastLocations.put(p, last);
298+
} else {
299+
last = lastLocations.get(p);
302300
}
303301
MCLocation movedTo = new BukkitMCLocation(to);
304302
if (last.distance(movedTo) > threshold) {

0 commit comments

Comments
 (0)