mirror of
https://github.com/BX-Team/DivineMC.git
synced 2026-01-03 14:12:09 +00:00
22 lines
1.2 KiB
Diff
22 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: etil2jz <81570777+etil2jz@users.noreply.github.com>
|
|
Date: Fri, 22 Apr 2022 18:50:49 +0200
|
|
Subject: [PATCH] Fix hunger saturation depleting on peaceful
|
|
|
|
The food saturation value is depleted on peaceful, even though
|
|
the displayed hunger bar never goes down. Hunger (or any related value, including saturation)
|
|
should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
index 2b02800666b358159c8ecb63208a14855f90657b..f68d53f085f4cb9ae94f5aa110ca0bd2a88aa5e1 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -1896,6 +1896,7 @@ public abstract class Player extends LivingEntity {
|
|
}
|
|
|
|
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
|
|
+ if (this.level.getDifficulty() == Difficulty.PEACEFUL) return; // DivineMC - fix hunger saturation depleting on peaceful
|
|
// CraftBukkit end
|
|
if (!this.abilities.invulnerable) {
|
|
if (!this.level.isClientSide) {
|