Search in sources :

Example 1 with SpongeTextColor

use of org.spongepowered.common.text.format.SpongeTextColor in project SpongeCommon by SpongePowered.

the class DisplaySlotRegistryModule method registerDefaults.

@Override
public void registerDefaults() {
    this.displaySlotMappings.put("minecraft:list", new SpongeDisplaySlot("list", null, 0));
    this.displaySlotMappings.put("minecraft:sidebar", new SpongeDisplaySlot("sidebar", null, 1));
    this.displaySlotMappings.put("minecraft:below_name", new SpongeDisplaySlot("below_name", null, 2));
    for (Map.Entry<TextFormatting, SpongeTextColor> entry : TextColorRegistryModule.enumChatColor.entrySet()) {
        final String id = entry.getValue().getId().toLowerCase(Locale.ENGLISH);
        final SpongeDisplaySlot value = new SpongeDisplaySlot(id, entry.getValue(), entry.getKey().getColorIndex() + 3);
        this.displaySlotMappings.put("minecraft:" + id, value);
    }
}
Also used : SpongeTextColor(org.spongepowered.common.text.format.SpongeTextColor) TextFormatting(net.minecraft.util.text.TextFormatting) HashMap(java.util.HashMap) Map(java.util.Map) SpongeDisplaySlot(org.spongepowered.common.scoreboard.SpongeDisplaySlot)

Example 2 with SpongeTextColor

use of org.spongepowered.common.text.format.SpongeTextColor in project SpongeCommon by SpongePowered.

the class TextColorRegistryModule method addTextColor.

private static void addTextColor(TextFormatting handle, Color color) {
    SpongeTextColor spongeColor = new SpongeTextColor(handle, color);
    textColorMappings.put(handle.name().toLowerCase(Locale.ENGLISH), spongeColor);
    enumChatColor.put(handle, spongeColor);
}
Also used : SpongeTextColor(org.spongepowered.common.text.format.SpongeTextColor)

Aggregations

SpongeTextColor (org.spongepowered.common.text.format.SpongeTextColor)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TextFormatting (net.minecraft.util.text.TextFormatting)1 SpongeDisplaySlot (org.spongepowered.common.scoreboard.SpongeDisplaySlot)1