--- a/net/minecraft/core/registries/BuiltInRegistries.java
+++ b/net/minecraft/core/registries/BuiltInRegistries.java
@@ -305,12 +305,18 @@
         LOADERS.put(resourceLocation, () -> {
             return initializer.run(registry);
         });
-        WRITABLE_REGISTRY.register(key, registry, lifecycle);
+        WRITABLE_REGISTRY.register((ResourceKey) key, registry, lifecycle); // Paper - decompile fix
         return registry;
     }
 
     public static void bootStrap() {
+        // Paper start
+        bootStrap(() -> {});
+    }
+    public static void bootStrap(Runnable runnable) {
+        // Paper end
         createContents();
+        runnable.run(); // Paper
         freeze();
         validate(REGISTRY);
     }
