aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0260-Honor-EntityAgeable.ageLock.patch
blob: a1db73f43880161a64b7443a1dee816047d9e223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
index be5e603d505566feac61cc7e591d35ce483a92df..2061d7ae62c1335c87aa67fd0cc004c42e34e3a7 100644
--- a/src/main/java/net/minecraft/world/entity/AgeableMob.java
+++ b/src/main/java/net/minecraft/world/entity/AgeableMob.java
@@ -85,6 +85,7 @@ public abstract class AgeableMob extends PathfinderMob {
     }
 
     public void ageUp(int age, boolean overGrow) {
+        if (this.ageLocked) return; // Paper - GH-1459
         int j = this.getAge();
         int k = j;
 
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
index bd70aa9448a429f813f494c02d09432532985152..ea63802f2644bc2b5b3b0c72d7d09813cb68139d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
@@ -299,6 +299,7 @@ public class BeehiveBlockEntity extends BlockEntity {
     }
 
     private static void setBeeReleaseData(int ticks, Bee bee) {
+        if (!bee.ageLocked) { // Paper - respect age lock
         int j = bee.getAge();
 
         if (j < 0) {
@@ -306,6 +307,7 @@ public class BeehiveBlockEntity extends BlockEntity {
         } else if (j > 0) {
             bee.setAge(Math.max(0, j - ticks));
         }
+        } // Paper - respect age lock
 
         bee.setInLoveTime(Math.max(0, bee.getInLoveTime() - ticks));
     }