Search in sources :

Example 1 with FluidPipeProperties

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

the class CommonProxy method registerBlocks.

@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    GTLog.logger.info("Registering Blocks...");
    IForgeRegistry<Block> registry = event.getRegistry();
    registry.register(MACHINE);
    StoneType.init();
    for (Material material : GregTechAPI.MATERIAL_REGISTRY) {
        if (material.hasProperty(PropertyKey.ORE)) {
            createOreBlock(material);
        }
        if (material.hasProperty(PropertyKey.WIRE)) {
            for (BlockCable cable : CABLES) {
                if (!cable.getItemPipeType(null).isCable() || !material.getProperty(PropertyKey.WIRE).isSuperconductor())
                    cable.addCableMaterial(material, material.getProperty(PropertyKey.WIRE));
            }
        }
        if (material.hasProperty(PropertyKey.FLUID_PIPE)) {
            for (BlockFluidPipe pipe : FLUID_PIPES) {
                if (!pipe.getItemPipeType(pipe.getItem(material)).getOrePrefix().isIgnored(material)) {
                    pipe.addPipeMaterial(material, material.getProperty(PropertyKey.FLUID_PIPE));
                }
            }
        }
        if (material.hasProperty(PropertyKey.ITEM_PIPE)) {
            for (BlockItemPipe pipe : ITEM_PIPES) {
                if (!pipe.getItemPipeType(pipe.getItem(material)).getOrePrefix().isIgnored(material)) {
                    pipe.addPipeMaterial(material, material.getProperty(PropertyKey.ITEM_PIPE));
                }
            }
        }
    }
    for (BlockFluidPipe pipe : FLUID_PIPES) {
        if (!pipe.getItemPipeType(pipe.getItem(Materials.Wood)).getOrePrefix().isIgnored(Materials.Wood) || !pipe.getItemPipeType(pipe.getItem(Materials.TreatedWood)).getOrePrefix().isIgnored(Materials.TreatedWood)) {
            pipe.addPipeMaterial(Materials.Wood, new FluidPipeProperties(310, 5, false));
            pipe.addPipeMaterial(Materials.TreatedWood, new FluidPipeProperties(310, 8, false));
        }
    }
    for (BlockCable cable : CABLES) registry.register(cable);
    for (BlockFluidPipe pipe : FLUID_PIPES) registry.register(pipe);
    for (BlockItemPipe pipe : ITEM_PIPES) registry.register(pipe);
    registry.register(HERMETIC_CASING);
    registry.register(FOAM);
    registry.register(REINFORCED_FOAM);
    registry.register(PETRIFIED_FOAM);
    registry.register(REINFORCED_PETRIFIED_FOAM);
    registry.register(BOILER_CASING);
    registry.register(BOILER_FIREBOX_CASING);
    registry.register(METAL_CASING);
    registry.register(TURBINE_CASING);
    registry.register(MACHINE_CASING);
    registry.register(STEAM_CASING);
    registry.register(MULTIBLOCK_CASING);
    registry.register(TRANSPARENT_CASING);
    registry.register(WIRE_COIL);
    registry.register(FUSION_CASING);
    registry.register(WARNING_SIGN);
    registry.register(ASPHALT);
    registry.register(STONE_SMOOTH);
    registry.register(STONE_COBBLE);
    registry.register(STONE_COBBLE_MOSSY);
    registry.register(STONE_POLISHED);
    registry.register(STONE_BRICKS);
    registry.register(STONE_BRICKS_CRACKED);
    registry.register(STONE_BRICKS_MOSSY);
    registry.register(STONE_CHISELED);
    registry.register(STONE_TILED);
    registry.register(STONE_TILED_SMALL);
    registry.register(STONE_BRICKS_SMALL);
    registry.register(STONE_WINDMILL_A);
    registry.register(STONE_WINDMILL_B);
    registry.register(STONE_BRICKS_SQUARE);
    registry.register(RUBBER_LOG);
    registry.register(RUBBER_LEAVES);
    registry.register(RUBBER_SAPLING);
    registry.register(PLANKS);
    COMPRESSED.values().stream().distinct().forEach(registry::register);
    FRAMES.values().stream().distinct().forEach(registry::register);
    SURFACE_ROCK.values().stream().distinct().forEach(registry::register);
    ORES.forEach(registry::register);
}
Also used : BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) ItemBlockItemPipe(gregtech.common.pipelike.itempipe.ItemBlockItemPipe) FluidPipeProperties(gregtech.api.unification.material.properties.FluidPipeProperties) Block(net.minecraft.block.Block) MachineItemBlock(gregtech.api.block.machines.MachineItemBlock) ItemBlock(net.minecraft.item.ItemBlock) Material(gregtech.api.unification.material.Material) ItemBlockFluidPipe(gregtech.common.pipelike.fluidpipe.ItemBlockFluidPipe) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) ItemBlockCable(gregtech.common.pipelike.cable.ItemBlockCable) BlockCable(gregtech.common.pipelike.cable.BlockCable) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with FluidPipeProperties

use of gregtech.api.unification.material.properties.FluidPipeProperties 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());
    }
}
Also used : BlockMaterialPipe(gregtech.api.pipenet.block.material.BlockMaterialPipe) ItemBlockMaterialPipe(gregtech.api.pipenet.block.material.ItemBlockMaterialPipe) FluidPipeProperties(gregtech.api.unification.material.properties.FluidPipeProperties) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

FluidPipeProperties (gregtech.api.unification.material.properties.FluidPipeProperties)2 MachineItemBlock (gregtech.api.block.machines.MachineItemBlock)1 BlockMaterialPipe (gregtech.api.pipenet.block.material.BlockMaterialPipe)1 ItemBlockMaterialPipe (gregtech.api.pipenet.block.material.ItemBlockMaterialPipe)1 Material (gregtech.api.unification.material.Material)1 BlockCable (gregtech.common.pipelike.cable.BlockCable)1 ItemBlockCable (gregtech.common.pipelike.cable.ItemBlockCable)1 BlockFluidPipe (gregtech.common.pipelike.fluidpipe.BlockFluidPipe)1 ItemBlockFluidPipe (gregtech.common.pipelike.fluidpipe.ItemBlockFluidPipe)1 BlockItemPipe (gregtech.common.pipelike.itempipe.BlockItemPipe)1 ItemBlockItemPipe (gregtech.common.pipelike.itempipe.ItemBlockItemPipe)1 Block (net.minecraft.block.Block)1 ItemBlock (net.minecraft.item.ItemBlock)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1