2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/EntityAgeable.java
|
|
|
|
+++ b/net/minecraft/world/entity/EntityAgeable.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
protected int age;
|
|
|
|
protected int forcedAge;
|
|
|
|
protected int forcedAgeTimer;
|
2016-02-29 22:32:46 +01:00
|
|
|
+ public boolean ageLocked; // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
protected EntityAgeable(EntityTypes<? extends EntityAgeable> entitytypes, World world) {
|
2018-07-15 02:00:00 +02:00
|
|
|
super(entitytypes, world);
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -102,6 +103,7 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
super.addAdditionalSaveData(nbttagcompound);
|
|
|
|
nbttagcompound.putInt("Age", this.getAge());
|
|
|
|
nbttagcompound.putInt("ForcedAge", this.forcedAge);
|
|
|
|
+ nbttagcompound.putBoolean("AgeLocked", this.ageLocked); // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -109,6 +111,7 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
super.readAdditionalSaveData(nbttagcompound);
|
|
|
|
this.setAge(nbttagcompound.getInt("Age"));
|
2021-06-11 07:00:00 +02:00
|
|
|
this.forcedAge = nbttagcompound.getInt("ForcedAge");
|
2014-11-25 22:32:16 +01:00
|
|
|
+ this.ageLocked = nbttagcompound.getBoolean("AgeLocked"); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -123,7 +126,7 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public void aiStep() {
|
|
|
|
super.aiStep();
|
2021-06-11 07:00:00 +02:00
|
|
|
- if (this.level.isClientSide) {
|
|
|
|
+ if (this.level.isClientSide || ageLocked) { // CraftBukkit
|
|
|
|
if (this.forcedAgeTimer > 0) {
|
|
|
|
if (this.forcedAgeTimer % 4 == 0) {
|
2021-11-21 23:00:00 +01:00
|
|
|
this.level.addParticle(Particles.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D);
|