mirror of
https://github.com/FabricMC/fabric.git
synced 2025-09-07 03:39:18 +00:00
Update mappings.
This commit is contained in:
@@ -62,7 +62,7 @@ public class MixinBootstrap {
|
||||
RegistrySyncManager.bootstrapRegistries();
|
||||
}
|
||||
|
||||
@Redirect(method = "initialize", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/Registry;method_40292()V"))
|
||||
@Redirect(method = "initialize", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/Registry;freezeRegistries()V"))
|
||||
private static void skipFreeze() {
|
||||
// Don't freeze
|
||||
}
|
||||
|
@@ -29,8 +29,8 @@ import net.fabricmc.fabric.impl.registry.sync.DynamicRegistrySync;
|
||||
|
||||
@Mixin(DynamicRegistryManager.class)
|
||||
public interface MixinDynamicRegistryManager {
|
||||
@Inject(method = "method_40314", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/dynamic/EntryLoader$Impl;<init>()V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private static void onCreateImpl(CallbackInfoReturnable<DynamicRegistryManager.class_6893> cir, DynamicRegistryManager.class_6893 registryManager) {
|
||||
@Inject(method = "createAndLoad", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/dynamic/EntryLoader$Impl;<init>()V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private static void onCreateImpl(CallbackInfoReturnable<DynamicRegistryManager.Mutable> cir, DynamicRegistryManager.Mutable registryManager) {
|
||||
DynamicRegistrySetupCallback.EVENT.invoker().onRegistrySetup(registryManager);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ public interface MixinDynamicRegistryManager {
|
||||
* Ensures that any registrations made into {@link net.minecraft.util.registry.BuiltinRegistries} after
|
||||
* {@link DynamicRegistryManager} has been class-loaded are still propagated.
|
||||
*/
|
||||
@Inject(method = "method_40327()Lnet/minecraft/util/registry/DynamicRegistryManager$class_6890;", at = @At(value = "RETURN"))
|
||||
private static void setupBuiltInSync(CallbackInfoReturnable<DynamicRegistryManager.class_6890> cir) {
|
||||
@Inject(method = "method_40327", at = @At(value = "RETURN"))
|
||||
private static void setupBuiltInSync(CallbackInfoReturnable<DynamicRegistryManager.Immutable> cir) {
|
||||
DynamicRegistrySync.setupSync(cir.getReturnValue());
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ public class MixinMinecraftServer {
|
||||
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) {
|
||||
// Freeze the registries on the server
|
||||
FABRIC_LOGGER.debug("Freezing registries");
|
||||
Registry.method_40292();
|
||||
Registry.freezeRegistries();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -50,6 +50,6 @@ public class MixinMinecraftClient {
|
||||
private void onStart(CallbackInfo ci) {
|
||||
// Freeze the registries on the client
|
||||
FABRIC_LOGGER.debug("Freezing registries");
|
||||
Registry.method_40292();
|
||||
Registry.freezeRegistries();
|
||||
}
|
||||
}
|
||||
|
@@ -145,13 +145,13 @@ public class RegistrySyncTest implements ModInitializer {
|
||||
|
||||
// Force-Initialize the dynamic registry manager, doing this in a Mod initializer would cause
|
||||
// further registrations into BuiltInRegistries to _NOT_ propagate into DynamicRegistryManager.BUILTIN
|
||||
checkFeature(DynamicRegistryManager.method_40314(), f1Id);
|
||||
checkFeature(DynamicRegistryManager.createAndLoad(), f1Id);
|
||||
|
||||
ConfiguredFeature<DefaultFeatureConfig, ?> cf2 = new ConfiguredFeature<>(Feature.DESERT_WELL, DefaultFeatureConfig.INSTANCE);
|
||||
Identifier f2Id = new Identifier("registry_sync", "f2");
|
||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, f2Id, cf2);
|
||||
|
||||
DynamicRegistryManager impl2 = DynamicRegistryManager.method_40314();
|
||||
DynamicRegistryManager impl2 = DynamicRegistryManager.createAndLoad();
|
||||
checkFeature(impl2, f1Id);
|
||||
checkFeature(impl2, f2Id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user