mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
55 lines
2.6 KiB
Diff
55 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Fri, 23 Dec 2022 15:40:22 +0100
|
|
Subject: [PATCH] Fix MC-31819
|
|
|
|
Removed since Gale 1.21.3, Mojang fixed it in 1.21 24w21a
|
|
|
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Fix hunger saturation depleting on peaceful"
|
|
By: etil2jz <81570777+etil2jz@users.noreply.github.com>
|
|
As part of: Mirai (https://github.com/etil2jz/Mirai)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
* Mirai description *
|
|
|
|
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 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..7dc22be7e2afeafe0292648a9a20422c39833966 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -1853,6 +1853,11 @@ public abstract class Player extends LivingEntity {
|
|
}
|
|
|
|
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
|
|
+ // Gale start - Mirai - fix MC-31819
|
|
+ if (this.level().galeConfig().gameplayMechanics.fixes.mc31819 && this.level().getDifficulty() == Difficulty.PEACEFUL) {
|
|
+ return;
|
|
+ }
|
|
+ // Gale end - Mirai - fix MC-31819
|
|
// CraftBukkit end
|
|
if (!this.abilities.invulnerable) {
|
|
if (!this.level().isClientSide) {
|
|
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
index 266079aed0610e0fa9e35da81680b7f388a8844a..e3e4459da020a85a66360e761adbf6e55920c6c5 100644
|
|
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
@@ -116,6 +116,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
public boolean mc110386 = true;
|
|
// Gale end - Mirai - fix MC-110386
|
|
|
|
+ // Gale start - Mirai - fix MC-31819
|
|
+ @Setting("mc-31819")
|
|
+ public boolean mc31819 = true;
|
|
+ // Gale end - Mirai - fix MC-31819
|
|
+
|
|
}
|
|
|
|
public double entityWakeUpDurationRatioStandardDeviation = 0.2; // Gale - variable entity wake-up duration
|