Java 类net.minecraftforge.fml.common.registry.LanguageRegistry 实例源码

项目:NOVA-Core    文件:MCLanguageManager.java   
@Override
@SuppressWarnings("deprecation")
public void preInit(FMLPreInitializationEvent evt) {
    this.languageMap.forEach((language, map) -> {
        String lang = language.replace('-', '_');
        map.forEach((key, value) -> LanguageRegistry.instance().addStringLocalization(key, lang, value));
    });

    Game.events().on(LanguageEvent.RegisterTranslation.class).withPriority(EventBus.PRIORITY_LOW).bind(this::register);
}
项目:Minecraft-Modding    文件:ScienceModItems.java   
/**
 * Localizes the names of all compounds.
 */
@SuppressWarnings("deprecation")
public static void localizeCompounds()
{
    for (int i = 0; i < compound.getNumSubtypes(); i++)
    {
        ItemStack stack = new ItemStack(compound, 1, i);
        LanguageRegistry.addName(stack, PropertyLoader.getName(CompoundItem.getCompound(i).getChemFormula()));
    }
}
项目:NOVA-Core    文件:MCLanguageManager.java   
@SuppressWarnings("deprecation")
public void register(LanguageEvent.RegisterTranslation evt) {
    LanguageRegistry.instance().addStringLocalization(evt.key, evt.language.replace('-', '_'), evt.value);
}
项目:SpaceCore    文件:BaseMod.java   
protected void registerLanguage( String lang )
{
    String path = "/assets/" + mod + "/lang/" + lang + ".lang";
    LanguageRegistry.instance().loadLocalization( path, lang, false );
}