Paper/nms-patches/EntityTippedArrow.patch

29 lines
1.0 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java
@@ -98,6 +98,25 @@
}
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
2016-06-09 03:43:49 +02:00
+ this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+ }
+
+ public String getType() {
2016-06-09 03:43:49 +02:00
+ return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString();
+ }
+
+ public void setType(String string) {
2016-06-09 03:43:49 +02:00
+ 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() {
2016-06-09 03:43:49 +02:00
+ return !(this.effects.isEmpty() && this.potionRegistry == Potions.a); // PAIL: rename
+ }
+ // CraftBukkit end
+
public int n() {
return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue();
}