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);
}
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);
}
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);
}
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);
}
}
}
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);
}
Aggregations