Skip to content

Commit

Permalink
also normalize in move event
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 24, 2024
1 parent 6daf090 commit 6c41876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Location getFrom(PlayerMoveEvent event) {
}

public double getBlocksPerTick(PlayerMoveEvent event) {
double eventSpeedSquared = event.getTo().distance(event.getFrom());
double eventSpeedSquared = LocationUtil.getNormalizedDistance(event.getTo(), event.getFrom());
if (doIntervalCheck) {
Double speedInterval = PLAYER_SPEEDS_INTERVAL.getIfPresent(event.getPlayer().getUniqueId());
if (speedInterval != null) return FastMath.max(speedInterval, eventSpeedSquared);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Location getFrom(PlayerMoveEvent event) {
}

public double getBlocksPerTick(PlayerMoveEvent event) {
double eventSpeed = LocationUtil.getFlatDistance(event.getFrom(), event.getTo());
double eventSpeed = LocationUtil.getNormalizedDistance(event.getFrom(), event.getTo());
if (doIntervalCheck) {
Double speedInterval = PLAYER_SPEEDS_INTERVAL.getIfPresent(event.getPlayer().getUniqueId());
if (speedInterval != null) return FastMath.max(speedInterval, eventSpeed);
Expand Down

0 comments on commit 6c41876

Please sign in to comment.