Java 类net.minecraft.util.text.translation.LanguageMap 实例源码

项目:Clef    文件:InstrumentLibrary.java   
public static void injectLocalization(Instrument instrument)
{
    String localName = "item.clef.instrument." + instrument.info.itemName + ".name=" + instrument.info.shortdescription;
    String localDesc = "item.clef.instrument." + instrument.info.itemName + ".desc=" + instrument.info.description;
    InputStream streamName = new ByteArrayInputStream(localName.getBytes(StandardCharsets.UTF_8));
    InputStream streamDesc = new ByteArrayInputStream(localDesc.getBytes(StandardCharsets.UTF_8));
    LanguageMap.inject(streamName);
    LanguageMap.inject(streamDesc);
}
项目:Backmemed    文件:LanguageManager.java   
public void onResourceManagerReload(IResourceManager resourceManager)
{
    List<String> list = Lists.newArrayList(new String[] {"en_us"});

    if (!"en_us".equals(this.currentLanguage))
    {
        list.add(this.currentLanguage);
    }

    CURRENT_LOCALE.loadLocaleDataFiles(resourceManager, list);
    LanguageMap.replaceWith(CURRENT_LOCALE.properties);
}
项目:CustomWorldGen    文件:LanguageManager.java   
public void onResourceManagerReload(IResourceManager resourceManager)
{
    List<String> list = Lists.newArrayList(new String[] {"en_US"});

    if (!"en_US".equals(this.currentLanguage))
    {
        list.add(this.currentLanguage);
    }

    CURRENT_LOCALE.loadLocaleDataFiles(resourceManager, list);
    LanguageMap.replaceWith(CURRENT_LOCALE.properties);
}
项目:CraftingHarmonics    文件:RenameOperation.java   
/**
 * Called to apply the set (if not player-specific)
 */
@Override
public void apply() {
    try {
        newNameStream.reset();
    } catch (IOException e) {
        LogHelper.warn("Unable to reset new name stream when renaming {}", ItemUtility.outputItemName(what));
    }
    LogHelper.info("Updating {} to be named {} instead of {}.", ItemUtility.outputItemName(what), name, oldName);
    LanguageMap.inject(newNameStream);
}
项目:CraftingHarmonics    文件:RenameOperation.java   
/**
 * Called to remove the set (if not player-specific)
 */
@Override
public void undo() {
    try {
        oldNameStream.reset();
    } catch (IOException e) {
        LogHelper.warn("Unable to reset old name stream when renaming {}", ItemUtility.outputItemName(what));
    }
    LanguageMap.inject(oldNameStream);
}
项目:D3Core    文件:LanguageHelper.java   
public static void run()
{
    //noinspection NullableProblems
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener()
    {
        @Override
        public void onResourceManagerReload(IResourceManager resourceManager)
        {
            D3LanguageInjectEvent event = new D3LanguageInjectEvent();
            MinecraftForge.EVENT_BUS.post(event);
            LanguageMap.replaceWith(event.map);
        }
    });
}
项目:ExpandedRailsMod    文件:LanguageManager.java   
public void onResourceManagerReload(IResourceManager resourceManager)
{
    List<String> list = Lists.newArrayList(new String[] {"en_US"});

    if (!"en_US".equals(this.currentLanguage))
    {
        list.add(this.currentLanguage);
    }

    CURRENT_LOCALE.loadLocaleDataFiles(resourceManager, list);
    LanguageMap.replaceWith(CURRENT_LOCALE.properties);
}
项目:Easy-Editors    文件:SmartTranslationRegistry.java   
/**
 * Utility method for getting the LanguageMap instance (the vanilla getter
 * is package-private)
 * 
 * @return The LanguageMap instance
 */
public static LanguageMap getLanguageMapInstance() {
    return languageMapInstance;
}