use of gregtech.api.worldgen.populator.VeinBufferPopulator in project GregTech by GregTechCE.
the class CachedGridEntry method doGenerateVein.
private void doGenerateVein(OreDepositDefinition definition) {
this.currentOreVein = definition;
int topHeightOffset = currentOreVein.getShapeGenerator().getMaxSize().getY() / 2 + 4;
int maximumHeight = Math.min(masterEntry.getMaxBottomHeight(), currentOreVein.getHeightLimit()[1] - topHeightOffset);
int minimumHeight = Math.max(3, currentOreVein.getHeightLimit()[0]);
if (minimumHeight >= maximumHeight) {
return;
}
this.veinCenterX = calculateVeinCenterX();
this.veinCenterY = minimumHeight + gridRandom.nextInt(maximumHeight - minimumHeight);
this.veinCenterZ = calculateVeinCenterZ();
this.currentOreVein.getShapeGenerator().generate(gridRandom, this);
this.veinGeneratedMap.put(definition, new BlockPos(veinCenterX, veinCenterY, veinCenterZ));
IVeinPopulator veinPopulator = currentOreVein.getVeinPopulator();
if (veinPopulator instanceof VeinBufferPopulator) {
((VeinBufferPopulator) veinPopulator).populateBlockBuffer(gridRandom, this, this, currentOreVein);
}
this.currentOreVein = null;
}
Aggregations