mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Configurable hunger starvation damage
This commit is contained in:
@@ -8,3 +8,12 @@
|
||||
this.add(event.getFoodLevel() - oldFoodLevel, foodProperties.saturation());
|
||||
}
|
||||
serverPlayer.getBukkitEntity().sendHealthUpdate();
|
||||
@@ -84,7 +_,7 @@
|
||||
this.tickTimer++;
|
||||
if (this.tickTimer >= this.starvationRate) { // CraftBukkit - add regen rate manipulation
|
||||
if (player.getHealth() > 10.0F || difficulty == Difficulty.HARD || player.getHealth() > 1.0F && difficulty == Difficulty.NORMAL) {
|
||||
- player.hurtServer(serverLevel, player.damageSources().starve(), 1.0F);
|
||||
+ player.hurtServer(serverLevel, player.damageSources().starve(), player.level().purpurConfig.hungerStarvationDamage); // Purpur - Configurable hunger starvation damage
|
||||
}
|
||||
|
||||
this.tickTimer = 0;
|
||||
|
||||
@@ -2697,4 +2697,9 @@ public class PurpurWorldConfig {
|
||||
zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry);
|
||||
zombifiedPiglinTakeDamageFromWater = getBoolean("mobs.zombified_piglin.takes-damage-from-water", zombifiedPiglinTakeDamageFromWater);
|
||||
}
|
||||
|
||||
public float hungerStarvationDamage = 1.0F;
|
||||
private void hungerSettings() {
|
||||
hungerStarvationDamage = (float) getDouble("hunger.starvation-damage", hungerStarvationDamage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user