Improved handling of BCLBiomeRegistry on Datagen

This commit is contained in:
Frank 2023-06-07 21:47:35 +02:00
parent 2e2a23cd88
commit 33dd653208
2 changed files with 9 additions and 10 deletions

View file

@ -24,7 +24,6 @@ import net.fabricmc.fabric.api.event.registry.RegistryAttribute;
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -200,10 +199,11 @@ public class BCLBiomeRegistry {
@ApiStatus.Internal @ApiStatus.Internal
public static void bootstrap(BootstapContext<BCLBiome> ctx) { public static void bootstrap(BootstapContext<BCLBiome> ctx) {
//copy from builtin //copy from builtin, disabled as we do not bootstrap any biomes, all are loaded from the default datapack
for (Map.Entry<ResourceKey<BCLBiome>, BCLBiome> e : BUILTIN_BCL_BIOMES.entrySet()) { //vanilla biomes are provided by bclib
ctx.register(e.getKey(), e.getValue()); // for (Map.Entry<ResourceKey<BCLBiome>, BCLBiome> e : BUILTIN_BCL_BIOMES.entrySet()) {
} // ctx.register(e.getKey(), e.getValue());
// }
} }
private static void onBiomeLoad(Registry<BCLBiome> registry, int rawID, ResourceLocation id, BCLBiome biome) { private static void onBiomeLoad(Registry<BCLBiome> registry, int rawID, ResourceLocation id, BCLBiome biome) {

View file

@ -1,6 +1,5 @@
package org.betterx.worlds.together.mixin.common; package org.betterx.worlds.together.mixin.common;
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry; import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import net.minecraft.core.RegistrySetBuilder; import net.minecraft.core.RegistrySetBuilder;
@ -22,10 +21,10 @@ public class VanillaRegistriesMixin {
@Inject(method = "<clinit>", at = @At(value = "TAIL")) @Inject(method = "<clinit>", at = @At(value = "TAIL"))
private static void together_registerSurface(CallbackInfo ci) { private static void together_registerSurface(CallbackInfo ci) {
//this code is only needed for the DataGen procedure... //this code is only needed for the DataGen procedure...
BUILDER.add( // BUILDER.add(
BCLBiomeRegistry.BCL_BIOMES_REGISTRY, // BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
BCLBiomeRegistry::bootstrap // BCLBiomeRegistry::bootstrap
); // );
BUILDER.add( BUILDER.add(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY, SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,