Search in sources :

Example 1 with ChunkProviderOverworld

use of net.minecraft.world.gen.ChunkProviderOverworld in project Realistic-Terrain-Generation by Team-RTG.

the class WorldTypeRTG method getChunkGenerator.

@Override
@Nonnull
public IChunkGenerator getChunkGenerator(@Nonnull World world, String generatorOptions) {
    if (DimensionManagerRTG.isValidDimension(world.provider.getDimension())) {
        //if (chunkProvider == null) {
        chunkProvider = new ChunkProviderRTG(world, world.getSeed());
        RTG.instance.runOnNextServerCloseOnly(clearProvider(chunkProvider));
        // inform the event manager about the ChunkEvent.Load event
        RTG.eventMgr.setDimensionChunkLoadEvent(world.provider.getDimension(), chunkProvider.delayedDecorator);
        RTG.instance.runOnNextServerCloseOnly(chunkProvider.clearOnServerClose());
        Logger.debug("WorldTypeRTG#getChunkGenerator() returning ChunkProviderRTG");
        return chunkProvider;
    //}
    // return a "fake" provider that won't decorate for Streams
    //ChunkProviderRTG result = new ChunkProviderRTG(world, world.getSeed());
    //result.isFakeGenerator();
    //return result;
    // no server close because it's not supposed to decorate
    //return chunkProvider;
    } else {
        Logger.debug("Invalid dimension. Serving up ChunkProviderOverworld instead of ChunkProviderRTG.");
        return new ChunkProviderOverworld(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions);
    }
}
Also used : ChunkProviderRTG(rtg.world.gen.ChunkProviderRTG) ChunkProviderOverworld(net.minecraft.world.gen.ChunkProviderOverworld) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 ChunkProviderOverworld (net.minecraft.world.gen.ChunkProviderOverworld)1 ChunkProviderRTG (rtg.world.gen.ChunkProviderRTG)1