summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityTippedArrow.patch
blob: 135274dad2f102d203d2c6696af250a10d1e5975 (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
37
--- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java
@@ -10,7 +10,7 @@
 
     private static final DataWatcherObject<Integer> f = DataWatcher.a(EntityTippedArrow.class, DataWatcherRegistry.b);
     private PotionRegistry g;
-    private final Set<MobEffect> h;
+    public final Set<MobEffect> h; // CraftBukkit private -> public
 
     public EntityTippedArrow(World world) {
         super(world);
@@ -98,6 +98,25 @@
         }
     }
 
+    // CraftBukkit start accessor methods
+    public void refreshEffects() {
+        this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename
+    }
+
+    public String getType() {
+        return ((MinecraftKey) PotionRegistry.a.b(this.g)).toString();
+    }
+
+    public void setType(String string) {
+        this.g = PotionRegistry.a.get(new MinecraftKey(string));
+        this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename
+    }
+
+    public boolean isTipped() {
+        return !(this.h.isEmpty() && this.g == Potions.a); // PAIL: rename
+    }
+    // CraftBukkit end
+
     public int n() {
         return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue();
     }