2015-05-25 14:05:40 +02:00
|
|
|
From 8ad8cfeb5ef3607ff7df88c3418e482344e46055 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +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
|
2015-05-09 22:23:26 +02:00
|
|
|
index 671b7d2..5136adf 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-12-19 00:33:08 +01:00
|
|
|
@@ -1182,7 +1182,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2014-07-21 22:46:54 +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-12-19 00:33:08 +01:00
|
|
|
@@ -1191,7 +1191,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2014-07-21 22:46:54 +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();
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|