Paper/nms-patches/EntityOcelot.patch

34 lines
1.5 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-06-21 12:00:00 +02:00
@@ -81,7 +81,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
2019-12-10 23:00:00 +01:00
@@ -139,7 +139,8 @@
if ((this.bz == null || this.bz.h()) && !this.isTrusting() && this.i(itemstack) && entityhuman.h((Entity) this) < 9.0D) {
2019-04-23 04:00:00 +02:00
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);
2019-12-10 23:00:00 +01:00
@@ -249,9 +250,9 @@
2019-04-23 04:00:00 +02:00
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;
}