mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
c55b9c30d7
66af3b310e0 a969bf6c85d 95d56229d8f 87c1d0c8b7c baf01cc7f84 38b8866783d [M]
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
From 94d31732d2b54954336f0333af90721d43514e21 Mon Sep 17 00:00:00 2001
|
|
From: md_5 <md_5@live.com.au>
|
|
Date: Mon, 5 Aug 2013 20:17:20 +1000
|
|
Subject: [PATCH] Cap Minimum Player Speed
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index d9c0540..b8dcea5 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -1179,7 +1179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
public void setFlySpeed(float value) {
|
|
validateSpeed(value);
|
|
EntityPlayer player = getHandle();
|
|
- player.abilities.flySpeed = value / 2f;
|
|
+ player.abilities.flySpeed = Math.max( value, 0.0001f ) / 2f; // Spigot
|
|
player.updateAbilities();
|
|
|
|
}
|
|
@@ -1188,7 +1188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
public void setWalkSpeed(float value) {
|
|
validateSpeed(value);
|
|
EntityPlayer player = getHandle();
|
|
- player.abilities.walkSpeed = value / 2f;
|
|
+ player.abilities.walkSpeed = Math.max( value, 0.0001f ) / 2f; // Spigot
|
|
player.updateAbilities();
|
|
}
|
|
|
|
--
|
|
2.1.0
|
|
|