--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
@@ -252,8 +252,8 @@
     private static <T extends GameRules.Value<T>> void callVisitorCap(
         GameRules.GameRuleTypeVisitor p_46167_, GameRules.Key<?> p_46168_, GameRules.Type<?> p_46169_
     ) {
-        p_46167_.visit(p_46168_, p_46169_);
-        p_46169_.callVisitor(p_46167_, p_46168_);
+        p_46167_.visit((GameRules.Key<T>)p_46168_, (GameRules.Type<T>)p_46169_);
+        ((GameRules.Type<T>)p_46169_).callVisitor(p_46167_, (GameRules.Key<T>)p_46168_);
     }
 
     public void assignFrom(GameRules p_46177_, @Nullable MinecraftServer p_46178_) {
