mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-22 15:31:45 +01:00
Honor EntityAgeable.ageLock
This commit is contained in:
parent
4bea989f34
commit
46109028f9
@ -39,7 +39,15 @@
|
|||||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) {
|
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) {
|
||||||
if (entityData == null) {
|
if (entityData == null) {
|
||||||
entityData = new AgeableMob.AgeableMobGroupData(true);
|
entityData = new AgeableMob.AgeableMobGroupData(true);
|
||||||
@@ -104,6 +130,7 @@
|
@@ -60,6 +86,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ageUp(int age, boolean overGrow) {
|
||||||
|
+ if (this.ageLocked) return; // Paper - Honor ageLock
|
||||||
|
int j = this.getAge();
|
||||||
|
int k = j;
|
||||||
|
|
||||||
|
@@ -104,6 +131,7 @@
|
||||||
super.addAdditionalSaveData(nbt);
|
super.addAdditionalSaveData(nbt);
|
||||||
nbt.putInt("Age", this.getAge());
|
nbt.putInt("Age", this.getAge());
|
||||||
nbt.putInt("ForcedAge", this.forcedAge);
|
nbt.putInt("ForcedAge", this.forcedAge);
|
||||||
@ -47,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -111,6 +138,7 @@
|
@@ -111,6 +139,7 @@
|
||||||
super.readAdditionalSaveData(nbt);
|
super.readAdditionalSaveData(nbt);
|
||||||
this.setAge(nbt.getInt("Age"));
|
this.setAge(nbt.getInt("Age"));
|
||||||
this.forcedAge = nbt.getInt("ForcedAge");
|
this.forcedAge = nbt.getInt("ForcedAge");
|
||||||
@ -55,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,7 +153,7 @@
|
@@ -125,7 +154,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void aiStep() {
|
public void aiStep() {
|
||||||
super.aiStep();
|
super.aiStep();
|
||||||
|
@ -251,3 +251,19 @@
|
|||||||
|
|
||||||
Objects.requireNonNull(nbttagcompound);
|
Objects.requireNonNull(nbttagcompound);
|
||||||
list.forEach(nbttagcompound::remove);
|
list.forEach(nbttagcompound::remove);
|
||||||
|
@@ -391,6 +442,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setBeeReleaseData(int ticksInHive, Bee beeEntity) {
|
||||||
|
+ if (!beeEntity.ageLocked) { // Paper - Honor ageLock
|
||||||
|
int j = beeEntity.getAge();
|
||||||
|
|
||||||
|
if (j < 0) {
|
||||||
|
@@ -400,6 +452,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
beeEntity.setInLoveTime(Math.max(0, beeEntity.getInLoveTime() - ticksInHive));
|
||||||
|
+ } // Paper - Honor ageLock
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user