Search in sources :

Example 1 with BiomeData

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);
        }
    }
}
Also used : SharedSeedRandom(net.minecraft.util.SharedSeedRandom) BiomeData(logictechcorp.libraryex.world.biome.BiomeData) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with BiomeData

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;
        }
    }
}
Also used : BlockState(net.minecraft.block.BlockState) BiomeData(logictechcorp.libraryex.world.biome.BiomeData)

Example 3 with BiomeData

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;
}
Also used : Biome(net.minecraft.world.biome.Biome) ArrayList(java.util.ArrayList) BiomeData(logictechcorp.libraryex.world.biome.BiomeData)

Aggregations

BiomeData (logictechcorp.libraryex.world.biome.BiomeData)3 ArrayList (java.util.ArrayList)1 BlockState (net.minecraft.block.BlockState)1 SharedSeedRandom (net.minecraft.util.SharedSeedRandom)1 BlockPos (net.minecraft.util.math.BlockPos)1 Biome (net.minecraft.world.biome.Biome)1