Commits

Ryan Michela authored and md_5 committed 9af379fc474
SPIGOT-1319: Add EntityBreedEvent
No tags

nms-patches/EntityAnimal.patch

Modified
1 1 --- a/net/minecraft/server/EntityAnimal.java
2 2 +++ b/net/minecraft/server/EntityAnimal.java
3 -@@ -40,6 +40,9 @@
3 +@@ -7,6 +7,7 @@
4 + protected Block bA;
5 + private int bx;
6 + private EntityHuman by;
7 ++ public ItemStack breedItem; // CraftBukkit - Add breedItem variable
8 +
9 + public EntityAnimal(World world) {
10 + super(world);
11 +@@ -40,6 +41,9 @@
4 12
5 13 }
6 14
7 15 + /* CraftBukkit start
8 16 + // Function disabled as it has no special function anymore after
9 17 + // setSitting is disabled.
10 18 public boolean damageEntity(DamageSource damagesource, float f) {
11 19 if (this.isInvulnerable(damagesource)) {
12 20 return false;
13 -@@ -48,6 +51,7 @@
21 +@@ -48,6 +52,7 @@
14 22 return super.damageEntity(damagesource, f);
15 23 }
16 24 }
17 25 + // CraftBukkit end */
18 26
19 27 public float a(BlockPosition blockposition) {
20 28 return this.world.getType(blockposition.down()).getBlock() == Blocks.GRASS ? 10.0F : this.world.n(blockposition) - 0.5F;
29 +@@ -120,6 +125,7 @@
30 + public void c(EntityHuman entityhuman) {
31 + this.bx = 600;
32 + this.by = entityhuman;
33 ++ this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit
34 + this.world.broadcastEntityEffect(this, (byte) 18);
35 + }
36 +

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut