Moved FlatLevelPresets to BCLib and started WorldPresets

This commit is contained in:
Frank 2022-05-19 23:32:27 +02:00
parent e8dbbffa8e
commit 375eb09bb9
5 changed files with 63 additions and 8 deletions

View file

@ -35,11 +35,15 @@ public class TagAPI {
"tags/worldgen/biome",
b -> BiomeAPI.getBiomeID(b));
private static <T> TagType.RegistryBacked<T> registerType(DefaultedRegistry<T> registry) {
public static <T> TagType.RegistryBacked<T> registerType(DefaultedRegistry<T> registry) {
TagType<T> type = new TagType.RegistryBacked<>(registry);
return (TagType.RegistryBacked<T>) TYPES.computeIfAbsent(type.directory, (dir) -> type);
}
public static <T> TagType.Simple<T> registerType(Registry<T> registry, String directory) {
return registerType(registry.key(), directory, (o) -> registry.getKey(o));
}
public static <T> TagType.Simple<T> registerType(ResourceKey<? extends Registry<T>> registry,
String directory,
Function<T, ResourceLocation> locationProvider) {