3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 14:50:08 +01:00
Paper/nms-patches/EntityOcelot.patch

34 Zeilen
1.6 KiB
Diff

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
}
2020-06-25 02:00:00 +02:00
public static AttributeProvider.Builder eL() {
@@ -135,7 +135,8 @@
if ((this.by == null || this.by.h()) && !this.isTrusting() && this.k(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);
2020-06-25 02:00:00 +02:00
this.u(true);
2019-04-23 04:00:00 +02:00
this.world.broadcastEntityEffect(this, (byte) 41);
2020-06-25 02:00:00 +02:00
@@ -244,9 +245,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;
}