Files
Purpur/patches/server/0220-Configurable-hunger-starvation-damage.patch
William Blake Galbreath 31306b4b0e Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
b79bc31 Fix MerchantOffer BuyB Only AssertionError (#6206)
d6c81c8 Don't apply cramming damage to players (#5903)
12942dc Add rate options and timings for sensors and behaviors (#6027)
fc47872 Use mapped names for sensor and behavior timings/config (#6228)
c75a837 Don't expose ASM in API (#6229)
c225bf9 Fix book title and author being improperly serialized as components (#6190)
f25facb Update email & name (DenWav)
44516b1 [ci skip] Put mappings util in a separate class to the stacktrace deobfuscator
2021-07-21 10:49:20 -05:00

34 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 29 Jun 2021 23:44:36 -0400
Subject: [PATCH] Configurable hunger starvation damage
diff --git a/src/main/java/net/minecraft/world/food/FoodData.java b/src/main/java/net/minecraft/world/food/FoodData.java
index c1130952e3fa22abaa27fcc1c4761c831dc56cc3..1ac08eca469739cb52abd38483c431b63b7f84a2 100644
--- a/src/main/java/net/minecraft/world/food/FoodData.java
+++ b/src/main/java/net/minecraft/world/food/FoodData.java
@@ -103,7 +103,7 @@ public class FoodData {
++this.tickTimer;
if (this.tickTimer >= this.starvationRate) { // CraftBukkit - add regen rate manipulation
if (player.getHealth() > 10.0F || enumdifficulty == Difficulty.HARD || player.getHealth() > 1.0F && enumdifficulty == Difficulty.NORMAL) {
- player.hurt(DamageSource.STARVE, 1.0F);
+ player.hurt(DamageSource.STARVE, player.level.purpurConfig.hungerStarvationDamage); // Purpur
}
this.tickTimer = 0;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index dd8681aa02b27f766b7e4d4e79afa26fb2b21d3f..2d06b3e59c0e2b1576779771186ad6706d0f1dce 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -2277,4 +2277,9 @@ public class PurpurWorldConfig {
private void seedSettings() {
randomPopulatorSeed = getBoolean("seed.random-populator-seed", randomPopulatorSeed);
}
+
+ public float hungerStarvationDamage = 1.0F;
+ private void hungerSettings() {
+ hungerStarvationDamage = (float) getDouble("hunger.starvation-damage", hungerStarvationDamage);
+ }
}