--- a/net/minecraft/core/RegistryAccess.java
+++ b/net/minecraft/core/RegistryAccess.java
@@ -39,8 +39,8 @@
         return new RegistryAccess.Frozen() {
             @Override
             public <T> Optional<Registry<T>> registry(ResourceKey<? extends Registry<? extends T>> p_206220_) {
-                Registry<Registry<T>> registry = p_206166_;
-                return registry.getOptional(p_206220_);
+                Registry<Registry<T>> registry = (Registry<Registry<T>>)p_206166_;
+                return registry.getOptional((ResourceKey<Registry<T>>)p_206220_);
             }
 
             @Override
@@ -77,7 +77,7 @@
 
         public ImmutableRegistryAccess(List<? extends Registry<?>> p_248540_) {
             this.registries = p_248540_.stream()
-                .collect(Collectors.toUnmodifiableMap(Registry::key, (Function<? super Registry, ? extends Registry>)(p_206232_ -> p_206232_)));
+                .collect(Collectors.toUnmodifiableMap(Registry::key, (p_206232_ -> p_206232_)));
         }
 
         public ImmutableRegistryAccess(Map<? extends ResourceKey<? extends Registry<?>>, ? extends Registry<?>> p_206225_) {
@@ -90,7 +90,7 @@
 
         @Override
         public <E> Optional<Registry<E>> registry(ResourceKey<? extends Registry<? extends E>> p_206229_) {
-            return Optional.ofNullable(this.registries.get(p_206229_)).map((Function<? super Registry<?>, ? extends Registry<E>>)(p_247993_ -> p_247993_));
+            return Optional.ofNullable(this.registries.get(p_206229_)).map((Function<? super Registry<?>, ? extends Registry<E>>)(p_247993_ -> (Registry<E>)p_247993_));
         }
 
         @Override
@@ -107,7 +107,7 @@
         }
 
         private static <T> RegistryAccess.RegistryEntry<T> fromUntyped(ResourceKey<? extends Registry<?>> p_206244_, Registry<?> p_206245_) {
-            return new RegistryAccess.RegistryEntry<>(p_206244_, p_206245_);
+            return new RegistryAccess.RegistryEntry<T>((ResourceKey<? extends Registry<T>>)p_206244_, (Registry<T>)p_206245_);
         }
 
         private RegistryAccess.RegistryEntry<T> freeze() {
