Paper/nms-patches/EntityAgeable.patch

44 lines
2.0 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntityAgeable.java
+++ b/net/minecraft/server/EntityAgeable.java
2016-05-10 13:47:39 +02:00
@@ -10,6 +10,7 @@
protected int c;
2018-07-15 02:00:00 +02:00
private float bD = -1.0F;
private float bE;
2016-02-29 22:32:46 +01:00
+ public boolean ageLocked; // CraftBukkit
2018-07-15 02:00:00 +02:00
protected EntityAgeable(EntityTypes<?> entitytypes, World world) {
super(entitytypes, world);
@@ -29,7 +30,7 @@
if (entityageable != null) {
entityageable.setAgeRaw(-24000);
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
- this.world.addEntity(entityageable);
+ this.world.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
if (itemstack.hasName()) {
entityageable.setCustomName(itemstack.getName());
}
@@ -97,12 +98,14 @@
super.b(nbttagcompound);
nbttagcompound.setInt("Age", this.getAge());
nbttagcompound.setInt("ForcedAge", this.b);
+ nbttagcompound.setBoolean("AgeLocked", this.ageLocked); // CraftBukkit
}
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
this.setAgeRaw(nbttagcompound.getInt("Age"));
this.b = nbttagcompound.getInt("ForcedAge");
+ this.ageLocked = nbttagcompound.getBoolean("AgeLocked"); // CraftBukkit
}
2016-02-29 22:32:46 +01:00
public void a(DataWatcherObject<?> datawatcherobject) {
2018-07-15 02:00:00 +02:00
@@ -115,7 +118,7 @@
2016-02-29 22:32:46 +01:00
2018-12-13 01:00:00 +01:00
public void movementTick() {
super.movementTick();
2015-02-26 23:41:06 +01:00
- if (this.world.isClientSide) {
+ if (this.world.isClientSide || ageLocked) { // CraftBukkit
if (this.c > 0) {
if (this.c % 4 == 0) {
2018-07-15 02:00:00 +02:00
this.world.addParticle(Particles.z, this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, 0.0D, 0.0D, 0.0D);