Use proper default for setting null display background color (#12010)
This commit is contained in:
@ -58,13 +58,13 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay {
|
|||||||
public Color getBackgroundColor() {
|
public Color getBackgroundColor() {
|
||||||
int color = this.getHandle().getBackgroundColor();
|
int color = this.getHandle().getBackgroundColor();
|
||||||
|
|
||||||
return (color == -1) ? null : Color.fromARGB(color);
|
return color == Display.TextDisplay.INITIAL_BACKGROUND ? null : Color.fromARGB(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBackgroundColor(Color color) {
|
public void setBackgroundColor(Color color) {
|
||||||
if (color == null) {
|
if (color == null) {
|
||||||
this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, -1);
|
this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, Display.TextDisplay.INITIAL_BACKGROUND);
|
||||||
} else {
|
} else {
|
||||||
this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, color.asARGB());
|
this.getHandle().getEntityData().set(Display.TextDisplay.DATA_BACKGROUND_COLOR_ID, color.asARGB());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user