SPIGOT-6935: Make Arrow color nullable

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2022-02-19 09:36:08 +11:00
parent b9534e1c48
commit 7fe2a47414

View file

@ -116,11 +116,15 @@ public class CraftTippedArrow extends CraftArrow implements Arrow {
@Override
public void setColor(Color color) {
getHandle().setFixedColor(color.asRGB());
int colorRGB = (color == null) ? -1 : color.asRGB();
getHandle().setFixedColor(colorRGB);
}
@Override
public Color getColor() {
if (getHandle().getColor() <= -1) {
return null;
}
return Color.fromRGB(getHandle().getColor());
}
}