Search in sources :

Example 1 with LanternTextColor

use of org.lanternpowered.server.text.format.LanternTextColor in project LanternServer by LanternPowered.

the class TextColorRegistryModule method registerDefaults.

@EarlyRegistration
@Override
public void registerDefaults() {
    register(new LanternTextColor("black", Color.BLACK, TextConstants.BLACK));
    register(new LanternTextColor("dark_blue", Color.ofRgb(0x0000AA), TextConstants.DARK_BLUE));
    register(new LanternTextColor("dark_green", Color.ofRgb(0x00AA00), TextConstants.DARK_GREEN));
    register(new LanternTextColor("dark_aqua", Color.ofRgb(0x00AAAA), TextConstants.DARK_AQUA));
    register(new LanternTextColor("dark_red", Color.ofRgb(0xAA0000), TextConstants.DARK_RED));
    register(new LanternTextColor("dark_purple", Color.ofRgb(0xAA00AA), TextConstants.DARK_PURPLE));
    register(new LanternTextColor("gold", Color.ofRgb(0xFFAA00), TextConstants.GOLD));
    register(new LanternTextColor("gray", Color.ofRgb(0xAAAAAA), TextConstants.GRAY));
    register(new LanternTextColor("dark_gray", Color.ofRgb(0x555555), TextConstants.DARK_GRAY));
    register(new LanternTextColor("blue", Color.ofRgb(0x5555FF), TextConstants.BLUE));
    register(new LanternTextColor("green", Color.ofRgb(0x55FF55), TextConstants.GREEN));
    register(new LanternTextColor("aqua", Color.ofRgb(0x55FFFF), TextConstants.AQUA));
    register(new LanternTextColor("red", Color.ofRgb(0xFF5555), TextConstants.RED));
    register(new LanternTextColor("light_purple", Color.ofRgb(0xFF55FF), TextConstants.LIGHT_PURPLE));
    register(new LanternTextColor("yellow", Color.ofRgb(0xFFFF55), TextConstants.YELLOW));
    register(new LanternTextColor("white", Color.WHITE, TextConstants.WHITE));
    register(new LanternTextColor("reset", Color.WHITE, TextConstants.RESET));
    // Replacing the api class, ids may not be uppercase
    register(new TextColor() {

        @Override
        public String getId() {
            return "none";
        }

        @Override
        public String getName() {
            return getId();
        }

        @Override
        public Color getColor() {
            return Color.BLACK;
        }

        @Override
        public String toString() {
            return getId();
        }
    });
}
Also used : LanternTextColor(org.lanternpowered.server.text.format.LanternTextColor) TextColor(org.spongepowered.api.text.format.TextColor) Color(org.spongepowered.api.util.Color) LanternTextColor(org.lanternpowered.server.text.format.LanternTextColor) TextColor(org.spongepowered.api.text.format.TextColor) LanternTextColor(org.lanternpowered.server.text.format.LanternTextColor) EarlyRegistration(org.lanternpowered.server.game.registry.EarlyRegistration)

Aggregations

EarlyRegistration (org.lanternpowered.server.game.registry.EarlyRegistration)1 LanternTextColor (org.lanternpowered.server.text.format.LanternTextColor)1 TextColor (org.spongepowered.api.text.format.TextColor)1 Color (org.spongepowered.api.util.Color)1