3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2025-01-11 23:50:54 +01:00
Paper/nms-patches/PathfinderGoalNearestAttackableTarget.patch

48 Zeilen
2.1 KiB
Diff

2015-05-25 20:37:24 +10:00
--- a/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
+++ b/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
2018-07-15 10:00:00 +10:00
@@ -44,11 +44,11 @@
2016-03-01 08:32:46 +11:00
return false;
} else {
Collections.sort(list, this.b);
- this.d = (EntityLiving) list.get(0);
+ this.d = (T) list.get(0); // CraftBukkit - fix decompile error
return true;
}
} else {
2016-06-09 11:43:49 +10:00
- this.d = this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function() {
+ this.d = (T) this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function<EntityHuman, Double>() { // CraftBukkit - fix decompile error
2016-05-10 21:47:39 +10:00
@Nullable
public Double a(@Nullable EntityHuman entityhuman) {
2016-03-01 08:32:46 +11:00
ItemStack itemstack = entityhuman.getEquipment(EnumItemSlot.HEAD);
2018-07-15 10:00:00 +10:00
@@ -57,10 +57,10 @@
2016-03-01 08:32:46 +11:00
}
2016-11-17 12:41:03 +11:00
@Nullable
- public Object apply(@Nullable Object object) {
+ public Double apply(@Nullable EntityHuman object) { // CraftBukkit - fix decompile error
2016-03-01 08:32:46 +11:00
return this.a((EntityHuman) object);
}
- }, this.c);
+ }, (Predicate<EntityHuman>) this.c); // CraftBukkit - fix decompile error
return this.d != null;
}
}
2018-07-15 10:00:00 +10:00
@@ -70,7 +70,7 @@
}
public void c() {
- this.e.setGoalTarget(this.d);
+ this.e.setGoalTarget(this.d, d instanceof EntityPlayer ? org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER : org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true); // Craftbukkit - reason
super.c();
}
2015-02-26 22:41:06 +00:00
2018-07-15 10:00:00 +10:00
@@ -89,7 +89,7 @@
2015-02-26 22:41:06 +00:00
return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0);
}
- public int compare(Object object, Object object1) {
+ public int compare(Entity object, Entity object1) { // CraftBukkit - fix decompile error
return this.a((Entity) object, (Entity) object1);
}
}