Search in sources :

Example 6 with IChunkGenerator

use of net.minecraft.world.gen.IChunkGenerator in project RecurrentComplex by Ivorforce.

the class GenerationSanityChecker method init.

public static void init() {
    FAILED_DIMENSIONS.clear();
    // Sanity check for chunk population
    GameRegistry.registerWorldGenerator((Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) -> {
        ChunkPos pos = new ChunkPos(chunkX, chunkZ);
        if (!WorldStructureGenerationData.get(world).checkChunk(pos))
            return;
        if (FAILED_DIMENSIONS.add(world.provider.getDimension()))
            RecurrentComplex.logger.error(String.format("Chunk finished generating without Forge population being triggered (dimension %d). This is a bug with the dimension - please report this to the dimension's author. Recurrent Complex will proceed to generate in compatibility mode.", world.provider.getDimension()));
        // @ Mod authors
        // Please fire PopulateChunkEvent.Pre before, and PopulateChunkEvent.Post after chunk decoration.
        // Use ForgeEventFactory.onChunkPopulate(true, this, world, random, x, z, hasVillage); for pre
        // Use ForgeEventFactory.onChunkPopulate(false, this, world, random, x, z, hasVillage); for post
        // Via ChunkGeneratorOverworld
        // This IChunkGenerator setup will work, but it's not preferred.
        WorldGenStructures.decorate((WorldServer) world, random, pos, null);
    }, 1);
}
Also used : IChunkGenerator(net.minecraft.world.gen.IChunkGenerator) Random(java.util.Random) IChunkProvider(net.minecraft.world.chunk.IChunkProvider) ChunkPos(net.minecraft.util.math.ChunkPos) World(net.minecraft.world.World)

Aggregations

IChunkGenerator (net.minecraft.world.gen.IChunkGenerator)6 World (net.minecraft.world.World)3 Random (java.util.Random)2 ChunkPos (net.minecraft.util.math.ChunkPos)2 ChunkProviderServer (net.minecraft.world.gen.ChunkProviderServer)2 IMixinWorldServer (org.spongepowered.common.interfaces.world.IMixinWorldServer)2 SpongeWorldGenerator (org.spongepowered.common.world.gen.SpongeWorldGenerator)2 Timing (co.aikar.timings.Timing)1 Vector3i (com.flowpowered.math.vector.Vector3i)1 PlayerIdentifier (com.mraof.minestuck.util.IdentifierHandler.PlayerIdentifier)1 Title (com.mraof.minestuck.util.Title)1 LandAspectRegistry (com.mraof.minestuck.world.lands.LandAspectRegistry)1 ChunkProviderLands (com.mraof.minestuck.world.lands.gen.ChunkProviderLands)1 ArrayList (java.util.ArrayList)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 BlockPos (net.minecraft.util.math.BlockPos)1 WorldProvider (net.minecraft.world.WorldProvider)1 WorldServer (net.minecraft.world.WorldServer)1 WorldType (net.minecraft.world.WorldType)1