diff --git a/nms-patches/EntityTippedArrow.patch b/nms-patches/EntityTippedArrow.patch index 9e21160297..83722039dd 100644 --- a/nms-patches/EntityTippedArrow.patch +++ b/nms-patches/EntityTippedArrow.patch @@ -1,9 +1,10 @@ --- a/net/minecraft/server/EntityTippedArrow.java +++ b/net/minecraft/server/EntityTippedArrow.java -@@ -116,6 +116,25 @@ +@@ -116,11 +116,30 @@ } } +- public int o() { + // CraftBukkit start accessor methods + public void refreshEffects() { + this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)))); @@ -23,6 +24,12 @@ + } + // CraftBukkit end + - public int o() { ++ public int o() { // PAIL: rename getColor return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue(); } + +- private void d(int i) { ++ public void d(int i) { // PAIL: private -> public, rename setColor + this.at = true; + this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(i)); + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java index 7a5f50f430..955954fce9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.entity; import java.util.List; import org.apache.commons.lang.Validate; +import org.bukkit.Color; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.entity.EntityType; @@ -119,4 +120,14 @@ public class CraftTippedArrow extends CraftArrow implements TippedArrow { public PotionData getBasePotionData() { return CraftPotionUtil.toBukkit(getHandle().getType()); } + + @Override + public void setColor(Color color) { + getHandle().d(color.asRGB()); + } + + @Override + public Color getColor() { + return Color.fromRGB(getHandle().o()); + } }