本文整理匯總了Java中net.minecraft.client.util.ITooltipFlag類的典型用法代碼示例。如果您正苦於以下問題:Java ITooltipFlag類的具體用法?Java ITooltipFlag怎麽用?Java ITooltipFlag使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ITooltipFlag類屬於net.minecraft.client.util包,在下文中一共展示了ITooltipFlag類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
public void addInformation(ItemStack stack, World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if(!stack.hasTagCompound() || !stack.getTagCompound().hasKey("defieritem")){
tooltip.add("Blank Pattern");
}else{
ItemStack stored = new ItemStack(stack.getTagCompound().getCompoundTag("defieritem"));
DefierRecipe recipe = DefierRecipeRegistry.findRecipeForStack(stored);
if(recipe == null){
tooltip.add(TextFormatting.RED + "Unknown Recipe");
}else{
stored.clearCustomName();
tooltip.add("Item: " + stored.getDisplayName());
tooltip.add("Energy Cost: " + Defier.LARGE_NUMBER.format(recipe.getCost()) + "RF");
}
}
}
示例2: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if(OinkConfig.pEffects) {
tooltip.add("1st step towards the Ultimate Pork Chop!");
if (GuiScreen.isShiftKeyDown()) {
tooltip.add("Haste");
tooltip.add("Speed");
tooltip.add("Night Vision");
}
if (!GuiScreen.isShiftKeyDown())
tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
}else if(!OinkConfig.pEffects) {
tooltip.add("1st step towards the Ultimate Pork Chop!");
}
}
示例3: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if (stack.getTagCompound() == null) {
stack.setTagCompound(new NBTTagCompound()); //including this again because issues with crashing
}
NBTTagCompound nbt = stack.getTagCompound();
if (nbt.getInteger("hunger") == 0) {
float roundedSaturation = Math.round(nbt.getFloat("saturation") * 10) / 10;
tooltip.add(I18n.format("item.stew.desc2", nbt.getInteger("hunger"), roundedSaturation));
if (nbt.getInteger("hunger") == 0) {
tooltip.add(I18n.format("item.stew.desc3"));
} else {
tooltip.add(I18n.format("item.stew.desc1"));
}
}
}
示例4: getTooltip
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
public List<String> getTooltip(Minecraft minecraft, T ingredient, ITooltipFlag tooltipFlag) {
if(ModularMachinery.isMekanismLoaded) {
List<String> tooltip = attemptGetTooltip(minecraft, ingredient, tooltipFlag);
if(tooltip != null) {
return tooltip;
}
}
FluidStack f = ingredient.asFluidStack();
if(f == null) {
return Lists.newArrayList();
}
IIngredientRenderer<FluidStack> fluidStackRenderer = this.fluidStackRenderer;
if(fluidStackRenderer == null) {
fluidStackRenderer = ModIntegrationJEI.ingredientRegistry.getIngredientRenderer(FluidStack.class);
}
return fluidStackRenderer.getTooltip(minecraft, f, tooltipFlag);
}
示例5: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if(OinkConfig.pEffects) {
tooltip.add("2nd step towards the Ultimate Pork Chop!");
if (GuiScreen.isShiftKeyDown()) {
tooltip.add("Resistance");
tooltip.add("Fire Resistance");
tooltip.add("Haste");
tooltip.add("Speed");
tooltip.add("Night Vision");
}
if (!GuiScreen.isShiftKeyDown())
tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
}else if(!OinkConfig.pEffects) {
tooltip.add("2nd step towards the Ultimate Pork Chop!");
}
}
示例6: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> list, ITooltipFlag advanced)
{
NBTTagCompound tagCompound = getTagCompound(stack);
getChest(stack).ifPresent(chest ->
{
NonNullList<Pair<Integer, ItemStack>> items = Util.readItemsFromNBT(tagCompound);
int numItems = 0;
for (Pair<Integer, ItemStack> pair : items)
{
numItems += pair.getRight().getCount();
}
if (numItems > 0)
{
list.add("Contains " + numItems + " items");
}
list.add(chest.getRegistryName().toString());
chest.addInformation(stack, world, list, advanced);
});
}
示例7: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip,
ITooltipFlag advanced) {
/*
* if (!par1ItemStack.hasTagCompound()) {
* par1ItemStack.getTagCompound()=new NBTTagCompound();
* par1ItemStack.getTagCompound().setTag("Attributes", (NBTTagCompound)
* ((ItemUsable)par1ItemStack.getItem()).buildInAttributes.copy()); }
*/
if (stack.hasTagCompound()) {
super.addInformation(stack, world, tooltip, advanced);
if (stack.getTagCompound().getBoolean("Open")) {
tooltip.add("The crate is opened now");
tooltip.add("Right click to get the item");
}
tooltip.add("Possible content:");
for (String name : getData(stack).crateContent.keySet()) {
WeaponData data = MapList.nameToData.get(name);
if (data != null)
tooltip.add(data.getString(PropertyType.NAME));
}
}
}
示例8: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> list, ITooltipFlag advanced)
{
if (stack.hasTagCompound())
{
NBTTagCompound chestTile = stack.getTagCompound().getCompoundTag("ChestTile");
NBTTagCompound spawnData = chestTile.getCompoundTag("SpawnData");
String mobId = spawnData.getString("id");
if (mobId.length() > 0)
{
String translated = EntityList.getTranslationName(new ResourceLocation(mobId));
list.add(translated == null ? mobId : translated);
}
}
}
示例9: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if(OinkConfig.pEffects) {
tooltip.add("3rd step towards the Ultimate Pork Chop!");
if (GuiScreen.isShiftKeyDown()) {
tooltip.add("Strength");
tooltip.add("Regeneration");
tooltip.add("Resistance");
tooltip.add("Fire Resistance");
tooltip.add("Haste");
tooltip.add("Speed");
tooltip.add("Night Vision");
}
if (!GuiScreen.isShiftKeyDown())
tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
}else if(!OinkConfig.pEffects) {
tooltip.add("3rd step towards the Ultimate Pork Chop!");
}
}
示例10: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World worldIn, List<String> curInfo, ITooltipFlag moreInfo) {
super.addInformation(stack, worldIn, curInfo, moreInfo);
curInfo.add(I18n.format("gui.tooltip.doesNotDespawn"));
}
示例11: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> infoList, ITooltipFlag par4) {
if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) {
infoList.add(I18n.format("gui.tooltip.item.upgrade.usedIn"));
PneumaticRegistry.getInstance().getItemRegistry().addTooltip(this, infoList);
} else {
infoList.add(I18n.format("gui.tooltip.item.upgrade.shiftMessage"));
}
super.addInformation(stack, world, infoList, par4);
}
示例12: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World worldIn, List<String> infoList, ITooltipFlag par4) {
infoList.add("Required Machines:");
infoList.add("-" + Blockss.ASSEMBLY_CONTROLLER.getLocalizedName());
if (referencePrograms == null) {
referencePrograms = new AssemblyProgram[PROGRAMS_AMOUNT];
for (int i = 0; i < PROGRAMS_AMOUNT; i++) {
referencePrograms[i] = getProgramFromItem(i);
}
}
AssemblyProgram program = referencePrograms[Math.min(stack.getItemDamage(), PROGRAMS_AMOUNT - 1)];
AssemblyProgram.EnumMachine[] requiredMachines = program.getRequiredMachines();
for (AssemblyProgram.EnumMachine machine : requiredMachines) {
switch (machine) {
case PLATFORM:
infoList.add("-" + Blockss.ASSEMBLY_PLATFORM.getLocalizedName());
break;
case DRILL:
infoList.add("-" + Blockss.ASSEMBLY_DRILL.getLocalizedName());
break;
case LASER:
infoList.add("-" + Blockss.ASSEMBLY_LASER.getLocalizedName());
break;
case IO_UNIT_EXPORT:
infoList.add("-" + Blockss.ASSEMBLY_IO_UNIT.getLocalizedName() + " (export)");//TODO localize
break;
case IO_UNIT_IMPORT:
infoList.add("-" + Blockss.ASSEMBLY_IO_UNIT.getLocalizedName() + " (import)");
break;
}
}
}
示例13: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
public void addInformation(ItemStack stack, World player, List<String> infoList, ITooltipFlag par4) {
super.addInformation(stack, player, infoList, par4);
if (stack.getItemDamage() < 100) {
infoList.add(I18n.format("gui.tooltip.item.uvLightBox.successChance", 100 - stack.getItemDamage()));
} else {
infoList.add(I18n.format("gui.tooltip.item.uvLightBox.putInLightBox"));
}
if (stack.hasTagCompound()) {
infoList.add(I18n.format("gui.tooltip.item.uvLightBox.etchProgress",stack.getTagCompound().getInteger("etchProgress")));
} else if (stack.getItemDamage() < 100) {
infoList.add(I18n.format("gui.tooltip.item.uvLightBox.putInAcid"));
}
}
示例14: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, World par2EntityPlayer, List<String> par3List, ITooltipFlag par4) {
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
TubeModule module = ModuleRegistrator.getModule(moduleName);
module.addItemDescription(par3List);
par3List.add(TextFormatting.DARK_GRAY + "In line: " + (module.isInline() ? "Yes" : "No"));
}
示例15: addInformation
import net.minecraft.client.util.ITooltipFlag; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
DynamicMachine machine = getAssociatedMachine(stack);
if(machine == null) {
tooltip.add(TextFormatting.GRAY + I18n.format("tooltip.machinery.empty"));
} else {
tooltip.add(TextFormatting.GRAY + machine.getLocalizedName());
}
}