3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00
Paper/CraftBukkit-Patches/0049-Cap-Minimum-Player-Speed.patch

32 Zeilen
1.2 KiB
Diff

2014-04-03 22:12:44 +02:00
From a6bd94d3020c20f1984d260da1404e07a31f27dd Mon Sep 17 00:00:00 2001
2013-08-06 03:19:10 +02:00
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
2014-04-03 22:12:44 +02:00
index 25de653..633866e 100644
2013-08-06 03:19:10 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2014-04-03 22:12:44 +02:00
@@ -1152,7 +1152,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
2013-08-06 03:19:10 +02:00
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();
}
2014-04-03 22:12:44 +02:00
@@ -1160,7 +1160,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
2013-08-06 03:19:10 +02:00
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();
}
--
2014-04-03 22:12:44 +02:00
1.8.5.2.msysgit.0
2013-08-06 03:19:10 +02:00