summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityOcelot.patch
blob: 84ab0f737d6e39265bea717e1779a2d1e23025eb (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
37
38
39
40
--- a/net/minecraft/server/EntityOcelot.java
+++ b/net/minecraft/server/EntityOcelot.java
@@ -60,7 +60,7 @@
     }
 
     public boolean isTypeNotPersistent() {
-        return !this.isTamed() && this.ticksLived > 2400;
+        return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
     }
 
     protected void initAttributes() {
@@ -107,7 +107,8 @@
             return false;
         } else {
             if (this.goalSit != null) {
-                this.goalSit.setSitting(false);
+                // CraftBukkit - moved into EntityLiving.d(DamageSource, float)
+                // this.goalSit.setSitting(false);
             }
 
             return super.damageEntity(damagesource, f);
@@ -132,7 +133,8 @@
             }
 
             if (!this.world.isClientSide) {
-                if (this.random.nextInt(3) == 0) {
+                // CraftBukkit - added event call and isCancelled check
+                if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
                     this.c(entityhuman);
                     this.setCatType(1 + this.world.random.nextInt(3));
                     this.s(true);
@@ -238,7 +240,7 @@
 
                 entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
                 entityocelot.setAgeRaw(-24000);
-                this.world.addEntity(entityocelot);
+                this.world.addEntity(entityocelot, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.OCELOT_BABY); // CraftBukkit - add SpawnReason
             }
         }