Paper/CraftBukkit-Patches/0152-Add-Hunger-Config-Values.patch
Zach Brown 19972e09b8 Update SpigotMC's patches
5a0150f586ed3eb15fe6f1f596d1a5a7d806f0f9 Fix ITEM_BREAK
e6a3911057bd94d8bd7021cbb4923fb84fb106d1 Upstream merge
d1cdcf8d4c3639f956474f02ed662517cffbe23e Remove old patch
068df64aeee368377e1673667bffc7a6dcf90554 Rebuild all patches
2014-11-30 16:16:48 -06:00

69 lines
3.1 KiB
Diff

From 743077c7a5cd59c8091cc51947722f3ec1b15881 Mon Sep 17 00:00:00 2001
From: lazertester <austin.techhead@gmail.com>
Date: Sun, 17 Aug 2014 19:56:17 +1000
Subject: [PATCH] Add Hunger Config Values
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index d8adce0..d96bf18 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1066,7 +1066,7 @@ public abstract class EntityHuman extends EntityLiving {
}
}
- this.applyExhaustion(0.3F);
+ this.applyExhaustion(world.spigotConfig.combatExhaustion); // Spigot - Change to use configurable value
} else if (flag1) {
entity.extinguish();
}
@@ -1313,9 +1313,9 @@ public abstract class EntityHuman extends EntityLiving {
super.bE();
this.b(StatisticList.u);
if (this.isSprinting()) {
- this.applyExhaustion(0.8F);
+ this.applyExhaustion(world.spigotConfig.sprintExhaustion); // Spigot - Change to use configurable value
} else {
- this.applyExhaustion(0.2F);
+ this.applyExhaustion(world.spigotConfig.walkExhaustion); // Spigot - Change to use configurable value
}
}
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
index 23aca22..1b44990 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -63,7 +63,7 @@ public class FoodMetaData {
if (this.foodTickTimer >= 80) {
// CraftBukkit - added RegainReason
entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED);
- this.a(3.0F);
+ this.a(entityhuman.world.spigotConfig.regenExhaustion); // Spigot - Change to use configurable value
this.foodTickTimer = 0;
}
} else if (this.foodLevel <= 0) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index c3a2d01..3f145b3 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -326,4 +326,16 @@ public class SpigotWorldConfig
largeFeatureSeed = getInt( "seed-feature", 14357617 );
log( "Custom Map Seeds: Village: " + villageSeed + " Feature: " + largeFeatureSeed );
}
+
+ public float walkExhaustion;
+ public float sprintExhaustion;
+ public float combatExhaustion;
+ public float regenExhaustion;
+ private void initHunger()
+ {
+ walkExhaustion = (float) getDouble( "hunger.walk-exhaustion", 0.2 );
+ sprintExhaustion = (float) getDouble( "hunger.sprint-exhaustion", 0.8 );
+ combatExhaustion = (float) getDouble( "hunger.combat-exhaustion", 0.3 );
+ regenExhaustion = (float) getDouble( "hunger.regen-exhaustion", 3 );
+ }
}
--
2.1.0