當前位置: 首頁>>代碼示例>>Java>>正文


Java I18n.format方法代碼示例

本文整理匯總了Java中net.minecraft.client.resources.I18n.format方法的典型用法代碼示例。如果您正苦於以下問題:Java I18n.format方法的具體用法?Java I18n.format怎麽用?Java I18n.format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.resources.I18n的用法示例。


在下文中一共展示了I18n.format方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildChildScreen

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
/**
 * This method is called in the constructor and is used to set the childScreen field.
 */
@Override
protected GuiScreen buildChildScreen()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();

    list.add(new DummyCategoryElement("addForgeChunkLoadingModCfg", "forge.configgui.ctgy.forgeChunkLoadingAddModConfig",
            AddModOverrideEntry.class));
    for (ConfigCategory cc : ForgeChunkManager.getModCategories())
        list.add(new ConfigElement(cc));

    return new GuiConfig(this.owningScreen, list, this.owningScreen.modID,
            this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
            this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, this.owningScreen.title,
            I18n.format("forge.configgui.ctgy.forgeChunkLoadingModConfig"));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:ForgeGuiFactory.java

示例2: setZoomAmount

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
public static void setZoomAmount(int zoomAmount) {
	if (zoomAmount > MAX_ZOOM) {
		zoomAmount = MAX_ZOOM;
	} else if (zoomAmount < MIN_ZOOM) {
		zoomAmount = MIN_ZOOM;
	}

	if (Config.zoomAmount != zoomAmount) {
		Config.zoomAmount = zoomAmount;
		if (config != null) {
			String configComment = I18n.format("config.itemzoom.zoom.amount");
			configComment = configComment + " [range: " + MIN_ZOOM + " ~ " + MAX_ZOOM + ", default: " + DEFAULT_ZOOM + "]";
			Property property = config.get(category, "zoom.amount", DEFAULT_ZOOM, configComment, MIN_ZOOM, MAX_ZOOM);
			property.set(Config.zoomAmount);
			if (config.hasChanged()) {
				config.save();
			}
		}
	}
}
 
開發者ID:mezz,項目名稱:ItemZoom,代碼行數:21,代碼來源:Config.java

示例3: drawScreen

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawDefaultBackground();
    if (this.usernameField != null && this.passwordField != null)
    {
        this.usernameField.drawTextBox();
        this.passwordField.drawTextBox();
        int offsetX = this.width / 2, offsetY = this.height / 2;
        String usernameText = I18n.format("gui.authlibloginhelper.username");
        String passwordText = I18n.format("gui.authlibloginhelper.password");
        this.drawString(this.fontRendererObj, usernameText, offsetX - 100, offsetY - 62, 0x00A0A0A0);
        this.drawString(this.fontRendererObj, passwordText, offsetX - 100, offsetY - 22, 0x00A0A0A0);
        super.drawScreen(mouseX, mouseY, partialTicks);
    }
}
 
開發者ID:ustc-zzzz,項目名稱:AuthlibLoginHelper,代碼行數:17,代碼來源:AuthlibLoginHelperGui.java

示例4: func_152129_a

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
public static GuiYesNo func_152129_a(GuiYesNoCallback p_152129_0_, String p_152129_1_, int p_152129_2_)
{
    String s = I18n.format("selectWorld.deleteQuestion", new Object[0]);
    String s1 = "\'" + p_152129_1_ + "\' " + I18n.format("selectWorld.deleteWarning", new Object[0]);
    String s2 = I18n.format("selectWorld.deleteButton", new Object[0]);
    String s3 = I18n.format("gui.cancel", new Object[0]);
    GuiYesNo guiyesno = new GuiYesNo(p_152129_0_, s, s1, s2, s3, p_152129_2_);
    return guiyesno;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:GuiSelectWorld.java

示例5: updateDisplayState

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
/**
 * Sets displayed GUI elements according to the current settings state
 */
private void updateDisplayState()
{
    this.btnGameMode.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + ": " + I18n.format("selectWorld.gameMode." + this.gameMode, new Object[0]);
    this.gameModeDesc1 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line1", new Object[0]);
    this.gameModeDesc2 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line2", new Object[0]);
    this.btnMapFeatures.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " ";

    if (this.generateStructuresEnabled)
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnBonusItems.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " ";

    if (this.bonusChestEnabled && !this.hardCoreMode)
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnMapType.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + I18n.format(WorldType.WORLD_TYPES[this.selectedIndex].getTranslateName(), new Object[0]);
    this.btnAllowCommands.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " ";

    if (this.allowCheats && !this.hardCoreMode)
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.off", new Object[0]);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:43,代碼來源:GuiCreateWorld.java

示例6: getTranslation

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
/**
 * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater
 * than/equal to the length of the String array, it is changed to 0.
 */
private static String getTranslation(String[] p_74299_0_, int p_74299_1_)
{
    if (p_74299_1_ < 0 || p_74299_1_ >= p_74299_0_.length)
    {
        p_74299_1_ = 0;
    }

    return I18n.format(p_74299_0_[p_74299_1_], new Object[0]);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:14,代碼來源:GameSettings.java

示例7: displayAchievement

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
public void displayAchievement(Achievement ach)
{
    this.achievementTitle = I18n.format("achievement.get", new Object[0]);
    this.achievementDescription = ach.getStatName().getUnformattedText();
    this.notificationTime = Minecraft.getSystemTime();
    this.theAchievement = ach;
    this.permanentNotification = false;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:9,代碼來源:GuiAchievement.java

示例8: drawGuiContainerForegroundLayer

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    String s = I18n.format("container.pressure_cooker");
    Optional.ofNullable(fluidTank.getFluid()).ifPresent(fluidStack -> {
        int fluidHeight = MathHelper.ceil(((float) fluidTank.getFluidAmount() / (float) fluidTank.getCapacity()) * (float) fluidBar.getHeight());
        GuiUtils.renderTiledFluid(fluidBar.getX() + guiLeft, fluidBar.getY() + guiTop + (fluidBar.getHeight() - fluidHeight), fluidBar.getWidth(), fluidHeight, this.zLevel, fluidStack);
    });
    this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 4, 4210752);
    this.fontRenderer.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 4, 4210752);
}
 
開發者ID:LasmGratel,項目名稱:FoodCraft-Reloaded,代碼行數:11,代碼來源:GuiContainerPressureCooker.java

示例9: onRenderGameOverlay

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event) {
	if (event.getType() == RenderGameOverlayEvent.ElementType.PORTAL) {
		Minecraft mc = Minecraft.getMinecraft();
		if (isKnockedOut) {
			GlStateManager.pushMatrix();
			GlStateManager.translate(0, 0, -300);
			GuiHelper.drawGradientRectW(0, 0, mc.displayWidth, mc.displayHeight, 0x60500000, 0x90FF0000);
			GlStateManager.popMatrix();
			if (mc.currentScreen == null) {
				mc.fontRenderer.drawStringWithShadow(I18n.format("gui.hardcorerevival.open_death_screen", mc.gameSettings.keyBindChat.getDisplayName()), 5, 5, 0xFFFFFFFF);
				mc.fontRenderer.drawString(I18n.format("gui.hardcorerevival.rescue_time_left", Math.max(0, (ModConfig.maxDeathTicks - deathTime) / 20)), 5, 7 + mc.fontRenderer.FONT_HEIGHT, 16777215);
				mc.getTextureManager().bindTexture(Gui.ICONS);
			}
		} else {
			if(targetEntity != -1) {
				Entity entity = mc.world.getEntityByID(targetEntity);
				if (entity instanceof EntityPlayer) {
					String s = I18n.format("gui.hardcorerevival.rescuing", ((EntityPlayer) entity).getDisplayNameString());
					if(targetProgress >= 0.75f) {
						s += " ...";
					} else if(targetProgress >= 0.5f) {
						s += " ..";
					} else if(targetProgress >= 0.25f) {
						s += " .";
					}
					mc.fontRenderer.drawString(s, event.getResolution().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(s) / 2, event.getResolution().getScaledHeight() / 2 + 30, 0xFFFFFFFF);
					mc.getTextureManager().bindTexture(Gui.ICONS);
				}
			}
		}
	} else if(event.getType() == RenderGameOverlayEvent.ElementType.CHAT) {
		if(prevChatHeight != -1f) {
			Minecraft.getMinecraft().gameSettings.chatHeightFocused = prevChatHeight;
		}
	}
}
 
開發者ID:blay09,項目名稱:HardcoreRevival,代碼行數:38,代碼來源:ClientProxy.java

示例10: drawGuiContainerForegroundLayer

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
	String s = I18n.format("pot.gui");
	this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
	this.fontRenderer.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
}
 
開發者ID:ArtixAllMighty,項目名稱:ExSartagine,代碼行數:8,代碼來源:GuiPot.java

示例11: drawSlot

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn)
{
    SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(entryID);
    String s = saveformatcomparator.getDisplayName();

    if (StringUtils.isEmpty(s))
    {
        s = GuiSelectWorld.this.field_146637_u + " " + (entryID + 1);
    }

    String s1 = saveformatcomparator.getFileName();
    s1 = s1 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed()));
    s1 = s1 + ")";
    String s2 = "";

    if (saveformatcomparator.requiresConversion())
    {
        s2 = GuiSelectWorld.this.field_146636_v + " " + s2;
    }
    else
    {
        s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()];

        if (saveformatcomparator.isHardcoreModeEnabled())
        {
            s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET;
        }

        if (saveformatcomparator.getCheatsEnabled())
        {
            s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]);
        }
    }

    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, p_180791_2_ + 2, p_180791_3_ + 1, 16777215);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 12, 8421504);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 12 + 10, 8421504);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:39,代碼來源:GuiSelectWorld.java

示例12: GuiConfirmOpenLink

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
public GuiConfirmOpenLink(GuiYesNoCallback p_i1084_1_, String linkTextIn, int p_i1084_3_, boolean p_i1084_4_)
{
    super(p_i1084_1_, I18n.format(p_i1084_4_ ? "chat.link.confirmTrusted" : "chat.link.confirm", new Object[0]), linkTextIn, p_i1084_3_);
    this.confirmButtonText = I18n.format(p_i1084_4_ ? "chat.link.open" : "gui.yes", new Object[0]);
    this.cancelButtonText = I18n.format(p_i1084_4_ ? "gui.cancel" : "gui.no", new Object[0]);
    this.copyLinkButtonText = I18n.format("chat.copy", new Object[0]);
    this.openLinkWarning = I18n.format("chat.link.warning", new Object[0]);
    this.linkText = linkTextIn;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:GuiConfirmOpenLink.java

示例13: Overlay

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
public Overlay(ContainerCodeStorage container)
{
    setWidth(196);
    setHeight(180);
    if(container.storage.isLockable())
    {
        lock = new Button(PurMagClient.BUTTON_TEXTURE, I18n.format("misc.gui.code_storage.lock"), () ->
        {
            Minecraft.getMinecraft().player.closeScreen();
            Minecraft.getMinecraft().displayGuiScreen(new PXLGui(new GuiCodeStorageLock(container.storage.getPos())));
        });
        lock.setSize(48, 12);
        lock.setPos(4, 4);
    }
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:16,代碼來源:GuiContainerCodeStorage.java

示例14: buildDisplayString

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
/**
 * Builds the localized display string for this GuiListButton
 */
private String buildDisplayString()
{
    return I18n.format(this.localizationStr, new Object[0]) + ": " + (this.field_175216_o ? I18n.format("gui.yes", new Object[0]) : I18n.format("gui.no", new Object[0]));
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:8,代碼來源:GuiListButton.java

示例15: updateValueButtonText

import net.minecraft.client.resources.I18n; //導入方法依賴的package包/類
@Override
public void updateValueButtonText()
{
    this.btnValue.displayString = I18n.format(configElement.getValidValues()[currentIndex]) + " - " + I18n.format("fml.configgui.sampletext");
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:6,代碼來源:GuiConfigEntries.java


注:本文中的net.minecraft.client.resources.I18n.format方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。