Skip to content

Commit

Permalink
we dont need abs()
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Mar 19, 2024
1 parent dcaf3ca commit 966f6d4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void onPacketReceive(PacketReceiveEvent event) {
position.z - fromPos.getKey().z);
}

final double distancePerTicks = (distance / Math.abs(toPos.getValue() - fromPos.getValue())) * 50;
final double distancePerTicks = (distance / toPos.getValue() - fromPos.getValue()) * 50;
if (distancePerTicks <= 0 || Double.isNaN(distancePerTicks) || Double.isInfinite(distancePerTicks)) return;

final ExpiringSet<Double> speedCache = speed_history.get(player.getUniqueId(), k -> new ExpiringSet<>(Duration.ofSeconds(5)));
Expand Down

0 comments on commit 966f6d4

Please sign in to comment.