PaperMC/nms-patches/EntityOcelot.patch

43 lines
1.9 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntityOcelot.java
+++ b/net/minecraft/server/EntityOcelot.java
2019-04-23 04:00:00 +02:00
@@ -80,7 +80,7 @@
2019-04-23 04:00:00 +02:00
@Override
public boolean isTypeNotPersistent(double d0) {
- return !this.isTrusting() && this.ticksLived > 2400;
+ return !this.isTrusting() /*&& this.ticksLived > 2400*/; // CraftBukkit
}
2019-04-23 04:00:00 +02:00
@Override
@@ -131,7 +131,8 @@
if ((this.bD == null || this.bD.h()) && !this.isTrusting() && this.i(itemstack) && entityhuman.h((Entity) this) < 9.0D) {
this.a(entityhuman, itemstack);
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()) {
2019-04-23 04:00:00 +02:00
this.setTrusting(true);
2018-07-15 02:00:00 +02:00
this.s(true);
2019-04-23 04:00:00 +02:00
this.world.broadcastEntityEffect(this, (byte) 41);
@@ -217,7 +218,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
}
}
@@ -253,9 +254,9 @@
private final EntityOcelot i;
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {
- Predicate predicate = IEntitySelector.e;
+ // Predicate predicate = IEntitySelector.e; // CraftBukkit - decompile error
2019-04-23 04:00:00 +02:00
- super(entityocelot, oclass, f, d0, d1, predicate::test);
+ super(entityocelot, oclass, f, d0, d1, IEntitySelector.e::test); // CraftBukkit - decompile error
this.i = entityocelot;
}