use of logictechcorp.libraryex.world.biome.BiomeData in project NetherEx by LogicTechCorp.
the class CaveChunkGenerator method decorate.
@Override
public void decorate(WorldGenRegion region) {
int chunkX = region.getMainChunkX();
int chunkZ = region.getMainChunkZ();
int posX = chunkX * 16;
int posZ = chunkZ * 16;
BlockPos pos = new BlockPos(posX, 0, posZ);
BiomeData biomeData = NetherEx.BIOME_DATA_MANAGER.getBiomeData(this.getBiome(region.getBiomeManager(), pos.add(8, 8, 8)));
SharedSeedRandom random = new SharedSeedRandom();
long decorationSeed = random.setDecorationSeed(region.getSeed(), posX, posZ);
if (biomeData != BiomeData.EMPTY) {
for (GenerationStage.Decoration stage : GenerationStage.Decoration.values()) {
biomeData.decorate(stage, this, region, decorationSeed, random, pos);
}
}
}
use of logictechcorp.libraryex.world.biome.BiomeData in project NetherEx by LogicTechCorp.
the class NetherCaveCarverOverride method func_225556_a_.
@Override
protected boolean func_225556_a_(IChunk chunk, Function<BlockPos, Biome> posBiomeFunction, BitSet carvingMask, Random random, BlockPos.Mutable mutablePos, BlockPos.Mutable mutablePosUp, BlockPos.Mutable mutablePosDown, int minY, int minX, int minZ, int posX, int posZ, int p_222703_12_, int posY, int p_222703_14_, AtomicBoolean isDefaultTopBlock) {
int bitIndex = p_222703_12_ | p_222703_14_ << 4 | posY << 8;
if (carvingMask.get(bitIndex)) {
return false;
} else {
carvingMask.set(bitIndex);
mutablePos.setPos(posX, posY, posZ);
mutablePosUp.setPos(mutablePos).move(Direction.UP);
if (this.canCarveBlock(chunk.getBlockState(mutablePos), chunk.getBlockState(mutablePosUp))) {
BlockState state;
if (posY <= 31) {
state = LAVA.getBlockState();
BiomeData biomeData = NetherEx.BIOME_DATA_MANAGER.getBiomeData(posBiomeFunction.apply(mutablePos));
if (biomeData != BiomeData.EMPTY) {
state = biomeData.getBiomeBlock(BiomeData.BlockType.LIQUID_BLOCK);
}
} else {
state = CAVE_AIR;
}
chunk.setBlockState(mutablePos, state, false);
return true;
} else {
return false;
}
}
}
use of logictechcorp.libraryex.world.biome.BiomeData in project NetherEx by LogicTechCorp.
the class CaveChunkGenerator method getPossibleCreatures.
@Override
public List<Biome.SpawnListEntry> getPossibleCreatures(EntityClassification classification, BlockPos pos) {
if (classification == EntityClassification.MONSTER) {
if (Feature.NETHER_BRIDGE.isPositionInsideStructure(this.world, pos)) {
return Feature.NETHER_BRIDGE.getSpawnList();
}
if (Feature.NETHER_BRIDGE.isPositionInStructure(this.world, pos) && this.world.getBlockState(pos.down()).getBlock() == Blocks.NETHER_BRICKS) {
return Feature.NETHER_BRIDGE.getSpawnList();
}
}
Biome biome = this.world.getBiome(pos);
BiomeData biomeData = NetherEx.BIOME_DATA_MANAGER.getBiomeData(biome);
List<Biome.SpawnListEntry> spawns = new ArrayList<>();
if (biomeData != BiomeData.EMPTY && biomeData.useDefaultEntities()) {
spawns.addAll(biome.getSpawns(classification));
}
spawns.addAll(biomeData.getSpawns(classification));
return spawns;
}
Aggregations