mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 23:57:43 +01:00
7b0c576798
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
From cc4c7dc555c07985d566dc1c85baadc309c8610e 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 ab1c5d8..6241ada 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -1162,7 +1162,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();
|
|
|
|
}
|
|
@@ -1170,7 +1170,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();
|
|
}
|
|
|
|
--
|
|
1.9.1
|
|
|