Skip to content

Commit

Permalink
Paradise Support
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessBullets committed Nov 10, 2023
1 parent ce48faf commit 7a0e406
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ChunkDecoratorOverworldAPI extends ChunkDecoratorAPI {
public static OverworldOreFeatures oreFeatures = new OverworldOreFeatures(overworldConfig);
public static OverworldRandomFeatures randomFeatures = new OverworldRandomFeatures();
public static OverworldBiomeFeatures biomeFeatures = new OverworldBiomeFeatures();
protected ChunkDecoratorOverworldAPI(World world, int treeDensityOverride) {
public ChunkDecoratorOverworldAPI(World world, int treeDensityOverride) {
super(world);
this.treeDensityOverride = treeDensityOverride;
this.treeDensityNoise = new PerlinNoise(world.getRandomSeed(), 8, 74);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package useless.terrainapi.generation.paradise.api;

import net.minecraft.core.world.World;
import net.minecraft.core.world.generate.MapGenCaves;
import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
import net.minecraft.core.world.generate.chunk.perlin.paradise.TerrainGeneratorParadise;
import useless.terrainapi.generation.overworld.api.ChunkDecoratorOverworldAPI;

public class ChunkGeneratorParadiseAPI
extends ChunkGeneratorPerlin {
public ChunkGeneratorParadiseAPI(World world) {
super(world, new ChunkDecoratorOverworldAPI(world), new TerrainGeneratorParadise(world), new SurfaceGeneratorOverworld(world), new MapGenCaves(false));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld;
import useless.terrainapi.generation.overworld.api.ChunkDecoratorOverworldAPI;

public class ChunkGeneratorOverworldWoodsAPI extends ChunkGeneratorPerlin {
public ChunkGeneratorOverworldWoodsAPI(World world) {
super(world, new ChunkDecoratorOverworldWoodsAPI(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new MapGenCaves(false));
super(world, new ChunkDecoratorOverworldAPI(world, 50), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new MapGenCaves(false));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package useless.terrainapi.mixin.worldtypes;

import net.minecraft.core.world.World;
import net.minecraft.core.world.generate.chunk.ChunkGenerator;
import net.minecraft.core.world.type.WorldTypeParadise;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import useless.terrainapi.generation.paradise.api.ChunkGeneratorParadiseAPI;

@Mixin(value = WorldTypeParadise.class, remap = false)
public class WorldTypeParadiseMixin {
@Inject(method = "createChunkGenerator(Lnet/minecraft/core/world/World;)Lnet/minecraft/core/world/generate/chunk/ChunkGenerator;", at = @At("HEAD"), cancellable = true)
private void customChunkGenerator(World world, CallbackInfoReturnable<ChunkGenerator> cir){
cir.setReturnValue(new ChunkGeneratorParadiseAPI(world));
}
}
3 changes: 2 additions & 1 deletion src/main/resources/terrainapi.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"worldtypes.WorldTypeNetherMixin",
"worldtypes.WorldTypeOverworldMixin",
"worldtypes.WorldTypeOverworldRetroMixin",
"worldtypes.WorldTypeOverworldWoodsMixin"
"worldtypes.WorldTypeOverworldWoodsMixin",
"worldtypes.WorldTypeParadiseMixin"
],
"client": [
],
Expand Down

0 comments on commit 7a0e406

Please sign in to comment.