PaperMC/paper-server/patches/sources/net/minecraft/world/entity/AgeableMob.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

35 lines
1.3 KiB
Diff

--- a/net/minecraft/world/entity/AgeableMob.java
+++ b/net/minecraft/world/entity/AgeableMob.java
@@ -21,6 +21,7 @@
protected int age;
protected int forcedAge;
protected int forcedAgeTimer;
+ public boolean ageLocked; // CraftBukkit
protected AgeableMob(EntityType<? extends AgeableMob> type, Level world) {
super(type, world);
@@ -104,6 +105,7 @@
super.addAdditionalSaveData(nbt);
nbt.putInt("Age", this.getAge());
nbt.putInt("ForcedAge", this.forcedAge);
+ nbt.putBoolean("AgeLocked", this.ageLocked); // CraftBukkit
}
@Override
@@ -111,6 +113,7 @@
super.readAdditionalSaveData(nbt);
this.setAge(nbt.getInt("Age"));
this.forcedAge = nbt.getInt("ForcedAge");
+ this.ageLocked = nbt.getBoolean("AgeLocked"); // CraftBukkit
}
@Override
@@ -125,7 +128,7 @@
@Override
public void aiStep() {
super.aiStep();
- if (this.level().isClientSide) {
+ if (this.level().isClientSide || this.ageLocked) { // CraftBukkit
if (this.forcedAgeTimer > 0) {
if (this.forcedAgeTimer % 4 == 0) {
this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D);