2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/EntityOcelot.java
|
|
|
|
+++ b/net/minecraft/server/EntityOcelot.java
|
2014-11-25 22:32:16 +01:00
|
|
|
@@ -51,7 +51,7 @@
|
|
|
|
}
|
|
|
|
|
|
|
|
protected boolean isTypeNotPersistent() {
|
|
|
|
- return !this.isTamed() && this.ticksLived > 2400;
|
|
|
|
+ return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2015-02-26 23:41:06 +01:00
|
|
|
protected void initAttributes() {
|
|
|
|
@@ -96,6 +96,9 @@
|
2014-12-09 15:40:38 +01:00
|
|
|
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
|
|
|
|
}
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2014-12-09 15:40:38 +01:00
|
|
|
+ /* 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;
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -104,6 +107,7 @@
|
2014-12-09 15:40:38 +01:00
|
|
|
return super.damageEntity(damagesource, f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ // CraftBukkit end */
|
|
|
|
|
|
|
|
protected void dropDeathLoot(boolean flag, int i) {}
|
|
|
|
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -124,7 +128,8 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2015-02-26 23:41:06 +01:00
|
|
|
if (!this.world.isClientSide) {
|
2014-11-25 22:32:16 +01:00
|
|
|
- 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.setTamed(true);
|
|
|
|
this.setCatType(1 + this.world.random.nextInt(3));
|
|
|
|
this.setOwnerUUID(entityhuman.getUniqueID().toString());
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -231,7 +236,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|