1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/AgeableMob.java
|
||||
+++ b/net/minecraft/world/entity/AgeableMob.java
|
||||
@@ -22,6 +_,7 @@
|
||||
@@ -23,6 +_,7 @@
|
||||
protected int age = 0;
|
||||
protected int forcedAge = 0;
|
||||
protected int forcedAgeTimer;
|
||||
@@ -8,40 +8,31 @@
|
||||
|
||||
protected AgeableMob(EntityType<? extends AgeableMob> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -68,13 +_,15 @@
|
||||
@@ -69,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void ageUp(int amount, boolean forced) {
|
||||
+ if (this.ageLocked) return; // Paper - Honor ageLock
|
||||
int age = this.getAge();
|
||||
+ int previousAge = age; // Paper - Decompile fix: lvt reassignment lost
|
||||
int previousAge = age;
|
||||
age += amount * 20;
|
||||
if (age > 0) {
|
||||
age = 0;
|
||||
}
|
||||
|
||||
- int i1 = age - age;
|
||||
+ int i1 = age - previousAge; // Paper - Decompile fix
|
||||
this.setAge(age);
|
||||
if (forced) {
|
||||
this.forcedAge += i1;
|
||||
@@ -106,6 +_,7 @@
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putInt("Age", this.getAge());
|
||||
compound.putInt("ForcedAge", this.forcedAge);
|
||||
+ compound.putBoolean("AgeLocked", this.ageLocked); // CraftBukkit
|
||||
@@ -108,6 +_,7 @@
|
||||
super.addAdditionalSaveData(output);
|
||||
output.putInt("Age", this.getAge());
|
||||
output.putInt("ForcedAge", this.forcedAge);
|
||||
+ output.putBoolean("AgeLocked", this.ageLocked); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,6 +_,7 @@
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.setAge(compound.getIntOr("Age", 0));
|
||||
this.forcedAge = compound.getIntOr("ForcedAge", 0);
|
||||
+ this.ageLocked = compound.getBooleanOr("AgeLocked", false); // CraftBukkit
|
||||
@@ -115,6 +_,7 @@
|
||||
super.readAdditionalSaveData(input);
|
||||
this.setAge(input.getIntOr("Age", 0));
|
||||
this.forcedAge = input.getIntOr("ForcedAge", 0);
|
||||
+ this.ageLocked = input.getBooleanOr("AgeLocked", false); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,7 +_,7 @@
|
||||
@@ -129,7 +_,7 @@
|
||||
@Override
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
|
||||
Reference in New Issue
Block a user