mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
49 lines
1.8 KiB
Diff
49 lines
1.8 KiB
Diff
--- a/net/minecraft/server/EntityOcelot.java
|
|
+++ b/net/minecraft/server/EntityOcelot.java
|
|
@@ -55,7 +55,7 @@
|
|
}
|
|
|
|
protected boolean isTypeNotPersistent() {
|
|
- return !this.isTamed() && this.ticksLived > 2400;
|
|
+ return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
|
|
}
|
|
|
|
protected void initAttributes() {
|
|
@@ -97,6 +97,9 @@
|
|
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
|
|
}
|
|
|
|
+ /* 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;
|
|
@@ -108,6 +111,7 @@
|
|
return super.damageEntity(damagesource, f);
|
|
}
|
|
}
|
|
+ // CraftBukkit end */
|
|
|
|
@Nullable
|
|
protected MinecraftKey J() {
|
|
@@ -125,7 +129,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.setTamed(true);
|
|
this.setCatType(1 + this.world.random.nextInt(3));
|
|
this.setOwnerUUID(entityhuman.getUniqueID());
|
|
@@ -234,7 +239,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
|
|
}
|
|
}
|
|
|