use of gregtech.api.pipenet.block.material.BlockMaterialPipe in project GregTech by GregTechCEu.
the class ItemBlockCable method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(@Nonnull ItemStack stack, @Nullable World worldIn, @Nonnull List<String> tooltip, @Nonnull ITooltipFlag flagIn) {
WireProperties wireProperties = blockPipe.createItemProperties(stack);
int tier = GTUtility.getTierByVoltage(wireProperties.getVoltage());
if (wireProperties.isSuperconductor())
tooltip.add(I18n.format("gregtech.cable.superconductor", GTValues.VN[tier]));
tooltip.add(I18n.format("gregtech.cable.voltage", wireProperties.getVoltage(), GTValues.VNF[tier]));
tooltip.add(I18n.format("gregtech.cable.amperage", wireProperties.getAmperage()));
tooltip.add(I18n.format("gregtech.cable.loss_per_block", wireProperties.getLossPerBlock()));
if (flagIn.isAdvanced()) {
tooltip.add("MetaItem Id: " + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getPrefix().name + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getItemMaterial(stack).toCamelCaseString());
}
}
use of gregtech.api.pipenet.block.material.BlockMaterialPipe in project GregTech by GregTechCEu.
the class CommandRecipeCheck method prettyPrintItemStack.
public String prettyPrintItemStack(ItemStack stack) {
if (stack.getItem() instanceof MetaItem) {
MetaItem<?> metaItem = (MetaItem<?>) stack.getItem();
MetaValueItem metaValueItem = metaItem.getItem(stack);
if (metaValueItem == null) {
if (metaItem instanceof MetaPrefixItem) {
Material material = ((MetaPrefixItem) metaItem).getMaterial(stack);
OrePrefix orePrefix = ((MetaPrefixItem) metaItem).getOrePrefix();
return "(MetaItem) OrePrefix: " + orePrefix.name + ", Material: " + material + " * " + stack.getCount();
}
} else {
if (MetaItems.INTEGRATED_CIRCUIT.isItemEqual(stack)) {
return "Config circuit #" + IntCircuitIngredient.getCircuitConfiguration(stack);
}
return "(MetaItem) " + metaValueItem.unlocalizedName + " * " + stack.getCount();
}
} else if (stack.getItem() instanceof MachineItemBlock) {
MetaTileEntity mte = MachineItemBlock.getMetaTileEntity(stack);
if (mte != null) {
String id = mte.metaTileEntityId.toString();
if (mte.metaTileEntityId.getNamespace().equals("gregtech"))
id = mte.metaTileEntityId.getPath();
return "(MetaTileEntity) " + id + " * " + stack.getCount();
}
} else {
Block block = Block.getBlockFromItem(stack.getItem());
String id = null;
if (block instanceof BlockCompressed) {
id = "block" + ((BlockCompressed) block).getGtMaterial(stack.getMetadata()).toCamelCaseString();
} else if (block instanceof BlockFrame) {
id = "frame" + ((BlockFrame) block).getGtMaterial(stack.getMetadata()).toCamelCaseString();
} else if (block instanceof BlockMaterialPipe) {
id = ((BlockMaterialPipe<?, ?, ?>) block).getPrefix().name + ((BlockMaterialPipe<?, ?, ?>) block).getItemMaterial(stack).toCamelCaseString();
}
if (id != null) {
return "(MetaBlock) " + id + " * " + stack.getCount();
}
}
// noinspection ConstantConditions
return stack.getItem().getRegistryName().toString() + " * " + stack.getCount() + " (Meta " + stack.getItemDamage() + ")";
}
use of gregtech.api.pipenet.block.material.BlockMaterialPipe in project GregTech by GregTechCEu.
the class PipeRenderer method renderItem.
@Override
public void renderItem(ItemStack rawItemStack, TransformType transformType) {
ItemStack stack = ModCompatibility.getRealItemStack(rawItemStack);
if (!(stack.getItem() instanceof ItemBlockPipe)) {
return;
}
CCRenderState renderState = CCRenderState.instance();
GlStateManager.enableBlend();
renderState.reset();
renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
BlockPipe<?, ?, ?> blockFluidPipe = (BlockPipe<?, ?, ?>) ((ItemBlockPipe<?, ?>) stack.getItem()).getBlock();
IPipeType<?> pipeType = blockFluidPipe.getItemPipeType(stack);
Material material = blockFluidPipe instanceof BlockMaterialPipe ? ((BlockMaterialPipe<?, ?, ?>) blockFluidPipe).getItemMaterial(stack) : null;
if (pipeType != null) {
// 12 == 0b1100 is North and South connection (index 2 & 3)
PipeRenderContext renderContext = new PipeRenderContext(12, 0, pipeType.getThickness());
renderContext.color = GTUtility.convertRGBtoOpaqueRGBA_CL(getPipeColor(material, -1));
buildRenderer(renderContext, blockFluidPipe, null, pipeType, material);
renderPipeBlock(renderState, renderContext);
}
renderState.draw();
GlStateManager.disableBlend();
}
use of gregtech.api.pipenet.block.material.BlockMaterialPipe 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());
}
}
use of gregtech.api.pipenet.block.material.BlockMaterialPipe in project GregTech by GregTechCEu.
the class ItemBlockFluidPipe method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(@Nonnull ItemStack stack, @Nullable World worldIn, List<String> tooltip, @Nonnull ITooltipFlag flagIn) {
FluidPipeProperties pipeProperties = blockPipe.createItemProperties(stack);
tooltip.add(I18n.format("gregtech.fluid_pipe.throughput", pipeProperties.getThroughput() * 20));
tooltip.add(I18n.format("gregtech.fluid_pipe.max_temperature", pipeProperties.getMaxFluidTemperature()));
if (!pipeProperties.isGasProof())
tooltip.add(I18n.format("gregtech.fluid_pipe.non_gas_proof"));
if (pipeProperties.getTanks() > 1)
tooltip.add(I18n.format("gregtech.fluid_pipe.channels", pipeProperties.getTanks()));
if (flagIn.isAdvanced()) {
tooltip.add("MetaItem Id: " + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getPrefix().name + ((BlockMaterialPipe<?, ?, ?>) blockPipe).getItemMaterial(stack).toCamelCaseString());
}
}
Aggregations