use of org.lanternpowered.server.game.registry.EarlyRegistration 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();
}
});
}
use of org.lanternpowered.server.game.registry.EarlyRegistration in project LanternServer by LanternPowered.
the class TextStyleRegistryModule method registerDefaults.
@EarlyRegistration
@Override
public void registerDefaults() {
register(new LanternTextStyle.Formatting("bold", true, null, null, null, null, TextConstants.BOLD));
register(new LanternTextStyle.Formatting("italic", null, true, null, null, null, TextConstants.ITALIC));
register(new LanternTextStyle.Formatting("underline", null, null, true, null, null, TextConstants.UNDERLINE));
register(new LanternTextStyle.Formatting("strikethrough", null, null, null, true, null, TextConstants.STRIKETHROUGH));
register(new LanternTextStyle.Formatting("obfuscated", null, null, null, null, true, TextConstants.OBFUSCATED));
register(new LanternTextStyle.Formatting("reset", false, false, false, false, false, TextConstants.RESET));
register(new LanternTextStyle("none", null, null, null, null, null));
}
use of org.lanternpowered.server.game.registry.EarlyRegistration in project LanternServer by LanternPowered.
the class TranslationManagerRegistryModule method registerDefaults.
@EarlyRegistration
@Override
public void registerDefaults() {
this.translationManager = new CombinedTranslationManager();
// Get the asset repository
final AssetRepository assetRepository = Lantern.getAssetRepository();
// Add the translation manager as a reload listener
assetRepository.addReloadListener(this.translationManager);
// Add the minecraft language file for defaults and
// the client translations
this.translationManager.addManager(new MinecraftTranslationManager());
final LanternTranslationManager lanternTranslationManager = new LanternTranslationManager();
// Add the lantern languages
lanternTranslationManager.addResourceBundle(assetRepository.get("lantern", "lang/en_us.properties").get(), Locale.ENGLISH);
this.translationManager.addManager(lanternTranslationManager);
this.translationManager.setDelegateManager(lanternTranslationManager);
}
use of org.lanternpowered.server.game.registry.EarlyRegistration in project LanternServer by LanternPowered.
the class BanTypeRegistryModule method registerDefaults.
@EarlyRegistration
@Override
public void registerDefaults() {
register(new LanternBanType("profile", Ban.Profile.class));
register(new LanternBanType("ip", Ban.Ip.class));
}
use of org.lanternpowered.server.game.registry.EarlyRegistration in project LanternServer by LanternPowered.
the class TextFormatRegistryModule method registerDefaults.
@EarlyRegistration
@Override
public void registerDefaults() {
try {
// Make sure that the color is updated properly
final Field colorField = TextFormat.class.getDeclaredField("color");
final Field styleField = TextFormat.class.getDeclaredField("style");
ReflectionHelper.setField(colorField, TextFormat.NONE, TextColors.NONE);
ReflectionHelper.setField(styleField, TextFormat.NONE, TextStyles.NONE);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations