Search in sources :

Example 1 with BlockItemPipe

use of gregtech.common.pipelike.itempipe.BlockItemPipe 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 BlockItemPipe

use of gregtech.common.pipelike.itempipe.BlockItemPipe in project GregTech by GregTechCEu.

the class MetaBlocks method init.

public static void init() {
    GregTechAPI.MACHINE = MACHINE = new BlockMachine();
    MACHINE.setRegistryName("machine");
    for (Insulation ins : Insulation.values()) {
        CABLES[ins.ordinal()] = new BlockCable(ins);
        CABLES[ins.ordinal()].setRegistryName(ins.getName());
    }
    for (FluidPipeType type : FluidPipeType.values()) {
        FLUID_PIPES[type.ordinal()] = new BlockFluidPipe(type);
        FLUID_PIPES[type.ordinal()].setRegistryName(String.format("fluid_pipe_%s", type.name));
    }
    for (ItemPipeType type : ItemPipeType.values()) {
        ITEM_PIPES[type.ordinal()] = new BlockItemPipe(type);
        ITEM_PIPES[type.ordinal()].setRegistryName(String.format("item_pipe_%s", type.name));
    }
    BOILER_CASING = new BlockBoilerCasing();
    BOILER_CASING.setRegistryName("boiler_casing");
    BOILER_FIREBOX_CASING = new BlockFireboxCasing();
    BOILER_FIREBOX_CASING.setRegistryName("boiler_firebox_casing");
    METAL_CASING = new BlockMetalCasing();
    METAL_CASING.setRegistryName("metal_casing");
    TURBINE_CASING = new BlockTurbineCasing();
    TURBINE_CASING.setRegistryName("turbine_casing");
    MACHINE_CASING = new BlockMachineCasing();
    MACHINE_CASING.setRegistryName("machine_casing");
    STEAM_CASING = new BlockSteamCasing();
    STEAM_CASING.setRegistryName("steam_casing");
    MULTIBLOCK_CASING = new BlockMultiblockCasing();
    MULTIBLOCK_CASING.setRegistryName("multiblock_casing");
    TRANSPARENT_CASING = new BlockGlassCasing();
    TRANSPARENT_CASING.setRegistryName("transparent_casing");
    WIRE_COIL = new BlockWireCoil();
    WIRE_COIL.setRegistryName("wire_coil");
    FUSION_CASING = new BlockFusionCasing();
    FUSION_CASING.setRegistryName("fusion_casing");
    WARNING_SIGN = new BlockWarningSign();
    WARNING_SIGN.setRegistryName("warning_sign");
    HERMETIC_CASING = new BlockHermeticCasing();
    HERMETIC_CASING.setRegistryName("hermetic_casing");
    ASPHALT = new BlockAsphalt();
    ASPHALT.setRegistryName("asphalt");
    STONE_SMOOTH = new BlockStoneSmooth();
    STONE_SMOOTH.setRegistryName("stone_smooth");
    STONE_COBBLE = new BlockStoneCobble();
    STONE_COBBLE.setRegistryName("stone_cobble");
    STONE_COBBLE_MOSSY = new BlockStoneCobbleMossy();
    STONE_COBBLE_MOSSY.setRegistryName("stone_cobble_mossy");
    STONE_POLISHED = new BlockStonePolished();
    STONE_POLISHED.setRegistryName("stone_polished");
    STONE_BRICKS = new BlockStoneBricks();
    STONE_BRICKS.setRegistryName("stone_bricks");
    STONE_BRICKS_CRACKED = new BlockStoneBricksCracked();
    STONE_BRICKS_CRACKED.setRegistryName("stone_bricks_cracked");
    STONE_BRICKS_MOSSY = new BlockStoneBricksMossy();
    STONE_BRICKS_MOSSY.setRegistryName("stone_bricks_mossy");
    STONE_CHISELED = new BlockStoneChiseled();
    STONE_CHISELED.setRegistryName("stone_chiseled");
    STONE_TILED = new BlockStoneTiled();
    STONE_TILED.setRegistryName("stone_tiled");
    STONE_TILED_SMALL = new BlockStoneTiledSmall();
    STONE_TILED_SMALL.setRegistryName("stone_tiled_small");
    STONE_BRICKS_SMALL = new BlockStoneBricksSmall();
    STONE_BRICKS_SMALL.setRegistryName("stone_bricks_small");
    STONE_WINDMILL_A = new BlockStoneWindmillA();
    STONE_WINDMILL_A.setRegistryName("stone_windmill_a");
    STONE_WINDMILL_B = new BlockStoneWindmillB();
    STONE_WINDMILL_B.setRegistryName("stone_windmill_b");
    STONE_BRICKS_SQUARE = new BlockStoneBricksSquare();
    STONE_BRICKS_SQUARE.setRegistryName("stone_bricks_square");
    FOAM = new BlockFoam(false);
    FOAM.setRegistryName("foam");
    REINFORCED_FOAM = new BlockFoam(true);
    REINFORCED_FOAM.setRegistryName("reinforced_foam");
    PETRIFIED_FOAM = new BlockPetrifiedFoam(false);
    PETRIFIED_FOAM.setRegistryName("petrified_foam");
    REINFORCED_PETRIFIED_FOAM = new BlockPetrifiedFoam(true);
    REINFORCED_PETRIFIED_FOAM.setRegistryName("reinforced_petrified_foam");
    RUBBER_LOG = new BlockRubberLog();
    RUBBER_LOG.setRegistryName("rubber_log");
    RUBBER_LEAVES = new BlockRubberLeaves();
    RUBBER_LEAVES.setRegistryName("rubber_leaves");
    RUBBER_SAPLING = new BlockRubberSapling();
    RUBBER_SAPLING.setRegistryName("rubber_sapling");
    PLANKS = new BlockGregPlanks();
    PLANKS.setRegistryName("planks");
    createGeneratedBlock(m -> m.hasProperty(PropertyKey.DUST) && m.hasFlag(GENERATE_FRAME), MetaBlocks::createFrameBlock);
    createGeneratedBlock(m -> m.hasProperty(PropertyKey.ORE) && m.hasProperty(PropertyKey.DUST), MetaBlocks::createSurfaceRockBlock);
    createGeneratedBlock(material -> (material.hasProperty(PropertyKey.INGOT) || material.hasProperty(PropertyKey.GEM) || material.hasFlag(FORCE_GENERATE_BLOCK)) && !OrePrefix.block.isIgnored(material), MetaBlocks::createCompressedBlock);
    registerTileEntity();
    // not sure if that's a good place for that, but i don't want to make a dedicated method for that
    // could possibly override block methods, but since these props don't depend on state why not just use nice and simple vanilla method
    Blocks.FIRE.setFireInfo(RUBBER_LOG, 5, 5);
    Blocks.FIRE.setFireInfo(RUBBER_LEAVES, 30, 60);
    Blocks.FIRE.setFireInfo(PLANKS, 5, 20);
}
Also used : BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) BlockMachine(gregtech.api.block.machines.BlockMachine) BlockPetrifiedFoam(gregtech.common.blocks.foam.BlockPetrifiedFoam) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) BlockRubberLog(gregtech.common.blocks.wood.BlockRubberLog) ItemPipeType(gregtech.common.pipelike.itempipe.ItemPipeType) FluidPipeType(gregtech.common.pipelike.fluidpipe.FluidPipeType) Insulation(gregtech.common.pipelike.cable.Insulation) BlockGregPlanks(gregtech.common.blocks.wood.BlockGregPlanks) BlockRubberSapling(gregtech.common.blocks.wood.BlockRubberSapling) BlockFoam(gregtech.common.blocks.foam.BlockFoam) BlockCable(gregtech.common.pipelike.cable.BlockCable) BlockRubberLeaves(gregtech.common.blocks.wood.BlockRubberLeaves)

Example 3 with BlockItemPipe

use of gregtech.common.pipelike.itempipe.BlockItemPipe in project GregTech by GregTechCEu.

the class MetaBlocks method registerItemModels.

@SideOnly(Side.CLIENT)
public static void registerItemModels() {
    ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MACHINE), stack -> MetaTileEntityRenderer.MODEL_LOCATION);
    for (BlockCable cable : CABLES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(cable), stack -> CableRenderer.INSTANCE.getModelLocation());
    for (BlockFluidPipe pipe : FLUID_PIPES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(pipe), stack -> FluidPipeRenderer.INSTANCE.getModelLocation());
    for (BlockItemPipe pipe : ITEM_PIPES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(pipe), stack -> ItemPipeRenderer.INSTANCE.getModelLocation());
    registerItemModel(BOILER_CASING);
    registerItemModel(BOILER_FIREBOX_CASING);
    registerItemModel(METAL_CASING);
    registerItemModel(TURBINE_CASING);
    registerItemModel(MACHINE_CASING);
    registerItemModel(STEAM_CASING);
    registerItemModel(MULTIBLOCK_CASING);
    registerItemModel(TRANSPARENT_CASING);
    registerItemModel(WIRE_COIL);
    registerItemModel(FUSION_CASING);
    registerItemModel(WARNING_SIGN);
    registerItemModel(HERMETIC_CASING);
    registerItemModel(ASPHALT);
    registerItemModel(STONE_SMOOTH);
    registerItemModel(STONE_COBBLE);
    registerItemModel(STONE_COBBLE_MOSSY);
    registerItemModel(STONE_POLISHED);
    registerItemModel(STONE_BRICKS);
    registerItemModel(STONE_BRICKS_CRACKED);
    registerItemModel(STONE_BRICKS_MOSSY);
    registerItemModel(STONE_CHISELED);
    registerItemModel(STONE_TILED);
    registerItemModel(STONE_TILED_SMALL);
    registerItemModel(STONE_BRICKS_SMALL);
    registerItemModel(STONE_WINDMILL_A);
    registerItemModel(STONE_WINDMILL_B);
    registerItemModel(STONE_BRICKS_SQUARE);
    registerItemModelWithOverride(RUBBER_LOG, ImmutableMap.of(BlockRubberLog.LOG_AXIS, EnumAxis.Y));
    registerItemModel(RUBBER_LEAVES);
    registerItemModel(RUBBER_SAPLING);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RUBBER_SAPLING), 0, new ModelResourceLocation(RUBBER_SAPLING.getRegistryName(), "inventory"));
    registerItemModel(PLANKS);
    COMPRESSED.values().stream().distinct().forEach(IModelSupplier::onModelRegister);
    FRAMES.values().stream().distinct().forEach(IModelSupplier::onModelRegister);
    ORES.forEach(IModelSupplier::onModelRegister);
}
Also used : BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) ItemPipeRenderer(gregtech.client.renderer.pipe.ItemPipeRenderer) Item(net.minecraft.item.Item) Materials(gregtech.api.unification.material.Materials) StoneType(gregtech.api.unification.ore.StoneType) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) TileEntityFluidPipe(gregtech.common.pipelike.fluidpipe.tile.TileEntityFluidPipe) IProperty(net.minecraft.block.properties.IProperty) Block(net.minecraft.block.Block) Side(net.minecraftforge.fml.relauncher.Side) ClientProxy(gregtech.client.ClientProxy) SimpleStateMapper(gregtech.client.model.SimpleStateMapper) IModelSupplier(gregtech.client.model.IModelSupplier) FluidPipeRenderer(gregtech.client.renderer.pipe.FluidPipeRenderer) GENERATE_FRAME(gregtech.api.unification.material.info.MaterialFlags.GENERATE_FRAME) Insulation(gregtech.common.pipelike.cable.Insulation) BlockFluidBase(net.minecraftforge.fluids.BlockFluidBase) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) PropertyKey(gregtech.api.unification.material.properties.PropertyKey) Collectors(java.util.stream.Collectors) BlockRubberLeaves(gregtech.common.blocks.wood.BlockRubberLeaves) CableRenderer(gregtech.client.renderer.pipe.CableRenderer) Entry(java.util.Map.Entry) OreDictUnifier(gregtech.api.unification.OreDictUnifier) TileEntityItemPipe(gregtech.common.pipelike.itempipe.tile.TileEntityItemPipe) java.util(java.util) BlockGregPlanks(gregtech.common.blocks.wood.BlockGregPlanks) Blocks(net.minecraft.init.Blocks) BakedModelHandler(gregtech.client.model.modelfactories.BakedModelHandler) MetaTileEntityRenderer(gregtech.client.renderer.handler.MetaTileEntityRenderer) FluidPipeType(gregtech.common.pipelike.fluidpipe.FluidPipeType) BlockRubberLog(gregtech.common.blocks.wood.BlockRubberLog) GameRegistry(net.minecraftforge.fml.common.registry.GameRegistry) BlockRubberSapling(gregtech.common.blocks.wood.BlockRubberSapling) ClientRegistry(net.minecraftforge.fml.client.registry.ClientRegistry) TileEntityCable(gregtech.common.pipelike.cable.tile.TileEntityCable) ItemStack(net.minecraft.item.ItemStack) GregTechAPI(gregtech.api.GregTechAPI) Minecraft(net.minecraft.client.Minecraft) MetaTileEntityTESR(gregtech.client.renderer.handler.MetaTileEntityTESR) ReferenceArrayList(it.unimi.dsi.fastutil.objects.ReferenceArrayList) TileEntityCableTickable(gregtech.common.pipelike.cable.tile.TileEntityCableTickable) BiConsumer(java.util.function.BiConsumer) Material(gregtech.api.unification.material.Material) OrePrefix(gregtech.api.unification.ore.OrePrefix) BlockCable(gregtech.common.pipelike.cable.BlockCable) ModelLoader(net.minecraftforge.client.model.ModelLoader) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) MetaTileEntityHolder(gregtech.api.metatileentity.MetaTileEntityHolder) TileEntityFluidPipeTickable(gregtech.common.pipelike.fluidpipe.tile.TileEntityFluidPipeTickable) FORCE_GENERATE_BLOCK(gregtech.api.unification.material.info.MaterialFlags.FORCE_GENERATE_BLOCK) Items(net.minecraft.init.Items) ItemPipeType(gregtech.common.pipelike.itempipe.ItemPipeType) BlockFoam(gregtech.common.blocks.foam.BlockFoam) IStateMapper(net.minecraft.client.renderer.block.statemap.IStateMapper) BlockPetrifiedFoam(gregtech.common.blocks.foam.BlockPetrifiedFoam) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) IBlockState(net.minecraft.block.state.IBlockState) MinecraftForge(net.minecraftforge.common.MinecraftForge) GTValues(gregtech.api.GTValues) StateMapperBase(net.minecraft.client.renderer.block.statemap.StateMapperBase) ResourceLocation(net.minecraft.util.ResourceLocation) EnumAxis(net.minecraft.block.BlockLog.EnumAxis) TileEntityItemPipeTickable(gregtech.common.pipelike.itempipe.tile.TileEntityItemPipeTickable) BlockMachine(gregtech.api.block.machines.BlockMachine) BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) BlockCable(gregtech.common.pipelike.cable.BlockCable) IModelSupplier(gregtech.client.model.IModelSupplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 4 with BlockItemPipe

use of gregtech.common.pipelike.itempipe.BlockItemPipe in project GregTech by GregTechCEu.

the class MetaBlocks method registerOreDict.

public static void registerOreDict() {
    OreDictUnifier.registerOre(new ItemStack(RUBBER_LOG, 1, GTValues.W), OrePrefix.log, Materials.Wood);
    OreDictUnifier.registerOre(new ItemStack(RUBBER_LEAVES, 1, GTValues.W), "treeLeaves");
    OreDictUnifier.registerOre(new ItemStack(RUBBER_SAPLING, 1, GTValues.W), "treeSapling");
    OreDictUnifier.registerOre(PLANKS.getItemVariant(BlockGregPlanks.BlockType.RUBBER_PLANK), OrePrefix.plank, Materials.Wood);
    OreDictUnifier.registerOre(PLANKS.getItemVariant(BlockGregPlanks.BlockType.TREATED_PLANK), OrePrefix.plank, Materials.TreatedWood);
    GameRegistry.addSmelting(RUBBER_LOG, new ItemStack(Items.COAL, 1, 1), 0.15F);
    for (Entry<Material, BlockCompressed> entry : COMPRESSED.entrySet()) {
        Material material = entry.getKey();
        BlockCompressed block = entry.getValue();
        ItemStack itemStack = block.getItem(material);
        OreDictUnifier.registerOre(itemStack, OrePrefix.block, material);
    }
    for (Entry<Material, BlockFrame> entry : FRAMES.entrySet()) {
        Material material = entry.getKey();
        BlockFrame block = entry.getValue();
        ItemStack itemStack = block.getItem(material);
        OreDictUnifier.registerOre(itemStack, OrePrefix.frameGt, material);
    }
    for (BlockOre blockOre : ORES) {
        Material material = blockOre.material;
        for (StoneType stoneType : blockOre.STONE_TYPE.getAllowedValues()) {
            if (stoneType == null)
                continue;
            ItemStack normalStack = blockOre.getItem(blockOre.getDefaultState().withProperty(blockOre.STONE_TYPE, stoneType));
            OreDictUnifier.registerOre(normalStack, stoneType.processingPrefix, material);
        }
    }
    for (BlockCable cable : CABLES) {
        for (Material pipeMaterial : cable.getEnabledMaterials()) {
            ItemStack itemStack = cable.getItem(pipeMaterial);
            OreDictUnifier.registerOre(itemStack, cable.getPrefix(), pipeMaterial);
        }
    }
    for (BlockFluidPipe pipe : FLUID_PIPES) {
        for (Material pipeMaterial : pipe.getEnabledMaterials()) {
            ItemStack itemStack = pipe.getItem(pipeMaterial);
            OreDictUnifier.registerOre(itemStack, pipe.getPrefix(), pipeMaterial);
        }
    }
    for (BlockItemPipe pipe : ITEM_PIPES) {
        for (Material pipeMaterial : pipe.getEnabledMaterials()) {
            ItemStack itemStack = pipe.getItem(pipeMaterial);
            OreDictUnifier.registerOre(itemStack, pipe.getPrefix(), pipeMaterial);
        }
    }
}
Also used : BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) StoneType(gregtech.api.unification.ore.StoneType) Material(gregtech.api.unification.material.Material) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) ItemStack(net.minecraft.item.ItemStack) BlockCable(gregtech.common.pipelike.cable.BlockCable)

Example 5 with BlockItemPipe

use of gregtech.common.pipelike.itempipe.BlockItemPipe in project GregTech by GregTechCEu.

the class CommonProxy method registerItems.

@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
    GTLog.logger.info("Registering Items...");
    IForgeRegistry<Item> registry = event.getRegistry();
    for (MetaItem<?> item : MetaItems.ITEMS) {
        registry.register(item);
        item.registerSubItems();
    }
    GTRecipeManager.preLoad();
    registry.register(createItemBlock(MACHINE, MachineItemBlock::new));
    for (BlockCable cable : CABLES) registry.register(createItemBlock(cable, ItemBlockCable::new));
    for (BlockFluidPipe pipe : FLUID_PIPES) registry.register(createItemBlock(pipe, ItemBlockFluidPipe::new));
    for (BlockItemPipe pipe : ITEM_PIPES) registry.register(createItemBlock(pipe, ItemBlockItemPipe::new));
    registry.register(createItemBlock(HERMETIC_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(BOILER_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(BOILER_FIREBOX_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(METAL_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(TURBINE_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(MACHINE_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(STEAM_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(MULTIBLOCK_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(TRANSPARENT_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(WIRE_COIL, VariantItemBlock::new));
    registry.register(createItemBlock(FUSION_CASING, VariantItemBlock::new));
    registry.register(createItemBlock(WARNING_SIGN, VariantItemBlock::new));
    registry.register(createItemBlock(ASPHALT, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_SMOOTH, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_COBBLE, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_COBBLE_MOSSY, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_POLISHED, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_BRICKS, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_BRICKS_CRACKED, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_BRICKS_MOSSY, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_CHISELED, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_TILED, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_TILED_SMALL, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_BRICKS_SMALL, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_WINDMILL_A, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_WINDMILL_B, VariantItemBlock::new));
    registry.register(createItemBlock(STONE_BRICKS_SQUARE, VariantItemBlock::new));
    registry.register(createItemBlock(PLANKS, VariantItemBlock::new));
    registry.register(createItemBlock(RUBBER_LOG, ItemBlock::new));
    registry.register(createItemBlock(RUBBER_LEAVES, ItemBlock::new));
    registry.register(createItemBlock(RUBBER_SAPLING, ItemBlock::new));
    COMPRESSED.values().stream().distinct().map(block -> createItemBlock(block, CompressedItemBlock::new)).forEach(registry::register);
    FRAMES.values().stream().distinct().map(block -> createItemBlock(block, FrameItemBlock::new)).forEach(registry::register);
    ORES.stream().map(block -> createItemBlock(block, OreItemBlock::new)).forEach(registry::register);
}
Also used : ModHandler(gregtech.api.recipes.ModHandler) Arrays(java.util.Arrays) BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) Loader(net.minecraftforge.fml.common.Loader) MetaItemBracketHandler(gregtech.api.recipes.crafttweaker.MetaItemBracketHandler) Item(net.minecraft.item.Item) ConfigChangedEvent(net.minecraftforge.fml.client.event.ConfigChangedEvent) FurnaceFuelBurnTimeEvent(net.minecraftforge.event.furnace.FurnaceFuelBurnTimeEvent) Materials(gregtech.api.unification.material.Materials) StoneType(gregtech.api.unification.ore.StoneType) TemperatureProperty(gregtech.api.recipes.recipeproperties.TemperatureProperty) Block(net.minecraft.block.Block) CriteriaTriggers(net.minecraft.advancements.CriteriaTriggers) ObfuscationReflectionHelper(net.minecraftforge.fml.common.ObfuscationReflectionHelper) Side(net.minecraftforge.fml.relauncher.Side) MetaItem(gregtech.api.items.metaitem.MetaItem) ItemBlockItemPipe(gregtech.common.pipelike.itempipe.ItemBlockItemPipe) DustProperty(gregtech.api.unification.material.properties.DustProperty) RegistryEvent(net.minecraftforge.event.RegistryEvent) Method(java.lang.reflect.Method) ItemBlockFluidPipe(gregtech.common.pipelike.fluidpipe.ItemBlockFluidPipe) EnchantmentEnderDamage(gregtech.api.enchants.EnchantmentEnderDamage) PropertyKey(gregtech.api.unification.material.properties.PropertyKey) IForgeRegistry(net.minecraftforge.registries.IForgeRegistry) EnchantmentHardHammer(gregtech.api.enchants.EnchantmentHardHammer) FMLLoadCompleteEvent(net.minecraftforge.fml.common.event.FMLLoadCompleteEvent) InvocationTargetException(java.lang.reflect.InvocationTargetException) EventPriority(net.minecraftforge.fml.common.eventhandler.EventPriority) GTTriggers(gregtech.common.advancement.GTTriggers) GTJeiPlugin(gregtech.integration.jei.GTJeiPlugin) Enchantment(net.minecraft.enchantment.Enchantment) ItemBlockCable(gregtech.common.pipelike.cable.ItemBlockCable) gregtech.common.blocks(gregtech.common.blocks) MetaBlocks(gregtech.common.blocks.MetaBlocks) FluidPipeProperties(gregtech.api.unification.material.properties.FluidPipeProperties) MetaItems(gregtech.common.items.MetaItems) ArrayUtils(org.apache.commons.lang3.ArrayUtils) HashMap(java.util.HashMap) Function(java.util.function.Function) TerminalRegistry(gregtech.api.terminal.TerminalRegistry) Type(net.minecraftforge.common.config.Config.Type) ItemStack(net.minecraft.item.ItemStack) GTRecipeManager(gregtech.loaders.recipe.GTRecipeManager) GregTechAPI(gregtech.api.GregTechAPI) MaterialInfoLoader(gregtech.loaders.MaterialInfoLoader) Material(gregtech.api.unification.material.Material) Mod(net.minecraftforge.fml.common.Mod) OrePrefix(gregtech.api.unification.ore.OrePrefix) BlockCable(gregtech.common.pipelike.cable.BlockCable) MachineItemBlock(gregtech.api.block.machines.MachineItemBlock) GTTrigger(gregtech.api.util.advancement.GTTrigger) IRecipe(net.minecraft.item.crafting.IRecipe) GTLog(gregtech.api.util.GTLog) CraftingComponent(gregtech.loaders.recipe.CraftingComponent) FusionEUToStartProperty(gregtech.api.recipes.recipeproperties.FusionEUToStartProperty) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) MinecraftForge(net.minecraftforge.common.MinecraftForge) GTValues(gregtech.api.GTValues) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) ItemBlock(net.minecraft.item.ItemBlock) ICriterionTrigger(net.minecraft.advancements.ICriterionTrigger) ConfigManager(net.minecraftforge.common.config.ConfigManager) OreDictionaryLoader(gregtech.loaders.OreDictionaryLoader) ItemBlockCable(gregtech.common.pipelike.cable.ItemBlockCable) BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) ItemBlockItemPipe(gregtech.common.pipelike.itempipe.ItemBlockItemPipe) ItemBlockFluidPipe(gregtech.common.pipelike.fluidpipe.ItemBlockFluidPipe) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) ItemBlockItemPipe(gregtech.common.pipelike.itempipe.ItemBlockItemPipe) Item(net.minecraft.item.Item) MetaItem(gregtech.api.items.metaitem.MetaItem) ItemBlockFluidPipe(gregtech.common.pipelike.fluidpipe.ItemBlockFluidPipe) ItemBlockCable(gregtech.common.pipelike.cable.ItemBlockCable) BlockCable(gregtech.common.pipelike.cable.BlockCable) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

BlockCable (gregtech.common.pipelike.cable.BlockCable)6 BlockFluidPipe (gregtech.common.pipelike.fluidpipe.BlockFluidPipe)6 BlockItemPipe (gregtech.common.pipelike.itempipe.BlockItemPipe)6 Material (gregtech.api.unification.material.Material)4 StoneType (gregtech.api.unification.ore.StoneType)3 GTValues (gregtech.api.GTValues)2 GregTechAPI (gregtech.api.GregTechAPI)2 BlockMachine (gregtech.api.block.machines.BlockMachine)2 MachineItemBlock (gregtech.api.block.machines.MachineItemBlock)2 Materials (gregtech.api.unification.material.Materials)2 FluidPipeProperties (gregtech.api.unification.material.properties.FluidPipeProperties)2 PropertyKey (gregtech.api.unification.material.properties.PropertyKey)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 SimpleStateMapper (gregtech.client.model.SimpleStateMapper)2 BakedModelHandler (gregtech.client.model.modelfactories.BakedModelHandler)2 MetaTileEntityTESR (gregtech.client.renderer.handler.MetaTileEntityTESR)2 BlockFoam (gregtech.common.blocks.foam.BlockFoam)2 BlockPetrifiedFoam (gregtech.common.blocks.foam.BlockPetrifiedFoam)2 BlockGregPlanks (gregtech.common.blocks.wood.BlockGregPlanks)2 BlockRubberLeaves (gregtech.common.blocks.wood.BlockRubberLeaves)2