当前位置: 首页>>代码示例>>Java>>正文


Java ITooltipFlag类代码示例

本文整理汇总了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");
		 }
	 }
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:17,代码来源:PatternItem.java

示例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!");
    }

}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:18,代码来源:OinkIronPorkChop.java

示例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"));
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:18,代码来源:ItemFilledBowl.java

示例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);
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:19,代码来源:HybridFluidRenderer.java

示例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!");
    }

}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:20,代码来源:OinkGoldPorkChop.java

示例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);
                              });
}
 
开发者ID:cubex2,项目名称:chesttransporter,代码行数:23,代码来源:ItemChestTransporter.java

示例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));
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:27,代码来源:ItemCrate.java

示例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);
        }
    }
}
 
开发者ID:cubex2,项目名称:chesttransporter,代码行数:17,代码来源:Spawner.java

示例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!");
    }
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:21,代码来源:OinkDiamondPorkChop.java

示例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"));
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:10,代码来源:ItemNonDespawning.java

示例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);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:ItemMachineUpgrade.java

示例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;
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:35,代码来源:ItemAssemblyProgram.java

示例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"));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:15,代码来源:ItemEmptyPCB.java

示例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"));
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:ItemTubeModule.java

示例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());
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:11,代码来源:ItemBlueprint.java


注:本文中的net.minecraft.client.util.ITooltipFlag类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。