Search in sources :

Example 1 with Materials

use of gregtech.api.unification.material.Materials in project GregTech by GregTechCE.

the class OreDictionaryLoader method init.

public static void init() {
    GTLog.logger.info("Registering OreDict entries.");
    // Simulating oredict registration for vanilla items.
    // Because forge registers event handlers after registering oredicts for vanilla items
    Multimap<String, Object> oreDicts = LinkedListMultimap.create();
    // tree- and wood-related things
    oreDicts.put("logWood", new ItemStack(Blocks.LOG, 1, WILDCARD_VALUE));
    oreDicts.put("logWood", new ItemStack(Blocks.LOG2, 1, WILDCARD_VALUE));
    oreDicts.put("plankWood", new ItemStack(Blocks.PLANKS, 1, WILDCARD_VALUE));
    oreDicts.put("slabWood", new ItemStack(Blocks.WOODEN_SLAB, 1, WILDCARD_VALUE));
    oreDicts.put("stairWood", Blocks.OAK_STAIRS);
    oreDicts.put("stairWood", Blocks.SPRUCE_STAIRS);
    oreDicts.put("stairWood", Blocks.BIRCH_STAIRS);
    oreDicts.put("stairWood", Blocks.JUNGLE_STAIRS);
    oreDicts.put("stairWood", Blocks.ACACIA_STAIRS);
    oreDicts.put("stairWood", Blocks.DARK_OAK_STAIRS);
    oreDicts.put("stickWood", Items.STICK);
    oreDicts.put("treeSapling", new ItemStack(Blocks.SAPLING, 1, WILDCARD_VALUE));
    oreDicts.put("treeLeaves", new ItemStack(Blocks.LEAVES, 1, WILDCARD_VALUE));
    oreDicts.put("treeLeaves", new ItemStack(Blocks.LEAVES2, 1, WILDCARD_VALUE));
    oreDicts.put("vine", Blocks.VINE);
    // Ores
    oreDicts.put("oreGold", Blocks.GOLD_ORE);
    oreDicts.put("oreIron", Blocks.IRON_ORE);
    oreDicts.put("oreLapis", Blocks.LAPIS_ORE);
    oreDicts.put("oreDiamond", Blocks.DIAMOND_ORE);
    oreDicts.put("oreRedstone", Blocks.REDSTONE_ORE);
    oreDicts.put("oreEmerald", Blocks.EMERALD_ORE);
    oreDicts.put("oreQuartz", Blocks.QUARTZ_ORE);
    oreDicts.put("oreCoal", Blocks.COAL_ORE);
    // ingots/nuggets
    oreDicts.put("ingotIron", Items.IRON_INGOT);
    oreDicts.put("ingotGold", Items.GOLD_INGOT);
    oreDicts.put("ingotBrick", Items.BRICK);
    oreDicts.put("ingotBrickNether", Items.NETHERBRICK);
    oreDicts.put("nuggetGold", Items.GOLD_NUGGET);
    oreDicts.put("nuggetIron", Items.IRON_NUGGET);
    // gems and dusts
    oreDicts.put("gemDiamond", Items.DIAMOND);
    oreDicts.put("gemEmerald", Items.EMERALD);
    oreDicts.put("gemQuartz", Items.QUARTZ);
    oreDicts.put("gemPrismarine", Items.PRISMARINE_SHARD);
    oreDicts.put("dustPrismarine", Items.PRISMARINE_CRYSTALS);
    oreDicts.put("dustRedstone", Items.REDSTONE);
    oreDicts.put("dustGlowstone", Items.GLOWSTONE_DUST);
    oreDicts.put("gemLapis", new ItemStack(Items.DYE, 1, 4));
    // storage blocks
    oreDicts.put("blockGold", Blocks.GOLD_BLOCK);
    oreDicts.put("blockIron", Blocks.IRON_BLOCK);
    oreDicts.put("blockLapis", Blocks.LAPIS_BLOCK);
    oreDicts.put("blockDiamond", Blocks.DIAMOND_BLOCK);
    oreDicts.put("blockRedstone", Blocks.REDSTONE_BLOCK);
    oreDicts.put("blockEmerald", Blocks.EMERALD_BLOCK);
    oreDicts.put("blockQuartz", Blocks.QUARTZ_BLOCK);
    oreDicts.put("blockCoal", Blocks.COAL_BLOCK);
    // crops
    oreDicts.put("cropWheat", Items.WHEAT);
    oreDicts.put("cropPotato", Items.POTATO);
    oreDicts.put("cropCarrot", Items.CARROT);
    oreDicts.put("cropNetherWart", Items.NETHER_WART);
    oreDicts.put("sugarcane", Items.REEDS);
    oreDicts.put("blockCactus", Blocks.CACTUS);
    // misc materials
    oreDicts.put("dye", new ItemStack(Items.DYE, 1, WILDCARD_VALUE));
    oreDicts.put("paper", new ItemStack(Items.PAPER));
    // mob drops
    oreDicts.put("slimeball", Items.SLIME_BALL);
    oreDicts.put("enderpearl", Items.ENDER_PEARL);
    oreDicts.put("bone", Items.BONE);
    oreDicts.put("gunpowder", Items.GUNPOWDER);
    oreDicts.put("string", Items.STRING);
    oreDicts.put("netherStar", Items.NETHER_STAR);
    oreDicts.put("leather", Items.LEATHER);
    oreDicts.put("feather", Items.FEATHER);
    oreDicts.put("egg", Items.EGG);
    // records
    oreDicts.put("record", Items.RECORD_13);
    oreDicts.put("record", Items.RECORD_CAT);
    oreDicts.put("record", Items.RECORD_BLOCKS);
    oreDicts.put("record", Items.RECORD_CHIRP);
    oreDicts.put("record", Items.RECORD_FAR);
    oreDicts.put("record", Items.RECORD_MALL);
    oreDicts.put("record", Items.RECORD_MELLOHI);
    oreDicts.put("record", Items.RECORD_STAL);
    oreDicts.put("record", Items.RECORD_STRAD);
    oreDicts.put("record", Items.RECORD_WARD);
    oreDicts.put("record", Items.RECORD_11);
    oreDicts.put("record", Items.RECORD_WAIT);
    // blocks
    oreDicts.put("dirt", Blocks.DIRT);
    oreDicts.put("grass", Blocks.GRASS);
    oreDicts.put("stone", Blocks.STONE);
    oreDicts.put("cobblestone", Blocks.COBBLESTONE);
    oreDicts.put("gravel", Blocks.GRAVEL);
    oreDicts.put("sand", new ItemStack(Blocks.SAND, 1, WILDCARD_VALUE));
    oreDicts.put("sandstone", new ItemStack(Blocks.SANDSTONE, 1, WILDCARD_VALUE));
    oreDicts.put("sandstone", new ItemStack(Blocks.RED_SANDSTONE, 1, WILDCARD_VALUE));
    oreDicts.put("netherrack", Blocks.NETHERRACK);
    oreDicts.put("obsidian", Blocks.OBSIDIAN);
    oreDicts.put("glowstone", Blocks.GLOWSTONE);
    oreDicts.put("endstone", Blocks.END_STONE);
    oreDicts.put("torch", Blocks.TORCH);
    oreDicts.put("workbench", Blocks.CRAFTING_TABLE);
    oreDicts.put("blockSlime", Blocks.SLIME_BLOCK);
    oreDicts.put("blockPrismarine", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.ROUGH.getMetadata()));
    oreDicts.put("blockPrismarineBrick", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.BRICKS.getMetadata()));
    oreDicts.put("blockPrismarineDark", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.DARK.getMetadata()));
    oreDicts.put("stoneGranite", new ItemStack(Blocks.STONE, 1, 1));
    oreDicts.put("stoneGranitePolished", new ItemStack(Blocks.STONE, 1, 2));
    oreDicts.put("stoneDiorite", new ItemStack(Blocks.STONE, 1, 3));
    oreDicts.put("stoneDioritePolished", new ItemStack(Blocks.STONE, 1, 4));
    oreDicts.put("stoneAndesite", new ItemStack(Blocks.STONE, 1, 5));
    oreDicts.put("stoneAndesitePolished", new ItemStack(Blocks.STONE, 1, 6));
    oreDicts.put("blockGlassColorless", Blocks.GLASS);
    oreDicts.put("blockGlass", Blocks.GLASS);
    oreDicts.put("blockGlass", new ItemStack(Blocks.STAINED_GLASS, 1, WILDCARD_VALUE));
    // blockGlass{Color} is added below with dyes
    oreDicts.put("paneGlassColorless", Blocks.GLASS_PANE);
    oreDicts.put("paneGlass", Blocks.GLASS_PANE);
    oreDicts.put("paneGlass", new ItemStack(Blocks.STAINED_GLASS_PANE, 1, WILDCARD_VALUE));
    // paneGlass{Color} is added below with dyes
    // chests
    oreDicts.put("chest", Blocks.CHEST);
    oreDicts.put("chest", Blocks.ENDER_CHEST);
    oreDicts.put("chest", Blocks.TRAPPED_CHEST);
    oreDicts.put("chestWood", Blocks.CHEST);
    oreDicts.put("chestEnder", Blocks.ENDER_CHEST);
    oreDicts.put("chestTrapped", Blocks.TRAPPED_CHEST);
    // Register dyes
    String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" };
    for (int i = 0; i < 16; i++) {
        ItemStack dye = new ItemStack(Items.DYE, 1, i);
        ItemStack block = new ItemStack(Blocks.STAINED_GLASS, 1, 15 - i);
        ItemStack pane = new ItemStack(Blocks.STAINED_GLASS_PANE, 1, 15 - i);
        oreDicts.put("dye" + dyes[i], dye);
        oreDicts.put("blockGlass" + dyes[i], block);
        oreDicts.put("paneGlass" + dyes[i], pane);
    }
    Multimaps.asMap(oreDicts).forEach((ore, list) -> list.forEach(o -> {
        if (o instanceof ItemStack) {
            OreDictUnifier.onItemRegistration(new OreDictionary.OreRegisterEvent(ore, (ItemStack) o));
        } else if (o instanceof Item) {
            OreDictUnifier.onItemRegistration(new OreDictionary.OreRegisterEvent(ore, new ItemStack((Item) o)));
        } else if (o instanceof Block) {
            OreDictUnifier.onItemRegistration(new OreDictionary.OreRegisterEvent(ore, new ItemStack((Block) o)));
        }
    }));
    OreDictUnifier.registerOre(new ItemStack(Items.BUCKET, 1, 0), OrePrefix.bucket, MarkerMaterials.Empty);
    OreDictUnifier.registerOre(new ItemStack(Items.WATER_BUCKET, 1, 0), OrePrefix.bucket, Materials.Water);
    OreDictUnifier.registerOre(new ItemStack(Items.LAVA_BUCKET, 1, 0), OrePrefix.bucket, Materials.Lava);
    OreDictUnifier.registerOre(new ItemStack(Items.MILK_BUCKET, 1, 0), OrePrefix.bucket, Materials.Milk);
    OreDictUnifier.registerOre(new ItemStack(Items.GLASS_BOTTLE, 1, 0), OrePrefix.bottle, MarkerMaterials.Empty);
    OreDictUnifier.registerOre(new ItemStack(Items.POTIONITEM, 1, 0), OrePrefix.bottle, Materials.Water);
    OreDictUnifier.registerOre(new ItemStack(Blocks.COAL_ORE, 1), OrePrefix.ore, Materials.Coal);
    OreDictUnifier.registerOre(new ItemStack(Blocks.IRON_ORE, 1), OrePrefix.ore, Materials.Iron);
    OreDictUnifier.registerOre(new ItemStack(Blocks.LAPIS_ORE, 1), OrePrefix.ore, Materials.Lapis);
    OreDictUnifier.registerOre(new ItemStack(Blocks.REDSTONE_ORE, 1), OrePrefix.ore, Materials.Redstone);
    OreDictUnifier.registerOre(new ItemStack(Blocks.GOLD_ORE, 1), OrePrefix.ore, Materials.Gold);
    OreDictUnifier.registerOre(new ItemStack(Blocks.DIAMOND_ORE, 1), OrePrefix.ore, Materials.Diamond);
    OreDictUnifier.registerOre(new ItemStack(Blocks.EMERALD_ORE, 1), OrePrefix.ore, Materials.Emerald);
    OreDictUnifier.registerOre(new ItemStack(Blocks.QUARTZ_ORE, 1), OrePrefix.ore, Materials.NetherQuartz);
    OreDictUnifier.registerOre(new ItemStack(Items.DYE, 1, 4), OrePrefix.gem, Materials.Lapis);
    OreDictUnifier.registerOre(new ItemStack(Items.ENDER_EYE, 1), OrePrefix.gem, Materials.EnderEye);
    OreDictUnifier.registerOre(new ItemStack(Items.ENDER_PEARL, 1), OrePrefix.gem, Materials.EnderPearl);
    OreDictUnifier.registerOre(new ItemStack(Items.DIAMOND, 1), OrePrefix.gem, Materials.Diamond);
    OreDictUnifier.registerOre(new ItemStack(Items.EMERALD, 1), OrePrefix.gem, Materials.Emerald);
    OreDictUnifier.registerOre(new ItemStack(Items.COAL, 1, 0), OrePrefix.gem, Materials.Coal);
    OreDictUnifier.registerOre(new ItemStack(Items.COAL, 1, 1), OrePrefix.gem, Materials.Charcoal);
    OreDictUnifier.registerOre(new ItemStack(Items.QUARTZ, 1), OrePrefix.gem, Materials.NetherQuartz);
    OreDictUnifier.registerOre(new ItemStack(Items.NETHER_STAR, 1), OrePrefix.gem, Materials.NetherStar);
    OreDictUnifier.registerOre(new ItemStack(Items.GOLD_NUGGET, 1), OrePrefix.nugget, Materials.Gold);
    OreDictUnifier.registerOre(new ItemStack(Items.GOLD_INGOT, 1), OrePrefix.ingot, Materials.Gold);
    OreDictUnifier.registerOre(new ItemStack(Items.IRON_INGOT, 1), OrePrefix.ingot, Materials.Iron);
    OreDictUnifier.registerOre(new ItemStack(Items.PAPER, 1), OrePrefix.plate, Materials.Paper);
    OreDictUnifier.registerOre(new ItemStack(Items.SUGAR, 1), OrePrefix.dust, Materials.Sugar);
    OreDictUnifier.registerOre(new ItemStack(Items.STICK, 1), OrePrefix.stick, Materials.Wood);
    OreDictUnifier.registerOre(new ItemStack(Items.REDSTONE, 1), OrePrefix.dust, Materials.Redstone);
    OreDictUnifier.registerOre(new ItemStack(Items.GUNPOWDER, 1), OrePrefix.dust, Materials.Gunpowder);
    OreDictUnifier.registerOre(new ItemStack(Items.GLOWSTONE_DUST, 1), OrePrefix.dust, Materials.Glowstone);
    OreDictUnifier.registerOre(new ItemStack(Items.BLAZE_POWDER, 1), OrePrefix.dust, Materials.Blaze);
    OreDictUnifier.registerOre(new ItemStack(Items.BLAZE_ROD, 1), OrePrefix.stick, Materials.Blaze);
    OreDictUnifier.registerOre(new ItemStack(Blocks.IRON_BLOCK, 1, 0), OrePrefix.block, Materials.Iron);
    OreDictUnifier.registerOre(new ItemStack(Blocks.GOLD_BLOCK, 1, 0), OrePrefix.block, Materials.Gold);
    OreDictUnifier.registerOre(new ItemStack(Blocks.DIAMOND_BLOCK, 1, 0), OrePrefix.block, Materials.Diamond);
    OreDictUnifier.registerOre(new ItemStack(Blocks.EMERALD_BLOCK, 1, 0), OrePrefix.block, Materials.Emerald);
    OreDictUnifier.registerOre(new ItemStack(Blocks.LAPIS_BLOCK, 1, 0), OrePrefix.block, Materials.Lapis);
    OreDictUnifier.registerOre(new ItemStack(Blocks.COAL_BLOCK, 1, 0), OrePrefix.block, Materials.Coal);
    OreDictUnifier.registerOre(new ItemStack(Blocks.REDSTONE_BLOCK, 1, 0), OrePrefix.block, Materials.Redstone);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 1), OrePrefix.stone, Materials.GraniteBlack);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 2), OrePrefix.stone, Materials.GraniteBlack);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 5), OrePrefix.stone, Materials.Andesite);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 6), OrePrefix.stone, Materials.Andesite);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 3), OrePrefix.stone, Materials.Diorite);
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, 4), OrePrefix.stone, Materials.Diorite);
    OreDictUnifier.registerOre(new ItemStack(Blocks.ANVIL, 1), "craftingAnvil");
    OreDictUnifier.registerOre(new ItemStack(Blocks.OBSIDIAN, 1, W), OrePrefix.stone, Materials.Obsidian);
    OreDictUnifier.registerOre(new ItemStack(Blocks.MOSSY_COBBLESTONE, 1, W), "stoneMossy");
    OreDictUnifier.registerOre(new ItemStack(Blocks.MOSSY_COBBLESTONE, 1, W), "stoneCobble");
    OreDictUnifier.registerOre(new ItemStack(Blocks.COBBLESTONE, 1, W), "stoneCobble");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONE, 1, W), "stoneSmooth");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONEBRICK, 1, W), "stoneBricks");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONEBRICK, 1, 1), "stoneMossy");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONEBRICK, 1, 2), "stoneCracked");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STONEBRICK, 1, 3), "stoneChiseled");
    OreDictUnifier.registerOre(new ItemStack(Blocks.NETHERRACK, 1, W), OrePrefix.stone, Materials.Netherrack);
    OreDictUnifier.registerOre(new ItemStack(Blocks.END_STONE, 1, W), OrePrefix.stone, Materials.Endstone);
    OreDictUnifier.registerOre(new ItemStack(Blocks.REDSTONE_TORCH, 1, W), "craftingRedstoneTorch");
    OreDictUnifier.registerOre(new ItemStack(Blocks.PISTON, 1, W), "craftingPiston");
    OreDictUnifier.registerOre(new ItemStack(Blocks.STICKY_PISTON, 1, W), "craftingPiston");
    OreDictUnifier.registerOre(new ItemStack(Blocks.CHEST, 1, W), "craftingChest");
    OreDictUnifier.registerOre(new ItemStack(Blocks.TRAPPED_CHEST, 1, W), "craftingChest");
    OreDictUnifier.registerOre(new ItemStack(Blocks.FURNACE, 1, W), "craftingFurnace");
    OreDictUnifier.registerOre(new ItemStack(Items.FEATHER, 1, W), "craftingFeather");
    OreDictUnifier.registerOre(new ItemStack(Items.WHEAT, 1, W), "itemWheat");
    OreDictUnifier.registerOre(new ItemStack(Items.PAPER, 1, W), "paperEmpty");
    OreDictUnifier.registerOre(new ItemStack(Items.MAP, 1, W), "paperMap");
    OreDictUnifier.registerOre(new ItemStack(Items.FILLED_MAP, 1, W), "paperMap");
    OreDictUnifier.registerOre(new ItemStack(Items.BOOK, 1, W), "bookEmpty");
    OreDictUnifier.registerOre(new ItemStack(Items.WRITABLE_BOOK, 1, W), "bookWritable");
    OreDictUnifier.registerOre(new ItemStack(Items.WRITTEN_BOOK, 1, W), "bookWritten");
    OreDictUnifier.registerOre(new ItemStack(Items.ENCHANTED_BOOK, 1, W), "bookEnchanted");
    OreDictUnifier.registerOre(new ItemStack(Items.BOOK, 1, W), "craftingBook");
    OreDictUnifier.registerOre(new ItemStack(Items.WRITABLE_BOOK, 1, W), "craftingBook");
    OreDictUnifier.registerOre(new ItemStack(Items.WRITTEN_BOOK, 1, W), "craftingBook");
    OreDictUnifier.registerOre(new ItemStack(Items.ENCHANTED_BOOK, 1, W), "craftingBook");
}
Also used : LinkedListMultimap(com.google.common.collect.LinkedListMultimap) ModHandler(gregtech.api.recipes.ModHandler) OreDictUnifier(gregtech.api.unification.OreDictUnifier) GTLog(gregtech.api.util.GTLog) Blocks(net.minecraft.init.Blocks) Items(net.minecraft.init.Items) Item(net.minecraft.item.Item) FluidRegistry(net.minecraftforge.fluids.FluidRegistry) Materials(gregtech.api.unification.material.Materials) Multimap(com.google.common.collect.Multimap) Multimaps(com.google.common.collect.Multimaps) ItemStack(net.minecraft.item.ItemStack) Block(net.minecraft.block.Block) OreDictionary(net.minecraftforge.oredict.OreDictionary) WILDCARD_VALUE(net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE) MarkerMaterials(gregtech.api.unification.material.MarkerMaterials) BlockPrismarine(net.minecraft.block.BlockPrismarine) OrePrefix(gregtech.api.unification.ore.OrePrefix) W(gregtech.api.GTValues.W) Item(net.minecraft.item.Item) OreDictionary(net.minecraftforge.oredict.OreDictionary) Block(net.minecraft.block.Block) ItemStack(net.minecraft.item.ItemStack)

Example 2 with Materials

use of gregtech.api.unification.material.Materials in project GregTech by GregTechCE.

the class MetaBlocks method init.

public static void init() {
    MACHINE = new BlockMachine();
    MACHINE.setRegistryName("machine");
    CABLE = new BlockCable(64, 2, 0);
    CABLE.setRegistryName("cable");
    BOILER_CASING = new BlockBoilerCasing();
    BOILER_CASING.setRegistryName("boiler_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");
    MUTLIBLOCK_CASING = new BlockMultiblockCasing();
    MUTLIBLOCK_CASING.setRegistryName("multiblock_casing");
    WIRE_COIL = new BlockWireCoil();
    WIRE_COIL.setRegistryName("wire_coil");
    WARNING_SIGN = new BlockWarningSign();
    WARNING_SIGN.setRegistryName("warning_sign");
    GRANITE = new BlockGranite();
    GRANITE.setRegistryName("granite");
    BLACK_GRANITE = new StoneType(12, "black_granite", OrePrefix.oreBlackgranite, Materials.GraniteBlack, "gregtech:blocks/stones/granite/granite_black_stone", () -> GRANITE.withVariant(GraniteVariant.BLACK_GRANITE, ChiselingVariant.NORMAL), state -> state.getBlock() instanceof BlockGranite && ((BlockGranite) state.getBlock()).getVariant(state) == GraniteVariant.BLACK_GRANITE);
    RED_GRANITE = new StoneType(13, "red_granite", OrePrefix.oreRedgranite, Materials.GraniteRed, "gregtech:blocks/stones/granite/granite_red_stone", () -> GRANITE.withVariant(GraniteVariant.RED_GRANITE, ChiselingVariant.NORMAL), state -> state.getBlock() instanceof BlockGranite && ((BlockGranite) state.getBlock()).getVariant(state) == GraniteVariant.RED_GRANITE);
    MINERAL = new BlockMineral();
    MINERAL.setRegistryName("mineral");
    MARBLE = new StoneType(14, "marble", OrePrefix.oreMarble, Materials.Marble, "gregtech:blocks/stones/marble/marble_stone", () -> MINERAL.withVariant(MineralVariant.MARBLE, ChiselingVariant.NORMAL), state -> state.getBlock() instanceof BlockMineral && ((BlockMineral) state.getBlock()).getVariant(state) == BlockMineral.MineralVariant.MARBLE);
    BASALT = new StoneType(15, "basalt", OrePrefix.oreBasalt, Materials.Basalt, "gregtech:blocks/stones/basalt/basalt_stone", () -> MINERAL.withVariant(MineralVariant.BASALT, ChiselingVariant.NORMAL), state -> state.getBlock() instanceof BlockMineral && ((BlockMineral) state.getBlock()).getVariant(state) == BlockMineral.MineralVariant.BASALT);
    CONCRETE = new BlockConcrete();
    CONCRETE.setRegistryName("concrete");
    COMPRESSED = new HashMap<>();
    ORES = new ArrayList<>();
    StoneType.init();
    Material[] materialBuffer = new Material[16];
    Arrays.fill(materialBuffer, Materials._NULL);
    int generationIndex = 0;
    for (Material material : Material.MATERIAL_REGISTRY.getObjectsWithIds()) {
        if (material instanceof DustMaterial) {
            int id = Material.MATERIAL_REGISTRY.getIDForObject(material);
            int index = id / 16;
            if (index > generationIndex) {
                createCompressedBlock(materialBuffer, generationIndex);
                Arrays.fill(materialBuffer, Materials._NULL);
            }
            if (!OrePrefix.block.isIgnored(material)) {
                materialBuffer[id % 16] = material;
                generationIndex = index;
            }
            if (material.hasFlag(DustMaterial.MatFlags.GENERATE_ORE)) {
                createOreBlock((DustMaterial) material);
            }
        }
    }
    createCompressedBlock(materialBuffer, generationIndex);
}
Also used : java.util(java.util) GraniteVariant(gregtech.common.blocks.BlockGranite.GraniteVariant) Item(net.minecraft.item.Item) MetaTileEntities(gregtech.common.metatileentities.MetaTileEntities) MetaTileEntityRenderer(gregtech.api.render.MetaTileEntityRenderer) Materials(gregtech.api.unification.material.Materials) StoneType(gregtech.api.unification.ore.StoneType) Material(gregtech.api.unification.material.type.Material) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) StoneTypes(gregtech.api.unification.ore.StoneTypes) IProperty(net.minecraft.block.properties.IProperty) GregTechAPI(gregtech.api.GregTechAPI) Block(net.minecraft.block.Block) Minecraft(net.minecraft.client.Minecraft) Side(net.minecraftforge.fml.relauncher.Side) ChiselingVariant(gregtech.common.blocks.StoneBlock.ChiselingVariant) OrePrefix(gregtech.api.unification.ore.OrePrefix) ModelLoader(net.minecraftforge.client.model.ModelLoader) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) DefaultStateMapper(net.minecraft.client.renderer.block.statemap.DefaultStateMapper) ClientProxy(gregtech.common.ClientProxy) Streams(com.google.common.collect.Streams) Collectors(java.util.stream.Collectors) IBlockState(net.minecraft.block.state.IBlockState) DustMaterial(gregtech.api.unification.material.type.DustMaterial) MineralVariant(gregtech.common.blocks.BlockMineral.MineralVariant) BlockMachine(gregtech.api.block.machines.BlockMachine) BlockMachine(gregtech.api.block.machines.BlockMachine) StoneType(gregtech.api.unification.ore.StoneType) Material(gregtech.api.unification.material.type.Material) DustMaterial(gregtech.api.unification.material.type.DustMaterial) DustMaterial(gregtech.api.unification.material.type.DustMaterial)

Aggregations

Materials (gregtech.api.unification.material.Materials)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 Block (net.minecraft.block.Block)2 Item (net.minecraft.item.Item)2 LinkedListMultimap (com.google.common.collect.LinkedListMultimap)1 Multimap (com.google.common.collect.Multimap)1 Multimaps (com.google.common.collect.Multimaps)1 Streams (com.google.common.collect.Streams)1 W (gregtech.api.GTValues.W)1 GregTechAPI (gregtech.api.GregTechAPI)1 BlockMachine (gregtech.api.block.machines.BlockMachine)1 ModHandler (gregtech.api.recipes.ModHandler)1 MetaTileEntityRenderer (gregtech.api.render.MetaTileEntityRenderer)1 OreDictUnifier (gregtech.api.unification.OreDictUnifier)1 MarkerMaterials (gregtech.api.unification.material.MarkerMaterials)1 DustMaterial (gregtech.api.unification.material.type.DustMaterial)1 Material (gregtech.api.unification.material.type.Material)1 StoneType (gregtech.api.unification.ore.StoneType)1 StoneTypes (gregtech.api.unification.ore.StoneTypes)1 GTLog (gregtech.api.util.GTLog)1