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

43 Zeilen
1.9 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
}
2019-04-23 04:00:00 +02:00
@Override
2019-06-21 12:00:00 +02:00
@@ -132,7 +132,8 @@
if ((this.bC == null || this.bC.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);
@@ -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;
}