Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/EntityOcelot.patch

49 Zeilen
1.8 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntityOcelot.java
+++ b/net/minecraft/server/EntityOcelot.java
2016-06-09 03:43:49 +02:00
@@ -57,7 +57,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() {
2016-06-09 03:43:49 +02:00
@@ -103,6 +103,9 @@
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
}
2015-02-26 23:41:06 +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;
2016-06-09 03:43:49 +02:00
@@ -114,6 +117,7 @@
return super.damageEntity(damagesource, f);
}
}
+ // CraftBukkit end */
2016-05-10 13:47:39 +02:00
@Nullable
2016-02-29 22:32:46 +01:00
protected MinecraftKey J() {
2016-11-17 02:41:03 +01:00
@@ -133,7 +137,8 @@
}
2015-02-26 23:41:06 +01:00
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()) {
2017-05-14 04:00:00 +02:00
this.c(entityhuman);
this.setCatType(1 + this.world.random.nextInt(3));
2017-05-14 04:00:00 +02:00
this.p(true);
@@ -237,7 +242,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
}
}