Files
CatServer/patches/net/minecraft/entity/passive/EntityChicken.java.patch
2019-02-24 22:29:41 +08:00

32 lines
1.1 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/passive/EntityChicken.java
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntityChicken.java
@@ -78,6 +78,9 @@
public void onLivingUpdate()
{
+ if (this.isChickenJockey()) {
+ this.persistenceRequired = !this.canDespawn();
+ }
super.onLivingUpdate();
this.oFlap = this.wingRotation;
this.oFlapSpeed = this.destPos;
@@ -101,7 +104,9 @@
if (!this.world.isRemote && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0)
{
this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ this.forceDrops = true;
this.dropItem(Items.EGG, 1);
+ this.forceDrops = false;
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
}
}
@@ -174,7 +179,7 @@
compound.setInteger("EggLayTime", this.timeUntilNextEgg);
}
- protected boolean canDespawn()
+ public boolean canDespawn()
{
return this.isChickenJockey() && !this.isBeingRidden();
}