net.minecraft.world.gen.chunk.OverworldChunkGeneratorConfig Java Examples

The following examples show how to use net.minecraft.world.gen.chunk.OverworldChunkGeneratorConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinBiomeLayers.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Redirect(method = "build(Lnet/minecraft/world/level/LevelGeneratorType;Lnet/minecraft/world/gen/chunk/OverworldChunkGeneratorConfig;Ljava/util/function/LongFunction;)Lcom/google/common/collect/ImmutableList;",
		at = @At(value = "INVOKE", target = "net/minecraft/world/biome/layer/SetBaseBiomesLayer.create(Lnet/minecraft/world/biome/layer/util/LayerSampleContext;Lnet/minecraft/world/biome/layer/util/LayerFactory;)Lnet/minecraft/world/biome/layer/util/LayerFactory;", ordinal = 0))
private static <T extends LayerSampler, C extends LayerSampleContext<T>> LayerFactory<T> addForgeBiomeLayers(SetBaseBiomesLayer instance, C contextParam, LayerFactory<T> parentLayer, LevelGeneratorType generatorType, OverworldChunkGeneratorConfig settings, LongFunction<C> contextProvider) {
	if (generatorType instanceof PatchworkLevelGeneratorType) {
		return ((IForgeWorldType) generatorType).getBiomeLayer(parentLayer, settings, contextProvider);
	} else {
		// vanilla behaviour
		return instance.create(contextParam, parentLayer);
	}
}
 
Example #2
Source File: MixinBiomeLayers.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Redirect(method = "build(Lnet/minecraft/world/level/LevelGeneratorType;Lnet/minecraft/world/gen/chunk/OverworldChunkGeneratorConfig;Ljava/util/function/LongFunction;)Lcom/google/common/collect/ImmutableList;",
		at = @At(value = "INVOKE", target = "net/minecraft/world/biome/layer/AddBambooJungleLayer.create(Lnet/minecraft/world/biome/layer/util/LayerSampleContext;Lnet/minecraft/world/biome/layer/util/LayerFactory;)Lnet/minecraft/world/biome/layer/util/LayerFactory;", ordinal = 0))
private static <T extends LayerSampler, C extends LayerSampleContext<T>> LayerFactory<T> redirectBambooJungle(AddBambooJungleLayer instance, C contextParam, LayerFactory<T> parentLayer, LevelGeneratorType generatorType, OverworldChunkGeneratorConfig settings, LongFunction<C> contextProvider) {
	if (generatorType instanceof PatchworkLevelGeneratorType) {
		return parentLayer;
	} else {
		// vanilla behaviour
		return instance.create(contextParam, parentLayer);
	}
}
 
Example #3
Source File: MixinBiomeLayers.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Redirect(method = "build(Lnet/minecraft/world/level/LevelGeneratorType;Lnet/minecraft/world/gen/chunk/OverworldChunkGeneratorConfig;Ljava/util/function/LongFunction;)Lcom/google/common/collect/ImmutableList;",
		at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/layer/BiomeLayers;stack(JLnet/minecraft/world/biome/layer/type/ParentedLayer;Lnet/minecraft/world/biome/layer/util/LayerFactory;ILjava/util/function/LongFunction;)Lnet/minecraft/world/biome/layer/util/LayerFactory;", ordinal = 3))
private static <T extends LayerSampler, C extends LayerSampleContext<T>> LayerFactory<T> redirectStack(long seed, ParentedLayer layer, LayerFactory<T> parentLayer, int count, LongFunction<C> contextProvider, LevelGeneratorType generatorType, OverworldChunkGeneratorConfig settings, LongFunction<C> contextProviderParam) {
	if (generatorType instanceof PatchworkLevelGeneratorType) {
		return parentLayer;
	} else {
		// vanilla behaviour
		return stack(seed, layer, parentLayer, count, contextProvider);
	}
}
 
Example #4
Source File: MixinBiomeLayers.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Redirect(method = "build(Lnet/minecraft/world/level/LevelGeneratorType;Lnet/minecraft/world/gen/chunk/OverworldChunkGeneratorConfig;Ljava/util/function/LongFunction;)Lcom/google/common/collect/ImmutableList;",
		at = @At(value = "INVOKE", target = "net/minecraft/world/biome/layer/EaseBiomeEdgeLayer.create(Lnet/minecraft/world/biome/layer/util/LayerSampleContext;Lnet/minecraft/world/biome/layer/util/LayerFactory;)Lnet/minecraft/world/biome/layer/util/LayerFactory;", ordinal = 0))
private static <T extends LayerSampler, C extends LayerSampleContext<T>> LayerFactory<T> redirectEaseBiomeEdge(EaseBiomeEdgeLayer instance, C contextParam, LayerFactory<T> parentLayer, LevelGeneratorType generatorType, OverworldChunkGeneratorConfig settings, LongFunction<C> contextProvider) {
	if (generatorType instanceof PatchworkLevelGeneratorType) {
		return parentLayer;
	} else {
		// vanilla behaviour
		return instance.create(contextParam, parentLayer);
	}
}
 
Example #5
Source File: FeatureGenerator.java    From fabric-carpet with MIT License 5 votes vote down vote up
private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome, boolean wireOnly)
    {
    //if (1+2==3)
    //    throw new RuntimeException("rebuild me");
    return (w, p) -> {
        ChunkGenerator chunkgen = new OverworldChunkGenerator(w, w.getChunkManager().getChunkGenerator().getBiomeSource(), new OverworldChunkGeneratorConfig()) //  BiomeSourceType.VANILLA_LAYERED.applyConfig((BiomeSourceType.VANILLA_LAYERED.getConfig())), ChunkGeneratorType.SURFACE.createSettings())
        {
            @Override
            public <C extends FeatureConfig> C getStructureConfig(Biome biome_1, StructureFeature<C> structureFeature_1)
            {
                return (C)conf;
            }

            @Override
            public BiomeSource getBiomeSource()
            {
                return new VanillaLayeredBiomeSource(new VanillaLayeredBiomeSourceConfig(w.getLevelProperties()))
                {
                    @Override
                    public Biome getBiomeForNoiseGen(int i, int j, int k)
                    {
                        return biome;
                    }

                    @Override
                    public Set<Biome> getBiomesInArea(int int_1, int int_2, int int_3, int int_4)
                    {
                        return Sets.newHashSet(biome);
                    }
                };
            }
        };


        return ((StructureFeatureInterface)structure).plopAnywhere(w, p, chunkgen, wireOnly);
    };
}
 
Example #6
Source File: OverworldChunkGeneratorMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 4 votes vote down vote up
public OverworldChunkGeneratorMixin(IWorld world, BiomeSource biomeSource, int verticalNoiseResolution, int horizontalNoiseResolution, int worldHeight, OverworldChunkGeneratorConfig config, boolean useSimplexNoise)
{
    super(world, biomeSource, verticalNoiseResolution, horizontalNoiseResolution, worldHeight, config, useSimplexNoise);
}
 
Example #7
Source File: OverworldChunkGeneratorMixin.java    From fabric-carpet with MIT License 4 votes vote down vote up
public OverworldChunkGeneratorMixin(IWorld iWorld_1, BiomeSource biomeSource_1, int int_1, int int_2, int int_3, OverworldChunkGeneratorConfig chunkGeneratorConfig_1, boolean boolean_1)
{
    super(iWorld_1, biomeSource_1, int_1, int_2, int_3, chunkGeneratorConfig_1, boolean_1);
}
 
Example #8
Source File: IForgeWorldType.java    From patchwork-api with GNU Lesser General Public License v2.1 3 votes vote down vote up
/**
 * Allows modifying the {@link LayerFactory} used for this type's biome
 * generation.
 *
 * @param <T>            The type of {@link LayerSampler}.
 * @param <C>            The type of {@link LayerSampleContext}.
 * @param parentLayer    The parent layer to feed into any layer you return
 * @param settings  The {@link OverworldChunkGeneratorConfig} used to create the
 *                       {@link SetBaseBiomesLayer}.
 * @param contextFactory A {@link LongFunction} factory to create contexts of
 *                       the supplied size.
 * @return A {@link LayerFactory} that representing the Biomes to be generated.
 * @see SetBaseBiomesLayer
 */
default <T extends LayerSampler, C extends LayerSampleContext<T>> LayerFactory<T> getBiomeLayer(LayerFactory<T> parentLayer, OverworldChunkGeneratorConfig settings, LongFunction<C> contextFactory) {
	parentLayer = (new SetBaseBiomesLayer(getWorldType(), settings)).create(contextFactory.apply(200L), parentLayer);
	parentLayer = AddBambooJungleLayer.INSTANCE.create(contextFactory.apply(1001L), parentLayer);
	parentLayer = AccessorBiomeLayers.patchwork$stack(1000L, ScaleLayer.NORMAL, parentLayer, 2, contextFactory);
	parentLayer = EaseBiomeEdgeLayer.INSTANCE.create(contextFactory.apply(1000L), parentLayer);
	return parentLayer;
}