papermc/CraftBukkit-Patches/0012-Configurable-hunger-multiplier-for-player-sprint-jum.patch

37 lines
1.6 KiB
Diff

From 30265e6a9f36221e235337b9a8c0217761a9c379 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
Date: Tue, 15 Apr 2014 18:00:02 -0700
Subject: [PATCH] Configurable hunger multiplier for player sprint jumping
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index eb123ff..296bb2d 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1256,7 +1256,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
super.bi();
this.a(StatisticList.r, 1);
if (this.isSprinting()) {
- this.a(0.8F);
+ this.a(PaperSpigotWorldConfig.playerSprintJumpingHungerMultiplier); // PaperSpigot - Configurable hunger multiplier for player sprint jumping
} else {
this.a(0.2F);
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 014aee3..28181f2 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -110,4 +110,10 @@ public class PaperSpigotWorldConfig
{
babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D );
}
+
+ public static float playerSprintJumpingHungerMultiplier;
+ private void playerSprintJumpingHungerMultiplier()
+ {
+ playerSprintJumpingHungerMultiplier = getFloat( "player-sprint-jumping-hunger-multiplier", 0.8F );
+ }
}
--
1.9.1