[Feature] Migrated Biomes, Structures and Features to DataGen

This commit is contained in:
Frank 2022-12-09 16:37:24 +01:00
parent 76c5e1ce42
commit bdee723117
11 changed files with 217 additions and 101 deletions

View file

@ -3,6 +3,7 @@ package org.betterx.betterend.registry;
import org.betterx.bclib.api.v2.advancement.AdvancementManager; import org.betterx.bclib.api.v2.advancement.AdvancementManager;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.advancements.BECriteria; import org.betterx.betterend.advancements.BECriteria;
import org.betterx.betterend.world.biome.EndBiome;
import net.minecraft.advancements.FrameType; import net.minecraft.advancements.FrameType;
import net.minecraft.advancements.RequirementsStrategy; import net.minecraft.advancements.RequirementsStrategy;
@ -65,7 +66,7 @@ public class EndAdvancements {
.startDisplay(EndItems.AETERNIUM_BOOTS) .startDisplay(EndItems.AETERNIUM_BOOTS)
.frame(FrameType.CHALLENGE) .frame(FrameType.CHALLENGE)
.endDisplay() .endDisplay()
.addVisitBiomesCriterion(EndBiomes.ALL_BE_BIOMES.stream().map(b -> b.getBiomeKey()).toList()) .addVisitBiomesCriterion(EndBiome.getAllBeBiomes().stream().map(b -> b.getBiomeKey()).toList())
.requirements(RequirementsStrategy.AND) .requirements(RequirementsStrategy.AND)
.rewardXP(1500) .rewardXP(1500)
.buildAndRegister(); .buildAndRegister();

View file

@ -9,10 +9,7 @@ import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs; import org.betterx.betterend.config.Configs;
import org.betterx.betterend.world.biome.EndBiome; import org.betterx.betterend.world.biome.EndBiome;
import org.betterx.betterend.world.biome.air.BiomeIceStarfield;
import org.betterx.betterend.world.biome.cave.*; import org.betterx.betterend.world.biome.cave.*;
import org.betterx.betterend.world.biome.land.*;
import org.betterx.betterend.world.generator.BiomeType;
import org.betterx.betterend.world.generator.GeneratorOptions; import org.betterx.betterend.world.generator.GeneratorOptions;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
@ -20,47 +17,12 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import java.util.LinkedList;
import java.util.List;
public class EndBiomes { public class EndBiomes {
public static final BiomeAPI.BiomeType END_CAVE = new BiomeAPI.BiomeType("END_CAVE", BiomeAPI.BiomeType.END_IGNORE); public static final BiomeAPI.BiomeType END_CAVE = new BiomeAPI.BiomeType("END_CAVE", BiomeAPI.BiomeType.END_IGNORE);
public static final List<EndBiome> ALL_BE_BIOMES = new LinkedList<>();
public static BiomePicker CAVE_BIOMES = null; public static BiomePicker CAVE_BIOMES = null;
private static HexBiomeMap caveBiomeMap; private static HexBiomeMap caveBiomeMap;
private static long lastSeed; private static long lastSeed;
// Better End Land
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.LAND);
public static final EndBiome CHORUS_FOREST = registerBiome(new ChorusForestBiome(), BiomeType.LAND);
public static final EndBiome DUST_WASTELANDS = registerBiome(new DustWastelandsBiome(), BiomeType.LAND);
public static final EndBiome MEGALAKE = registerBiome(new MegalakeBiome(), BiomeType.LAND);
public static final EndBiome MEGALAKE_GROVE = registerSubBiome(new MegalakeGroveBiome(), MEGALAKE);
public static final EndBiome CRYSTAL_MOUNTAINS = registerBiome(new CrystalMountainsBiome(), BiomeType.LAND);
public static final EndBiome PAINTED_MOUNTAINS = registerSubBiome(new PaintedMountainsBiome(), DUST_WASTELANDS);
public static final EndBiome SHADOW_FOREST = registerBiome(new ShadowForestBiome(), BiomeType.LAND);
public static final EndBiome AMBER_LAND = registerBiome(new AmberLandBiome(), BiomeType.LAND);
public static final EndBiome BLOSSOMING_SPIRES = registerBiome(new BlossomingSpiresBiome(), BiomeType.LAND);
public static final EndBiome SULPHUR_SPRINGS = registerBiome(new SulphurSpringsBiome(), BiomeType.LAND);
public static final EndBiome UMBRELLA_JUNGLE = registerBiome(new UmbrellaJungleBiome(), BiomeType.LAND);
public static final EndBiome GLOWING_GRASSLANDS = registerBiome(new GlowingGrasslandsBiome(), BiomeType.LAND);
public static final EndBiome DRAGON_GRAVEYARDS = registerBiome(new DragonGraveyardsBiome(), BiomeType.LAND);
public static final EndBiome DRY_SHRUBLAND = registerBiome(new DryShrublandBiome(), BiomeType.LAND);
public static final EndBiome LANTERN_WOODS = registerBiome(new LanternWoodsBiome(), BiomeType.LAND);
public static final EndBiome NEON_OASIS = registerSubBiome(new NeonOasisBiome(), DUST_WASTELANDS);
public static final EndBiome UMBRA_VALLEY = registerBiome(new UmbraValleyBiome(), BiomeType.LAND);
// Better End Void
public static final EndBiome ICE_STARFIELD = registerBiome(new BiomeIceStarfield(), BiomeType.VOID);
// Better End Caves
public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome());
public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome());
public static final EndCaveBiome LUSH_SMARAGDANT_CAVE = registerCaveBiome(new LushSmaragdantCaveBiome());
public static final EndCaveBiome EMPTY_AURORA_CAVE = registerCaveBiome(new EmptyAuroraCaveBiome());
public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome());
public static void register() { public static void register() {
BCLBiomeRegistry.registerBiomeCodec(BetterEnd.makeID("biome"), EndBiome.KEY_CODEC); BCLBiomeRegistry.registerBiomeCodec(BetterEnd.makeID("biome"), EndBiome.KEY_CODEC);
BCLBiomeRegistry.registerBiomeCodec(BetterEnd.makeID("cave_biome"), EndCaveBiome.KEY_CODEC); BCLBiomeRegistry.registerBiomeCodec(BetterEnd.makeID("cave_biome"), EndCaveBiome.KEY_CODEC);
@ -104,30 +66,6 @@ public class EndBiomes {
} }
} }
/**
* Put existing {@link EndBiome} as a sub-biome into selected parent.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param parent - {@link EndBiome} to be linked with
* @return registered {@link EndBiome}
*/
public static EndBiome registerSubBiome(EndBiome.Config biomeConfig, EndBiome parent) {
return EndBiome.createSubBiome(biomeConfig, parent);
}
/**
* Registers {@link EndBiome} and adds it into worldgen.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param type - {@link BiomeType}
* @return registered {@link EndBiome}
*/
public static EndBiome registerBiome(EndBiome.Config biomeConfig, BiomeType type) {
final EndBiome biome = EndBiome.create(biomeConfig);
ALL_BE_BIOMES.add(biome);
return biome;
}
/** /**
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it. * Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
* *
@ -136,7 +74,7 @@ public class EndBiomes {
*/ */
public static EndBiome registerSubBiomeIntegration(EndBiome.Config biomeConfig) { public static EndBiome registerSubBiomeIntegration(EndBiome.Config biomeConfig) {
//TODO: 1.19.3 this was don on runtime, but biomes are now created in DataGen, so we need a fix... //TODO: 1.19.3 this was don on runtime, but biomes are now created in DataGen, so we need a fix...
return EndBiome.create(biomeConfig); return EndBiome.create(biomeConfig, BiomeAPI.BiomeType.END_LAND);
} }
/** /**
@ -154,10 +92,6 @@ public class EndBiomes {
} }
} }
public static EndCaveBiome registerCaveBiome(EndCaveBiome.Config biomeConfig) {
return EndCaveBiome.create(biomeConfig);
}
public static BiomePicker.ActualBiome getCaveBiome(int x, int z) { public static BiomePicker.ActualBiome getCaveBiome(int x, int z) {
return caveBiomeMap.getBiome(x, 5, z); return caveBiomeMap.getBiome(x, 5, z);
} }

View file

@ -31,6 +31,7 @@ import net.minecraft.world.level.levelgen.SurfaceRules;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.NotNull;
public class EndBiome extends BCLBiome implements SurfaceMaterialProvider { public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
public static final Codec<EndBiome> CODEC = RecordCodecBuilder.create(instance -> public static final Codec<EndBiome> CODEC = RecordCodecBuilder.create(instance ->
@ -173,15 +174,15 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
super(biomeID, settings); super(biomeID, settings);
} }
public static EndBiome create(Config biomeConfig) { public static EndBiome create(Config biomeConfig, BiomeAPI.BiomeType type) {
return create(biomeConfig, null); return create(biomeConfig, type, null);
} }
public static EndBiome createSubBiome(Config data, BCLBiome parentBiome) { public static EndBiome createSubBiome(Config data, @NotNull BCLBiome parentBiome) {
return create(data, parentBiome); return create(data, parentBiome.getIntendedType(), parentBiome);
} }
private static EndBiome create(Config biomeConfig, BCLBiome parentBiome) { private static EndBiome create(Config biomeConfig, BiomeAPI.BiomeType type, BCLBiome parentBiome) {
BCLBiomeBuilder builder = BCLBiomeBuilder BCLBiomeBuilder builder = BCLBiomeBuilder
.start(biomeConfig.ID) .start(biomeConfig.ID)
.music(SoundEvents.MUSIC_END) .music(SoundEvents.MUSIC_END)
@ -195,7 +196,7 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
.parentBiome(parentBiome) .parentBiome(parentBiome)
.precipitation(Biome.Precipitation.NONE) .precipitation(Biome.Precipitation.NONE)
.surface(biomeConfig.surfaceMaterial().surface().build()) .surface(biomeConfig.surfaceMaterial().surface().build())
.endLandBiome(); .type(type);
biomeConfig.addCustomBuildData(builder); biomeConfig.addCustomBuildData(builder);
EndFeatures.addDefaultFeatures(biomeConfig.ID, builder, biomeConfig.hasCaves()); EndFeatures.addDefaultFeatures(biomeConfig.ID, builder, biomeConfig.hasCaves());
@ -263,4 +264,8 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
public static BlockState findUnderMaterial(WorldGenLevel world, BlockPos pos) { public static BlockState findUnderMaterial(WorldGenLevel world, BlockPos pos) {
return findUnderMaterial(BiomeAPI.getBiome(world.getBiome(pos))); return findUnderMaterial(BiomeAPI.getBiome(world.getBiome(pos)));
} }
public static List<BCLBiome> getAllBeBiomes() {
return BiomeAPI.getAllBiomes(BiomeAPI.BiomeType.END);
}
} }

View file

@ -179,6 +179,6 @@ public class EndCaveBiome extends EndBiome {
} }
public static EndCaveBiome create(EndBiome.Config biomeConfig) { public static EndCaveBiome create(EndBiome.Config biomeConfig) {
return (EndCaveBiome) EndBiome.create(biomeConfig); return (EndCaveBiome) EndBiome.create(biomeConfig, EndBiomes.END_CAVE);
} }
} }

View file

@ -1,8 +1,11 @@
package org.betterx.datagen.betterend; package org.betterx.datagen.betterend;
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry; import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
import org.betterx.datagen.betterend.worldgen.EndBiomesDataProvider;
import org.betterx.datagen.betterend.worldgen.EndRegistriesDataProvider;
import net.minecraft.core.RegistrySetBuilder; import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
@ -11,12 +14,16 @@ public class BetterEndDatagen implements DataGeneratorEntrypoint {
@Override @Override
public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) { public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
BCLBiomeRegistry.prepareForDatagen(); BCLBiomeRegistry.prepareForDatagen();
EndBiomesDataProvider.ensureStaticallyLoaded();
final FabricDataGenerator.Pack pack = dataGenerator.createPack(); final FabricDataGenerator.Pack pack = dataGenerator.createPack();
pack.addProvider(EndBiomesDataProvider::new);
pack.addProvider(EndRegistriesDataProvider::new);
} }
@Override @Override
public void buildRegistry(RegistrySetBuilder registryBuilder) { public void buildRegistry(RegistrySetBuilder registryBuilder) {
EndRegistrySupplier.INSTANCE.bootstrapRegistries(registryBuilder); EndRegistrySupplier.INSTANCE.bootstrapRegistries(registryBuilder);
registryBuilder.add(Registries.BIOME, EndBiomesDataProvider::bootstrap);
} }
} }

View file

@ -4,9 +4,20 @@ import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeData; import org.betterx.bclib.api.v2.levelgen.biomes.BiomeData;
import org.betterx.bclib.api.v3.datagen.RegistrySupplier; import org.betterx.bclib.api.v3.datagen.RegistrySupplier;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.datagen.betterend.worldgen.ConfiguredFeatureDataProvider;
import org.betterx.datagen.betterend.worldgen.EndBiomesDataProvider;
import org.betterx.datagen.betterend.worldgen.PlacedFeatureDataProvider;
import org.betterx.datagen.betterend.worldgen.StructureDataProvider;
import org.betterx.worlds.together.surfaceRules.AssignedSurfaceRule; import org.betterx.worlds.together.surfaceRules.AssignedSurfaceRule;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry; import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.structure.Structure;
import net.minecraft.world.level.levelgen.structure.StructureSet;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -27,32 +38,31 @@ public class EndRegistrySupplier extends RegistrySupplier {
new RegistryInfo<>( new RegistryInfo<>(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY, SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
AssignedSurfaceRule.CODEC AssignedSurfaceRule.CODEC
),
new RegistryInfo<>(
Registries.STRUCTURE,
Structure.DIRECT_CODEC, StructureDataProvider::bootstrap
),
new RegistryInfo<>(
Registries.STRUCTURE_SET,
StructureSet.DIRECT_CODEC,
StructureDataProvider::bootstrapSets
),
new RegistryInfo<>(
Registries.CONFIGURED_FEATURE,
ConfiguredFeature.DIRECT_CODEC,
ConfiguredFeatureDataProvider::bootstrap
),
new RegistryInfo<>(
Registries.PLACED_FEATURE,
PlacedFeature.DIRECT_CODEC,
PlacedFeatureDataProvider::bootstrap
),
new RegistryInfo<>(
Registries.BIOME,
Biome.DIRECT_CODEC,
EndBiomesDataProvider::bootstrap
) )
// ,
// new RegistryInfo<>(
// Registries.STRUCTURE,
// Structure.DIRECT_CODEC, StructureDataProvider::bootstrap
// ),
// new RegistryInfo<>(
// Registries.STRUCTURE_SET,
// StructureSet.DIRECT_CODEC,
// StructureDataProvider::bootstrapSets
// ),
// new RegistryInfo<>(
// Registries.CONFIGURED_FEATURE,
// ConfiguredFeature.DIRECT_CODEC,
// ConfiguredFeatureDataProvider::bootstrap
// ),
// new RegistryInfo<>(
// Registries.PLACED_FEATURE,
// PlacedFeature.DIRECT_CODEC,
// PlacedFeatureDataProvider::bootstrap
// ),
// new RegistryInfo<>(
// Registries.BIOME,
// Biome.DIRECT_CODEC,
// NetherBiomesDataProvider::bootstrap
// )
); );
} }
} }

View file

@ -0,0 +1,12 @@
package org.betterx.datagen.betterend.worldgen;
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
public class ConfiguredFeatureDataProvider {
public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> ctx) {
BCLFeatureBuilder.registerUnbound(ctx);
}
}

View file

@ -1,4 +1,102 @@
package org.betterx.datagen.betterend.worldgen; package org.betterx.datagen.betterend.worldgen;
public class EndBiomesDataProvider { import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI.BiomeType;
import org.betterx.bclib.api.v3.datagen.TagDataProvider;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.world.biome.EndBiome;
import org.betterx.betterend.world.biome.air.BiomeIceStarfield;
import org.betterx.betterend.world.biome.cave.*;
import org.betterx.betterend.world.biome.land.*;
import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.world.level.biome.Biome;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class EndBiomesDataProvider extends TagDataProvider<Biome> {
// Better End Land
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.END_LAND);
public static final EndBiome CHORUS_FOREST = registerBiome(new ChorusForestBiome(), BiomeType.END_LAND);
public static final EndBiome DUST_WASTELANDS = registerBiome(new DustWastelandsBiome(), BiomeType.END_LAND);
public static final EndBiome NEON_OASIS = registerSubBiome(new NeonOasisBiome(), DUST_WASTELANDS);
public static final EndBiome PAINTED_MOUNTAINS = registerSubBiome(new PaintedMountainsBiome(), DUST_WASTELANDS);
public static final EndBiome MEGALAKE = registerBiome(new MegalakeBiome(), BiomeType.END_LAND);
public static final EndBiome MEGALAKE_GROVE = registerSubBiome(new MegalakeGroveBiome(), MEGALAKE);
public static final EndBiome CRYSTAL_MOUNTAINS = registerBiome(new CrystalMountainsBiome(), BiomeType.END_LAND);
public static final EndBiome SHADOW_FOREST = registerBiome(new ShadowForestBiome(), BiomeType.END_LAND);
public static final EndBiome AMBER_LAND = registerBiome(new AmberLandBiome(), BiomeType.END_LAND);
public static final EndBiome BLOSSOMING_SPIRES = registerBiome(new BlossomingSpiresBiome(), BiomeType.END_LAND);
public static final EndBiome SULPHUR_SPRINGS = registerBiome(new SulphurSpringsBiome(), BiomeType.END_LAND);
public static final EndBiome UMBRELLA_JUNGLE = registerBiome(new UmbrellaJungleBiome(), BiomeType.END_LAND);
public static final EndBiome GLOWING_GRASSLANDS = registerBiome(new GlowingGrasslandsBiome(), BiomeType.END_LAND);
public static final EndBiome DRAGON_GRAVEYARDS = registerBiome(new DragonGraveyardsBiome(), BiomeType.END_LAND);
public static final EndBiome DRY_SHRUBLAND = registerBiome(new DryShrublandBiome(), BiomeType.END_LAND);
public static final EndBiome LANTERN_WOODS = registerBiome(new LanternWoodsBiome(), BiomeType.END_LAND);
public static final EndBiome UMBRA_VALLEY = registerBiome(new UmbraValleyBiome(), BiomeType.END_LAND);
// Better End Void
public static final EndBiome ICE_STARFIELD = registerBiome(new BiomeIceStarfield(), BiomeType.END_VOID);
// Better End Caves
public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome());
public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome());
public static final EndCaveBiome LUSH_SMARAGDANT_CAVE = registerCaveBiome(new LushSmaragdantCaveBiome());
public static final EndCaveBiome EMPTY_AURORA_CAVE = registerCaveBiome(new EmptyAuroraCaveBiome());
public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome());
/**
* Constructs a new {@link FabricTagProvider} with the default computed path.
*
* <p>Common implementations of this class are provided.
*
* @param output the {@link FabricDataOutput} instance
* @param registriesFuture the backing registry for the tag type
*/
public EndBiomesDataProvider(
FabricDataOutput output,
CompletableFuture<HolderLookup.Provider> registriesFuture
) {
super(TagManager.BIOMES, List.of(BetterEnd.MOD_ID), output, registriesFuture);
}
public static void bootstrap(BootstapContext<Biome> ctx) {
BCLBiomeBuilder.registerUnbound(ctx);
}
public static void ensureStaticallyLoaded() {
}
/**
* Put existing {@link EndBiome} as a sub-biome into selected parent.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param parent - {@link EndBiome} to be linked with
* @return registered {@link EndBiome}
*/
public static EndBiome registerSubBiome(EndBiome.Config biomeConfig, EndBiome parent) {
return EndBiome.createSubBiome(biomeConfig, parent);
}
/**
* Registers {@link EndBiome} and adds it into worldgen.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param type - {@link BiomeType}
* @return registered {@link EndBiome}
*/
public static EndBiome registerBiome(EndBiome.Config biomeConfig, BiomeType type) {
final EndBiome biome = EndBiome.create(biomeConfig, type);
return biome;
}
public static EndCaveBiome registerCaveBiome(EndCaveBiome.Config biomeConfig) {
return EndCaveBiome.create(biomeConfig);
}
} }

View file

@ -0,0 +1,20 @@
package org.betterx.datagen.betterend.worldgen;
import org.betterx.bclib.api.v3.datagen.RegistriesDataProvider;
import org.betterx.betterend.BetterEnd;
import org.betterx.datagen.betterend.EndRegistrySupplier;
import net.minecraft.core.HolderLookup;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import java.util.concurrent.CompletableFuture;
public class EndRegistriesDataProvider extends RegistriesDataProvider {
public EndRegistriesDataProvider(
FabricDataOutput output,
CompletableFuture<HolderLookup.Provider> registriesFuture
) {
super(BetterEnd.LOGGER, EndRegistrySupplier.INSTANCE, output, registriesFuture);
}
}

View file

@ -0,0 +1,12 @@
package org.betterx.datagen.betterend.worldgen;
import org.betterx.bclib.api.v3.levelgen.features.BCLPlacedFeatureBuilder;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
public class PlacedFeatureDataProvider {
public static void bootstrap(BootstapContext<PlacedFeature> ctx) {
BCLPlacedFeatureBuilder.registerUnbound(ctx);
}
}

View file

@ -0,0 +1,17 @@
package org.betterx.datagen.betterend.worldgen;
import org.betterx.bclib.api.v2.levelgen.structures.BCLStructureBuilder;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.world.level.levelgen.structure.Structure;
import net.minecraft.world.level.levelgen.structure.StructureSet;
public class StructureDataProvider {
public static void bootstrap(BootstapContext<Structure> ctx) {
BCLStructureBuilder.registerUnbound(ctx);
}
public static void bootstrapSets(BootstapContext<StructureSet> ctx) {
BCLStructureBuilder.registerUnboundSets(ctx);
}
}