Drop "PaperPR Fix bees aging inside hives"
Fixed in upstream
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Sat, 21 Aug 2021 21:54:16 -0700
|
||||
Subject: [PATCH] PaperPR Fix bees aging inside hives
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/AgeableMob.java b/src/main/java/net/minecraft/world/entity/AgeableMob.java
|
||||
index c0780a8714808498390282b7fa1da1f3aacf8e2a..d165117d62fe8a55d624966e8c4b626c0f52db39 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/AgeableMob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/AgeableMob.java
|
||||
@@ -84,7 +84,7 @@ public abstract class AgeableMob extends PathfinderMob {
|
||||
}
|
||||
|
||||
public void ageUp(int age, boolean overGrow) {
|
||||
- if (ageLocked) return; // Paper - GH-1459
|
||||
+ 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 8eabe7113822d35ff53390e981ea69ad5f07d67d..a7833b801bc3837c60c4235b1f055ae03eff9505 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
|
||||
@@ -300,6 +300,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) {
|
||||
@@ -307,6 +308,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));
|
||||
}
|
||||
@@ -322,7 +324,7 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
|
||||
for (Iterator iterator = bees.iterator(); iterator.hasNext(); ++tileentitybeehive_hivebee.ticksInHive) {
|
||||
tileentitybeehive_hivebee = (BeehiveBlockEntity.BeeData) iterator.next();
|
||||
- if (tileentitybeehive_hivebee.ticksInHive > tileentitybeehive_hivebee.minOccupationTicks) {
|
||||
+ if (tileentitybeehive_hivebee.exitTickCounter > tileentitybeehive_hivebee.minOccupationTicks) { // Paper - use exitTickCounter
|
||||
BeehiveBlockEntity.BeeReleaseStatus tileentitybeehive_releasestatus = tileentitybeehive_hivebee.entityData.getBoolean("HasNectar") ? BeehiveBlockEntity.BeeReleaseStatus.HONEY_DELIVERED : BeehiveBlockEntity.BeeReleaseStatus.BEE_RELEASED;
|
||||
|
||||
if (BeehiveBlockEntity.releaseOccupant(world, pos, state, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, flowerPos)) {
|
||||
@@ -330,7 +332,7 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
iterator.remove();
|
||||
// CraftBukkit start
|
||||
} else {
|
||||
- tileentitybeehive_hivebee.ticksInHive = tileentitybeehive_hivebee.minOccupationTicks / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable
|
||||
+ tileentitybeehive_hivebee.exitTickCounter = tileentitybeehive_hivebee.minOccupationTicks / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable // Paper - use exitTickCounter to keep actual bee life
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -422,12 +424,14 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
|
||||
final CompoundTag entityData;
|
||||
int ticksInHive;
|
||||
+ int exitTickCounter; // Paper - separate counter for checking if bee should exit to reduce exit attempts
|
||||
final int minOccupationTicks;
|
||||
|
||||
BeeData(CompoundTag entityData, int ticksInHive, int minOccupationTicks) {
|
||||
BeehiveBlockEntity.removeIgnoredBeeTags(entityData);
|
||||
this.entityData = entityData;
|
||||
this.ticksInHive = ticksInHive;
|
||||
+ this.exitTickCounter = ticksInHive; // Paper
|
||||
this.minOccupationTicks = minOccupationTicks;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user