summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalNearestAttackableTarget.patch
blob: 5021dacefec8e9f1c50c03459a6ade2042a49c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- /home/matt/mc-dev-private//net/minecraft/server/PathfinderGoalNearestAttackableTarget.java	2015-02-26 22:40:22.955608135 +0000
+++ src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java	2015-02-26 22:40:22.955608135 +0000
@@ -60,7 +60,7 @@
             }
 
             public boolean apply(Object object) {
-                return this.a((EntityLiving) object);
+                return this.a((T) object); // CraftBukkit - fix decompile error
             }
         };
     }
@@ -83,7 +83,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();
     }
 
@@ -102,7 +102,7 @@
             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);
         }
     }