Search in sources :

Example 1 with VeinChunkPopulator

use of gregtech.api.worldgen.populator.VeinChunkPopulator in project GregTech by GregTechCE.

the class CachedGridEntry method populateChunk.

public boolean populateChunk(World world, int chunkX, int chunkZ, Random random) {
    long chunkId = (long) chunkX << 32 | chunkZ & 0xFFFFFFFFL;
    ChunkDataEntry chunkDataEntry = dataByChunkPos.get(chunkId);
    GTWorldGenCapability capability = retrieveCapability(world, chunkX, chunkZ);
    capability.setFrom(masterEntry);
    if (chunkDataEntry != null && chunkDataEntry.populateChunk(world)) {
        for (OreDepositDefinition definition : chunkDataEntry.generatedOres) {
            IVeinPopulator veinPopulator = definition.getVeinPopulator();
            if (veinPopulator instanceof VeinChunkPopulator) {
                ((VeinChunkPopulator) veinPopulator).populateChunk(world, chunkX, chunkZ, random, definition, this);
            }
        }
        return true;
    }
    return false;
}
Also used : VeinChunkPopulator(gregtech.api.worldgen.populator.VeinChunkPopulator) OreDepositDefinition(gregtech.api.worldgen.config.OreDepositDefinition) IVeinPopulator(gregtech.api.worldgen.populator.IVeinPopulator)

Aggregations

OreDepositDefinition (gregtech.api.worldgen.config.OreDepositDefinition)1 IVeinPopulator (gregtech.api.worldgen.populator.IVeinPopulator)1 VeinChunkPopulator (gregtech.api.worldgen.populator.VeinChunkPopulator)1