summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityTippedArrow.patch
blob: 145287c67ace978ee68e7085550ce71a934d07bf (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
--- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java
@@ -98,6 +98,25 @@
         }
     }
 
+    // CraftBukkit start accessor methods
+    public void refreshEffects() {
+        this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+    }
+
+    public String getType() {
+        return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString();
+    }
+
+    public void setType(String string) {
+        this.potionRegistry = PotionRegistry.a.get(new MinecraftKey(string));
+        this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+    }
+
+    public boolean isTipped() {
+        return !(this.effects.isEmpty() && this.potionRegistry == Potions.a); // PAIL: rename
+    }
+    // CraftBukkit end
+
     public int n() {
         return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue();
     }