mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
9ee989ea81
By: md_5 <git@md-5.net>
35 lines
1.9 KiB
Diff
35 lines
1.9 KiB
Diff
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
|
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
|
@@ -133,7 +133,7 @@
|
|
|
|
@Override
|
|
public boolean removeWhenFarAway(double d0) {
|
|
- return !this.isTrusting() && this.tickCount > 2400;
|
|
+ return !this.isTrusting() /*&& this.tickCount > 2400*/; // CraftBukkit
|
|
}
|
|
|
|
public static AttributeProvider.Builder createAttributes() {
|
|
@@ -182,7 +182,8 @@
|
|
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && entityhuman.distanceToSqr((Entity) this) < 9.0D) {
|
|
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
|
if (!this.level.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()) {
|
|
this.setTrusting(true);
|
|
this.spawnTrustingParticles(true);
|
|
this.level.broadcastEntityEvent(this, (byte) 41);
|
|
@@ -312,10 +313,10 @@
|
|
private final EntityOcelot ocelot;
|
|
|
|
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {
|
|
- Predicate predicate = IEntitySelector.NO_CREATIVE_OR_SPECTATOR;
|
|
+ // Predicate predicate = IEntitySelector.NO_CREATIVE_OR_SPECTATOR; // CraftBukkit - decompile error
|
|
|
|
- Objects.requireNonNull(predicate);
|
|
- super(entityocelot, oclass, f, d0, d1, predicate::test);
|
|
+ // Objects.requireNonNull(predicate); // CraftBukkit - decompile error
|
|
+ super(entityocelot, oclass, f, d0, d1, IEntitySelector.NO_CREATIVE_OR_SPECTATOR::test); // CraftBukkit - decompile error
|
|
this.ocelot = entityocelot;
|
|
}
|
|
|