Search in sources :

Example 1 with ItemPipeProperties

use of gregtech.api.unification.material.properties.ItemPipeProperties in project GregTech by GregTechCEu.

the class ItemBlockItemPipe method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(@Nonnull ItemStack stack, @Nullable World worldIn, @Nonnull List<String> tooltip, @Nonnull ITooltipFlag flagIn) {
    ItemPipeProperties pipeProperties = blockPipe.createItemProperties(stack);
    if (pipeProperties.getTransferRate() % 1 != 0)
        tooltip.add(I18n.format("gregtech.item_pipe.rate_items", (int) ((pipeProperties.getTransferRate() * 64) + 0.5)));
    else
        tooltip.add(I18n.format("gregtech.item_pipe.rate_stacks", (int) pipeProperties.getTransferRate()));
    tooltip.add(I18n.format("gregtech.item_pipe.priority", pipeProperties.getPriority()));
    if (flagIn.isAdvanced()) {
        tooltip.add("MetaItem Id: " + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getPrefix().name + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getItemMaterial(stack).toCamelCaseString());
    }
}
Also used : BlockMaterialPipe(gregtech.api.pipenet.block.material.BlockMaterialPipe) ItemBlockMaterialPipe(gregtech.api.pipenet.block.material.ItemBlockMaterialPipe) ItemPipeProperties(gregtech.api.unification.material.properties.ItemPipeProperties) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

BlockMaterialPipe (gregtech.api.pipenet.block.material.BlockMaterialPipe)1 ItemBlockMaterialPipe (gregtech.api.pipenet.block.material.ItemBlockMaterialPipe)1 ItemPipeProperties (gregtech.api.unification.material.properties.ItemPipeProperties)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1