Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
32 Zeilen
1.2 KiB
Diff
32 Zeilen
1.2 KiB
Diff
From 248808468f949313874e7bcbb268e89ee3ea5bc7 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 17a074a..b20ccc1 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.5.0
|
|
|