summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityAnimal.patch
blob: 03998da2320e5d84191a29c86d11e23d688fc679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/net/minecraft/server/EntityAnimal.java
+++ b/net/minecraft/server/EntityAnimal.java
@@ -7,6 +7,7 @@
     protected Block bA;
     private int bx;
     private EntityHuman by;
+    public ItemStack breedItem; // CraftBukkit - Add breedItem variable
 
     public EntityAnimal(World world) {
         super(world);
@@ -40,6 +41,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;
@@ -48,6 +52,7 @@
             return super.damageEntity(damagesource, f);
         }
     }
+    // CraftBukkit end */
 
     public float a(BlockPosition blockposition) {
         return this.world.getType(blockposition.down()).getBlock() == Blocks.GRASS ? 10.0F : this.world.n(blockposition) - 0.5F;
@@ -120,6 +125,7 @@
     public void c(EntityHuman entityhuman) {
         this.bx = 600;
         this.by = entityhuman;
+        this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit
         this.world.broadcastEntityEffect(this, (byte) 18);
     }