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