本文整理匯總了Java中net.minecraft.util.text.TextFormatting.YELLOW屬性的典型用法代碼示例。如果您正苦於以下問題:Java TextFormatting.YELLOW屬性的具體用法?Java TextFormatting.YELLOW怎麽用?Java TextFormatting.YELLOW使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.text.TextFormatting
的用法示例。
在下文中一共展示了TextFormatting.YELLOW屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawGuiContainerForegroundLayer
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
int[] data = ((ContainerBarrel) inventorySlots).data_a;
this.renderHoveredToolTip(mouseX - guiLeft, mouseY - guiTop);
if (mouseX > guiLeft + 62 && mouseX < guiLeft + 114 && mouseY > guiTop + 17 && mouseY < guiTop + 33) {
FluidStack fstack = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(1000, false);
if (fstack != null) {
ArrayList<String> tooltip = new ArrayList<String>(2);
String color = fstack.getFluid().getTemperature() > 600 ? TextFormatting.GOLD.toString() : fstack.getFluid().getTemperature() < 150 ? TextFormatting.AQUA.toString() : TextFormatting.DARK_AQUA.toString();
tooltip.add(color + fstack.getLocalizedName());
tooltip.add(TextFormatting.GRAY + I18n.format("fluid.quantity.mB", fstack.amount));
drawHoveringText(tooltip, mouseX - guiLeft, mouseY - guiTop);
} else {
drawHoveringText(I18n.format("fluid.none"), mouseX - guiLeft, mouseY - guiTop);
}
} else if (mouseX > guiLeft + 134 && mouseX < guiLeft + 150 && mouseY > guiTop + 20 && mouseY < guiTop + 36) {
String text = TextFormatting.YELLOW + I18n.format("tile.barrel.altar.working");
if (data[3] == 0) text = TextFormatting.GREEN + I18n.format("tile.barrel.altar.none_required");
else if (te.getAltar(false) == null)
text = TextFormatting.DARK_RED + I18n.format("tile.barrel.altar.no_altar");
else if (data[3] == data[1]) text = TextFormatting.GREEN + I18n.format("tile.barrel.altar.done");
drawHoveringText(text, mouseX - guiLeft, mouseY - guiTop);
}
}
示例2: getItemStackDisplayName
@Override
public String getItemStackDisplayName(ItemStack stack) {
IBlockState camoState = getCamoState(stack);
String disp = super.getItemStackDisplayName(stack);
if (camoState != null) {
return disp + ": " + TextFormatting.YELLOW + getCamoStateDisplayName(camoState);
} else {
return disp;
}
}
示例3: updateButtons
public void updateButtons() {
buttonList.clear();
buttonList.add(redstoneButton);
if (!te.getSensorSetting().equals("")) {
buttonList.add(new GuiButton(1, guiLeft + 70, guiTop + 18, 30, 20, "back"));
} else {
buttonList.add(new GuiButton(-1, guiLeft + 70, guiTop + 125, 98, 20, I18n.format("gui.universalSensor.button.showRange")));
}
String[] directories = SensorHandler.getInstance().getDirectoriesAtLocation(te.getSensorSetting());
maxPage = (directories.length - 1) / MAX_SENSORS_PER_PAGE + 1;
if (page > maxPage) page = maxPage;
if (page < 1) page = 1;
if (maxPage > 1) {
buttonList.add(new GuiButton(2, guiLeft + 70, guiTop + 40 + 22 * MAX_SENSORS_PER_PAGE, 30, 20, "<--"));
buttonList.add(new GuiButton(3, guiLeft + 138, guiTop + 40 + 22 * MAX_SENSORS_PER_PAGE, 30, 20, "-->"));
}
int buttonsOnPage = MAX_SENSORS_PER_PAGE;
if (page == maxPage && (directories.length % MAX_SENSORS_PER_PAGE > 0 || directories.length == 0)) {
buttonsOnPage = directories.length % MAX_SENSORS_PER_PAGE;
}
for (int i = 0; i < buttonsOnPage; i++) {
String buttonText = directories[i + (page - 1) * MAX_SENSORS_PER_PAGE];
if (SensorHandler.getInstance().getSensorFromPath(te.getSensorSetting() + "/" + buttonText) != null) {
buttonText = TextFormatting.YELLOW + buttonText;
}
int buttonID = i * 10 + 10 + (page - 1) * MAX_SENSORS_PER_PAGE * 10;
int buttonX = guiLeft + 70;
int buttonY = guiTop + 40 + i * 22;
int buttonWidth = 98;
int buttonHeight = 20;
if (te.getSensorSetting().equals("")) {
Set<Item> requiredItems = SensorHandler.getInstance().getRequiredStacksFromText(buttonText);
GuiButtonSpecial button = new GuiButtonSpecial(buttonID, buttonX, buttonY, buttonWidth, buttonHeight, "");
ItemStack[] requiredStacks = new ItemStack[requiredItems.size()];
Iterator<Item> iterator = requiredItems.iterator();
for (int j = 0; j < requiredStacks.length; j++) {
requiredStacks[j] = new ItemStack(iterator.next());
}
button.setRenderStacks(requiredStacks);
button.enabled = te.areGivenUpgradesInserted(requiredItems);
buttonList.add(button);
} else {
buttonList.add(new GuiButton(buttonID, buttonX, buttonY, buttonWidth, buttonHeight, buttonText));
}
}
sensorInfoStat.setText(getSensorInfo());
ISensorSetting sensor = SensorHandler.getInstance().getSensorFromPath(te.getSensorSetting());
boolean textboxEnabled = sensor != null && sensor.needsTextBox();
nameFilterField.setVisible(textboxEnabled);
if (!textboxEnabled) nameFilterField.setFocused(false);
}
示例4: ItemParchment
public ItemParchment(String name)
{
super(name, TextFormatting.YELLOW);
setMaxStackSize(1);
}