Search in sources :

Example 6 with StoneType

use of gregtech.api.unification.ore.StoneType in project GregTech by GregTechCE.

the class MetaBlocks method createOreBlock.

private static void createOreBlock(DustMaterial material, StoneType[] stoneTypes, int index) {
    BlockOre block = new BlockOre(material, stoneTypes);
    block.setRegistryName("ore_" + material + "_" + index);
    for (StoneType stoneType : stoneTypes) {
        GregTechAPI.oreBlockTable.computeIfAbsent(material, m -> new HashMap<>()).put(stoneType, block);
    }
    ORES.add(block);
}
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) StoneType(gregtech.api.unification.ore.StoneType)

Example 7 with StoneType

use of gregtech.api.unification.ore.StoneType in project GregTech by GregTechCE.

the class MetaBlocks method createOreBlock.

private static void createOreBlock(DustMaterial material) {
    StoneType[] stoneTypeBuffer = new StoneType[8];
    Arrays.fill(stoneTypeBuffer, StoneTypes._NULL);
    int generationIndex = 0;
    for (StoneType stoneType : StoneType.STONE_TYPE_REGISTRY) {
        int id = StoneType.STONE_TYPE_REGISTRY.getIDForObject(stoneType), index = id / 8;
        if (index > generationIndex) {
            createOreBlock(material, stoneTypeBuffer, generationIndex);
            Arrays.fill(stoneTypeBuffer, StoneTypes._NULL);
        }
        stoneTypeBuffer[id % 8] = stoneType;
        generationIndex = index;
    }
    createOreBlock(material, stoneTypeBuffer, generationIndex);
}
Also used : StoneType(gregtech.api.unification.ore.StoneType)

Aggregations

StoneType (gregtech.api.unification.ore.StoneType)7 IBlockState (net.minecraft.block.state.IBlockState)5 Block (net.minecraft.block.Block)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 Streams (com.google.common.collect.Streams)2 GregTechAPI (gregtech.api.GregTechAPI)2 BlockMachine (gregtech.api.block.machines.BlockMachine)2 MetaTileEntityRenderer (gregtech.api.render.MetaTileEntityRenderer)2 Materials (gregtech.api.unification.material.Materials)2 DustMaterial (gregtech.api.unification.material.type.DustMaterial)2 Material (gregtech.api.unification.material.type.Material)2 OrePrefix (gregtech.api.unification.ore.OrePrefix)2 StoneTypes (gregtech.api.unification.ore.StoneTypes)2 ClientProxy (gregtech.common.ClientProxy)2 GraniteVariant (gregtech.common.blocks.BlockGranite.GraniteVariant)2 MineralVariant (gregtech.common.blocks.BlockMineral.MineralVariant)2 ChiselingVariant (gregtech.common.blocks.StoneBlock.ChiselingVariant)2 MetaTileEntities (gregtech.common.metatileentities.MetaTileEntities)2 java.util (java.util)2 Collectors (java.util.stream.Collectors)2