From 4a8818c5fd4be406c59b518b86f10f39b4e6dcdd Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Wed, 2 Mar 2016 20:43:58 -0500 Subject: SPIGOT-1638 / SPIGOT-1673: Rework Potions API --- nms-patches/EntityTippedArrow.patch | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nms-patches/EntityTippedArrow.patch (limited to 'nms-patches/EntityTippedArrow.patch') diff --git a/nms-patches/EntityTippedArrow.patch b/nms-patches/EntityTippedArrow.patch new file mode 100644 index 00000000..135274da --- /dev/null +++ b/nms-patches/EntityTippedArrow.patch @@ -0,0 +1,37 @@ +--- a/net/minecraft/server/EntityTippedArrow.java ++++ b/net/minecraft/server/EntityTippedArrow.java +@@ -10,7 +10,7 @@ + + private static final DataWatcherObject f = DataWatcher.a(EntityTippedArrow.class, DataWatcherRegistry.b); + private PotionRegistry g; +- private final Set h; ++ public final Set 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(); + } -- cgit v1.2.3