Fixed Registry handling

This commit is contained in:
Frank 2022-10-25 22:45:42 +02:00
parent 73687e3401
commit 95ea99e44d
13 changed files with 289 additions and 75 deletions

View file

@ -1,6 +1,9 @@
package org.betterx.bclib.mixin.common;
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
import com.mojang.serialization.Lifecycle;
import net.minecraft.core.MappedRegistry;
import net.minecraft.core.Registry;
import net.minecraft.core.WritableRegistry;
import net.minecraft.data.BuiltinRegistries;
@ -27,12 +30,11 @@ public abstract class BuiltinRegistriesMixin {
//this needs to be added BEFORE the WORLD_PRESET-Registry. Otherwise decoding will fail!
@Inject(method = "<clinit>", at = @At(value = "INVOKE", target = "Lnet/minecraft/data/BuiltinRegistries;registerSimple(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/data/BuiltinRegistries$RegistryBootstrap;)Lnet/minecraft/core/Registry;", ordinal = 0))
private static void bcl_registerBuiltin(CallbackInfo ci) {
//TODO: 1.19.3 reenable
// BCLBiomeRegistry.BUILTIN_BCL_BIOMES = internalRegister(
// BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
// (MappedRegistry) BCLBiomeRegistry.BUILTIN_BCL_BIOMES,
// BCLBiomeRegistry::bootstrap,
// Lifecycle.stable()
// );
BCLBiomeRegistry.BUILTIN_BCL_BIOMES = internalRegister(
BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
(MappedRegistry) BCLBiomeRegistry.BUILTIN_BCL_BIOMES,
BCLBiomeRegistry::bootstrap,
Lifecycle.stable()
);
}
}