本文整理匯總了Java中net.minecraft.util.text.TextFormatting.AQUA屬性的典型用法代碼示例。如果您正苦於以下問題:Java TextFormatting.AQUA屬性的具體用法?Java TextFormatting.AQUA怎麽用?Java TextFormatting.AQUA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.text.TextFormatting
的用法示例。
在下文中一共展示了TextFormatting.AQUA屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleFluidContainerTooltip
private void handleFluidContainerTooltip(ItemTooltipEvent event) {
FluidStack fluidStack = FluidUtil.getFluidContained(event.getItemStack());
if (fluidStack != null && fluidStack.amount > 0) {
String key = "gui.tooltip.item." + fluidStack.getFluid().getName() + "_bucket";
if (I18n.hasKey(key)) {
if (event.getToolTip().get(event.getToolTip().size() - 1).contains("Minecraft Forge")) {
// bit of a kludge! otherwise the blue "Minecraft Forge" string gets shown twice
event.getToolTip().remove(event.getToolTip().size() - 1);
}
String prefix = "";
if (!FluidRegistry.getDefaultFluidName(fluidStack.getFluid()).startsWith(Names.MOD_ID)) {
// fluid is owned by another mod; let's make it clear that this tooltip applies to PneumaticCraft
prefix = TextFormatting.DARK_AQUA + "" + TextFormatting.ITALIC + "[" + Names.MOD_NAME + "] ";
}
if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) {
String translatedInfo = TextFormatting.AQUA + I18n.format(key);
event.getToolTip().addAll(PneumaticCraftUtils.convertStringIntoList(prefix + translatedInfo, 40));
} else {
event.getToolTip().add(TextFormatting.AQUA + I18n.format("gui.tooltip.sneakForInfo"));
}
}
}
}
示例2: getTranslatedString
public String getTranslatedString(float value, boolean withColor) {
String valueStr = String.valueOf(value);
if (this.typeOfValue == Type.PERCENTAGE)
valueStr = Integer.toString(Math.round((value - 1) * 100)) + "%";
else if (this.typeOfValue == Type.INVERTED_PERCENTAGE)
valueStr = Integer.toString(Math.round((1 - value) * 100)) + "%";
else if (this.typeOfValue == Type.ADDITIVE)
valueStr = Integer.toString(Math.round(value));
if (withColor) {
TextFormatting color = this.state == State.POSITIVE ? TextFormatting.AQUA
: (this.state == State.NEGATIVE ? TextFormatting.RED : TextFormatting.WHITE);
return color + I18n.format("weaponAttribute." + this.name, new Object[] { valueStr });
} else
return I18n.format("weaponAttribute." + this.name, new Object[] { valueStr });
}
示例3: addTooltip
public static void addTooltip(ItemStack stack, World world, List<String> curInfo) {
String info = "gui.tooltip." + stack.getUnlocalizedName();//getItem().getUnlocalizedName();
String translatedInfo = I18n.format(info);
if (!translatedInfo.equals(info)) {
if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) {
translatedInfo = TextFormatting.AQUA + translatedInfo;
if (!Loader.isModLoaded(ModIds.IGWMOD))
translatedInfo += " \\n \\n" + I18n.format("gui.tab.info.assistIGW");
curInfo.addAll(PneumaticCraftUtils.convertStringIntoList(translatedInfo, 40));
} else {
curInfo.add(TextFormatting.AQUA + I18n.format("gui.tooltip.sneakForInfo"));
}
}
}
示例4: addInformation
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, World world, List<String> curInfo, ITooltipFlag flag) {
if (stack.hasTagCompound() && stack.getTagCompound().hasKey(PneumaticCraftUtils.SAVED_TANKS, Constants.NBT.TAG_COMPOUND)) {
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(PneumaticCraftUtils.SAVED_TANKS);
for (String s : tag.getKeySet()) {
NBTTagCompound tankTag = tag.getCompoundTag(s);
FluidTank tank = new FluidTank(tankTag.getInteger("Amount"));
tank.readFromNBT(tankTag);
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null && fluidStack.amount > 0) {
curInfo.add(fluidStack.getFluid().getLocalizedName(fluidStack) + ": " + fluidStack.amount + "mB");
}
}
}
if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) {
TileEntity te = createTileEntity(world, getDefaultState());
if (te instanceof TileEntityPneumaticBase) {
float pressure = ((TileEntityPneumaticBase) te).dangerPressure;
curInfo.add(TextFormatting.YELLOW + I18n.format("gui.tooltip.maxPressure", pressure));
}
}
String info = "gui.tab.info." + stack.getUnlocalizedName();
String translatedInfo = I18n.format(info);
if (!translatedInfo.equals(info)) {
if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) {
translatedInfo = TextFormatting.AQUA + translatedInfo.substring(2);
if (!Loader.isModLoaded(ModIds.IGWMOD))
translatedInfo += " \\n \\n" + I18n.format("gui.tab.info.assistIGW");
curInfo.addAll(PneumaticCraftUtils.convertStringIntoList(translatedInfo, 40));
} else {
curInfo.add(TextFormatting.AQUA + I18n.format("gui.tooltip.sneakForInfo"));
}
}
}