Skip to content

Commit

Permalink
Fix MC-31819
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFishCakes committed Jul 26, 2023
1 parent 5db1043 commit 378d7c9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
19 changes: 19 additions & 0 deletions patches/server/0006-Fix-MC-31819.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrFishCakes <[email protected]>
Date: Wed, 26 Jul 2023 21:32:09 +0100
Subject: [PATCH] Fix MC-31819

Fixes MC-31819 where hunger saturation doesn't deplete when in peaceful mode

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 d00035e31cf4773a418d1cc6a6018d08e6b558f0..9c44e7252fb8c1ff3c6b4340cffbd752901c9c30 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1968,6 +1968,7 @@ public abstract class Player extends LivingEntity {
}

public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
+ if (this.level().getDifficulty() == Difficulty.PEACEFUL) return; // Graphite - Fix MC-31819
// CraftBukkit end
if (!this.abilities.invulnerable) {
if (!this.level().isClientSide) {
34 changes: 34 additions & 0 deletions patches/server/0007-Fix-MC-93018.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrFishCakes <[email protected]>
Date: Wed, 26 Jul 2023 21:50:24 +0100
Subject: [PATCH] Fix MC-93018


diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 64bceae4d06b35fcbecb0daca2496ba30e39d995..4092e92f148c142065b73487d7ce74073715be3c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -653,15 +653,20 @@ public class Wolf extends TamableAnimal implements NeutralMob {
public boolean canMate(Animal other) {
if (other == this) {
return false;
- } else if (!this.isTame()) {
- return false;
+ // Graphite start - Fix MC-93018
+ /*} else if (!this.isTame()) {
+ return false;*/
} else if (!(other instanceof Wolf)) {
return false;
} else {
Wolf entitywolf = (Wolf) other;

- return !entitywolf.isTame() ? false : (entitywolf.isInSittingPose() ? false : this.isInLove() && entitywolf.isInLove());
+ if (entitywolf.isInSittingPose()) return false;
+
+ return this.isInLove() && entitywolf.isInLove();
+ //return !entitywolf.isTame() ? false : (entitywolf.isInSittingPose() ? false : this.isInLove() && entitywolf.isInLove());
}
+ // Graphite end - Fix MC-93018
}

public boolean isInterested() {

0 comments on commit 378d7c9

Please sign in to comment.