--- a/net/minecraft/util/datafix/fixes/EntityMinecartIdentifiersFix.java
+++ b/net/minecraft/util/datafix/fixes/EntityMinecartIdentifiersFix.java
@@ -22,8 +22,8 @@
 
     @Override
     public TypeRewriteRule makeRule() {
-        TaggedChoiceType<String> taggedchoicetype = this.getInputSchema().findChoiceType(References.ENTITY);
-        TaggedChoiceType<String> taggedchoicetype1 = this.getOutputSchema().findChoiceType(References.ENTITY);
+        TaggedChoiceType<String> taggedchoicetype = (TaggedChoiceType<String>)this.getInputSchema().findChoiceType(References.ENTITY);
+        TaggedChoiceType<String> taggedchoicetype1 = (TaggedChoiceType<String>)this.getOutputSchema().findChoiceType(References.ENTITY);
         return this.fixTypeEverywhere(
             "EntityMinecartIdentifiersFix",
             taggedchoicetype,
@@ -45,7 +45,7 @@
     
                         return Pair.of(
                             s,
-                            typed.write()
+                            ((com.mojang.serialization.DataResult<com.mojang.serialization.Dynamic<Pair<String, ?>>>)typed.write())
                                 .map(p_145294_ -> taggedchoicetype1.types().get(s).read(p_145294_))
                                 .result()
                                 .orElseThrow(() -> new IllegalStateException("Could not read the new minecart."))
