PaperMC/patches/server/0246-Honor-EntityAgeable.ageLock.patch

39 lines
1.7 KiB
Diff
Raw Permalink Normal View History

2021-06-13 08:48:25 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 23 Sep 2018 20:59:53 -0500
Subject: [PATCH] Honor EntityAgeable.ageLock
diff --git a/src/main/java/net/minecraft/world/entity/AgeableMob.java b/src/main/java/net/minecraft/world/entity/AgeableMob.java
2024-10-23 13:13:00 +02:00
index d7020068a9ea3e5e1cacfe53ef19a88139687205..119856b22df5bbcd4e5bf5f95645156f774c6168 100644
2021-06-13 08:48:25 +02:00
--- a/src/main/java/net/minecraft/world/entity/AgeableMob.java
+++ b/src/main/java/net/minecraft/world/entity/AgeableMob.java
2024-10-23 13:13:00 +02:00
@@ -86,6 +86,7 @@ public abstract class AgeableMob extends PathfinderMob {
2021-06-13 08:48:25 +02:00
}
public void ageUp(int age, boolean overGrow) {
+ if (this.ageLocked) return; // Paper - Honor ageLock
2021-06-13 08:48:25 +02:00
int j = this.getAge();
int k = j;
2021-12-30 20:44:39 +01:00
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
2024-12-03 19:05:31 +01:00
index 268394088dbb1e63ab5d550a3cad5df0d2807108..333189cf01ce571993e8152f5851b8c362ba4b70 100644
2021-12-30 20:44:39 +01:00
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
2024-12-03 19:05:31 +01:00
@@ -442,6 +442,7 @@ public class BeehiveBlockEntity extends BlockEntity {
2024-04-24 07:43:09 +02:00
}
2021-12-30 20:44:39 +01:00
2024-04-24 07:43:09 +02:00
private static void setBeeReleaseData(int ticksInHive, Bee beeEntity) {
+ if (!beeEntity.ageLocked) { // Paper - Honor ageLock
int j = beeEntity.getAge();
2021-12-30 20:44:39 +01:00
2024-04-24 07:43:09 +02:00
if (j < 0) {
2024-12-03 19:05:31 +01:00
@@ -451,6 +452,7 @@ public class BeehiveBlockEntity extends BlockEntity {
2024-04-24 07:43:09 +02:00
}
2021-12-30 20:44:39 +01:00
2024-04-24 07:43:09 +02:00
beeEntity.setInLoveTime(Math.max(0, beeEntity.getInLoveTime() - ticksInHive));
+ } // Paper - Honor ageLock
}
2021-12-30 20:44:39 +01:00
}
2024-04-24 07:43:09 +02:00