Paper/nms-patches/EntityAnimal.patch

37 lines
1.2 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntityAnimal.java
+++ b/net/minecraft/server/EntityAnimal.java
2016-11-17 02:41:03 +01:00
@@ -5,6 +5,7 @@
protected Block bz;
private int bw;
private EntityHuman bx;
2016-06-19 07:00:39 +02:00
+ public ItemStack breedItem; // CraftBukkit - Add breedItem variable
public EntityAnimal(World world) {
super(world);
2016-11-17 02:41:03 +01:00
@@ -38,6 +39,9 @@
}
+ /* CraftBukkit start
+ // Function disabled as it has no special function anymore after
+ // setSitting is disabled.
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
return false;
2016-11-17 02:41:03 +01:00
@@ -46,6 +50,7 @@
return super.damageEntity(damagesource, f);
}
}
+ // CraftBukkit end */
public float a(BlockPosition blockposition) {
2016-11-17 02:41:03 +01:00
return this.world.getType(blockposition.down()).getBlock() == this.bz ? 10.0F : this.world.n(blockposition) - 0.5F;
2016-06-19 07:00:39 +02:00
@@ -120,6 +125,7 @@
public void c(EntityHuman entityhuman) {
2016-11-17 02:41:03 +01:00
this.bw = 600;
this.bx = entityhuman;
2016-06-19 07:00:39 +02:00
+ this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit
this.world.broadcastEntityEffect(this, (byte) 18);
}