mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Switch skyblock chunk generator to a dummied-out overworld one. This means biomes are now intact, allowing location-based mob farms. Old GoG chunks will remain as plains biomes
This commit is contained in:
1 parent
37b0042cdd
commit
f3ecda8bb3
3 files changed
+41
-8
No files matched your search
@@ -12,6 +12,7 @@ package vazkii.botania.common.world;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.ChunkGeneratorType;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.placement.IPlacementConfig;
|
||||
@@ -49,6 +50,11 @@ public class ModFeatures {
|
||||
register(r, MYSTICAL_FLOWERS, "mystical_flowers");
|
||||
register(r, MYSTICAL_MUSHROOMS, "mystical_mushrooms");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerChunkGenerators(RegistryEvent.Register<ChunkGeneratorType<?, ?>> evt) {
|
||||
register(evt.getRegistry(), SkyblockChunkGenerator.TYPE, "garden_of_glass");
|
||||
}
|
||||
|
||||
public static void addWorldgen() {
|
||||
for(Biome biome : ForgeRegistries.BIOMES) {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package vazkii.botania.common.world;
|
||||
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.biome.provider.BiomeProvider;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraft.world.gen.ChunkGeneratorType;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
import net.minecraft.world.gen.OverworldChunkGenerator;
|
||||
import net.minecraft.world.gen.OverworldGenSettings;
|
||||
import net.minecraft.world.gen.WorldGenRegion;
|
||||
|
||||
public class SkyblockChunkGenerator extends OverworldChunkGenerator {
|
||||
public static final ChunkGeneratorType<OverworldGenSettings, SkyblockChunkGenerator> TYPE = new ChunkGeneratorType<>(SkyblockChunkGenerator::new, false, OverworldGenSettings::new);
|
||||
|
||||
private SkyblockChunkGenerator(IWorld worldIn, BiomeProvider provider, OverworldGenSettings settingsIn) {
|
||||
super(worldIn, provider, settingsIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void makeBase(IWorld worldIn, IChunk chunkIn) {}
|
||||
|
||||
@Override
|
||||
public void generateSurface(IChunk chunkIn) {}
|
||||
|
||||
@Override
|
||||
public void decorate(WorldGenRegion region) {}
|
||||
|
||||
@Override
|
||||
public void carve(IChunk chunkIn, GenerationStage.Carving carvingSettings) {}
|
||||
}
|
||||
@@ -16,11 +16,13 @@ import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
import net.minecraft.world.biome.provider.BiomeProvider;
|
||||
import net.minecraft.world.biome.provider.BiomeProviderType;
|
||||
import net.minecraft.world.biome.provider.OverworldBiomeProviderSettings;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.ChunkGeneratorType;
|
||||
import net.minecraft.world.gen.FlatGenerationSettings;
|
||||
import net.minecraft.world.gen.FlatLayerInfo;
|
||||
import net.minecraft.world.gen.OverworldGenSettings;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -52,14 +54,9 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
@Override
|
||||
public ChunkGenerator<?> createChunkGenerator(@Nonnull World world) {
|
||||
if (world.dimension.getType() == DimensionType.OVERWORLD) {
|
||||
FlatGenerationSettings settings = new FlatGenerationSettings();
|
||||
settings.setBiome(Biomes.PLAINS);
|
||||
settings.getFlatLayers().add(new FlatLayerInfo(1, Blocks.AIR));
|
||||
settings.updateLayers();
|
||||
|
||||
BiomeProvider biomeProvider = BiomeProviderType.FIXED.create(BiomeProviderType.FIXED.createSettings().setBiome(settings.getBiome()));
|
||||
|
||||
return ChunkGeneratorType.FLAT.create(world, biomeProvider, settings);
|
||||
OverworldGenSettings genSettings = SkyblockChunkGenerator.TYPE.createSettings();
|
||||
OverworldBiomeProviderSettings biomeSettings = BiomeProviderType.VANILLA_LAYERED.createSettings().setWorldInfo(world.getWorldInfo()).setGeneratorSettings(genSettings);
|
||||
return SkyblockChunkGenerator.TYPE.create(world, BiomeProviderType.VANILLA_LAYERED.create(biomeSettings), genSettings);
|
||||
}
|
||||
return super.createChunkGenerator(world);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user