0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2025-06-30 22:19:05 +00:00
Files
craftbukkit/nms-patches/net/minecraft/world/entity/EntityAgeable.patch
2025-06-18 01:15:00 +10:00

36 lines
1.4 KiB
Diff

--- a/net/minecraft/world/entity/EntityAgeable.java
+++ b/net/minecraft/world/entity/EntityAgeable.java
@@ -24,6 +24,7 @@
protected int age = 0;
protected int forcedAge = 0;
protected int forcedAgeTimer;
+ public boolean ageLocked; // CraftBukkit
protected EntityAgeable(EntityTypes<? extends EntityAgeable> entitytypes, World world) {
super(entitytypes, world);
@@ -107,6 +108,7 @@
super.addAdditionalSaveData(valueoutput);
valueoutput.putInt("Age", this.getAge());
valueoutput.putInt("ForcedAge", this.forcedAge);
+ valueoutput.putBoolean("AgeLocked", this.ageLocked); // CraftBukkit
}
@Override
@@ -114,6 +116,7 @@
super.readAdditionalSaveData(valueinput);
this.setAge(valueinput.getIntOr("Age", 0));
this.forcedAge = valueinput.getIntOr("ForcedAge", 0);
+ this.ageLocked = valueinput.getBooleanOr("AgeLocked", this.ageLocked); // CraftBukkit
}
@Override
@@ -128,7 +131,7 @@
@Override
public void aiStep() {
super.aiStep();
- if (this.level().isClientSide) {
+ if (this.level().isClientSide || ageLocked) { // CraftBukkit
if (this.forcedAgeTimer > 0) {
if (this.forcedAgeTimer % 4 == 0) {
this.level().addParticle(Particles.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D);