mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
update nms file patches
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/world/food/FoodData.java
|
||||
+++ b/net/minecraft/world/food/FoodData.java
|
||||
@@ -38,6 +_,7 @@
|
||||
int oldFoodLevel = this.foodLevel;
|
||||
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(serverPlayer, foodProperties.nutrition() + oldFoodLevel, stack);
|
||||
if (!event.isCancelled()) {
|
||||
+ if (serverPlayer.level().purpurConfig.playerBurpWhenFull && event.getFoodLevel() == 20 && oldFoodLevel < 20) serverPlayer.burpDelay = serverPlayer.level().purpurConfig.playerBurpDelay; // Purpur - Burp after eating food fills hunger bar completely
|
||||
this.add(event.getFoodLevel() - oldFoodLevel, foodProperties.saturation());
|
||||
}
|
||||
serverPlayer.getBukkitEntity().sendHealthUpdate();
|
||||
@@ -86,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;
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/world/food/FoodProperties.java
|
||||
+++ b/net/minecraft/world/food/FoodProperties.java
|
||||
@@ -42,9 +_,11 @@
|
||||
level.playSound(null, entity.getX(), entity.getY(), entity.getZ(), consumable.sound().value(), SoundSource.NEUTRAL, 1.0F, random.triangle(1.0F, 0.4F));
|
||||
if (entity instanceof Player player) {
|
||||
player.getFoodData().eat(this, stack, (net.minecraft.server.level.ServerPlayer) player); // CraftBukkit
|
||||
- level.playSound(
|
||||
- null, player.getX(), player.getY(), player.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, Mth.randomBetween(random, 0.9F, 1.0F)
|
||||
- );
|
||||
+ // Purpur start - Burp delay - moved to Player#tick()
|
||||
+ //level.playSound(
|
||||
+ // null, player.getX(), player.getY(), player.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, Mth.randomBetween(random, 0.9F, 1.0F)
|
||||
+ //);
|
||||
+ // Purpur end - Burp delay - moved to Player#tick()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user