3
0
Fork 1
KCauldronX/patches/net/minecraft/entity/passive/EntityOcelot.java.patch

22 lines
847 B
Diff

--- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java
@@ -89,7 +89,7 @@
protected boolean canDespawn()
{
- return !this.isTamed() && this.ticksExisted > 2400;
+ return !this.isTamed(); // CraftBukkit
}
public boolean isAIEnabled()
@@ -188,7 +188,8 @@
if (!this.worldObj.isRemote)
{
- if (this.rand.nextInt(3) == 0)
+ // CraftBukkit - added event call and isCancelled check
+ if (this.rand.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, p_70085_1_).isCancelled())
{
this.setTamed(true);
this.setTameSkin(1 + this.worldObj.rand.nextInt(3));