summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityPhantom.patch
blob: eca94bc6831b78e377e6859424aabf6fa14c659b (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
30
31
32
33
34
35
36
--- a/net/minecraft/server/EntityPhantom.java
+++ b/net/minecraft/server/EntityPhantom.java
@@ -28,10 +28,11 @@
     }
 
     protected void n() {
-        this.goalSelector.a(1, new EntityPhantom.c(null));
-        this.goalSelector.a(2, new EntityPhantom.i(null));
-        this.goalSelector.a(3, new EntityPhantom.e(null));
-        this.targetSelector.a(1, new EntityPhantom.b(null));
+        // CraftBukkit - decompile errors
+        this.goalSelector.a(1, new EntityPhantom.c());
+        this.goalSelector.a(2, new EntityPhantom.i());
+        this.goalSelector.a(3, new EntityPhantom.e());
+        this.targetSelector.a(1, new EntityPhantom.b());
     }
 
     protected void initAttributes() {
@@ -186,7 +187,7 @@
             } else {
                 this.b = 60;
                 AxisAlignedBB axisalignedbb = EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D);
-                List list = EntityPhantom.this.world.a(EntityHuman.class, axisalignedbb);
+                List<EntityHuman> list = EntityPhantom.this.world.a(EntityHuman.class, axisalignedbb); // CraftBukkit - decompile error
 
                 if (!list.isEmpty()) {
                     list.sort((entityhuman, entityhuman1) -> {
@@ -198,7 +199,7 @@
                         EntityHuman entityhuman = (EntityHuman) iterator.next();
 
                         if (PathfinderGoalTarget.a(EntityPhantom.this, entityhuman, false, false)) {
-                            EntityPhantom.this.setGoalTarget(entityhuman);
+                            EntityPhantom.this.setGoalTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason
                             return true;
                         }
                     }