Transform values into constants
(cherry picked from commit 20d83e5 et al.)
This commit is contained in:
@@ -80,10 +80,10 @@ public class LimboCache {
|
||||
float flySpeed = data.getFlySpeed();
|
||||
// Reset the speed value if it was 0
|
||||
if (walkSpeed < 0.01f) {
|
||||
walkSpeed = 0.2f;
|
||||
walkSpeed = LimboPlayer.DEFAULT_WALK_SPEED;
|
||||
}
|
||||
if (flySpeed < 0.01f) {
|
||||
flySpeed = 0.2f;
|
||||
flySpeed = LimboPlayer.DEFAULT_FLY_SPEED;
|
||||
}
|
||||
player.setWalkSpeed(walkSpeed);
|
||||
player.setFlySpeed(flySpeed);
|
||||
|
||||
@@ -10,6 +10,9 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
*/
|
||||
public class LimboPlayer {
|
||||
|
||||
public static final float DEFAULT_WALK_SPEED = 0.2f;
|
||||
public static final float DEFAULT_FLY_SPEED = 0.1f;
|
||||
|
||||
private final boolean canFly;
|
||||
private final boolean operator;
|
||||
private final String group;
|
||||
|
||||
@@ -148,8 +148,8 @@ public class LimboPlayerStorage {
|
||||
String group = "";
|
||||
boolean operator = false;
|
||||
boolean canFly = false;
|
||||
float walkSpeed = 0.2f;
|
||||
float flySpeed = 0.2f;
|
||||
float walkSpeed = LimboPlayer.DEFAULT_WALK_SPEED;
|
||||
float flySpeed = LimboPlayer.DEFAULT_FLY_SPEED;
|
||||
|
||||
JsonElement e;
|
||||
if ((e = jsonObject.getAsJsonObject("location")) != null) {
|
||||
|
||||
Reference in New Issue
Block a user