Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-232104

Minecarts cause chunks to be corrupted/reset when loading worlds from before 1.5 (13w02a)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.17.1, 21w39a, 1.18.1, 1.18.2, 1.19.1 Release Candidate 2, 1.20.2, 24w12a
    • Confirmed
    • Datafixer
    • Important
    • Platform

      May relate to MC-134115 due to 1.13 changes being the current suspect.

      The bug

      In 13w02a, changes were made to the minecart entity ID. World saves from this version onwards can be safely upgraded to the current version (1.18.2). However, worlds from 13w01b or earlier (back to 12w07a) will cause any chunk that contains a minecart to be completely reset.

      How to reproduce

      This is as simple as creating a world in 13w01b or earlier, placing a minecart, and then loading that world in the latest version.

      Example case

      The following is a link to a world save last played in Java Edition 1.4.7 (the file size is rather large so it may be worth making a dedicated world yourself):
      http://www.mediafire.com/file/pp1h388kzu2n7p7/Dataless822s_Survival_World_v1.0.zip/file

      When loaded up and played in version 1.4.7, it plays completely fine. However, when loaded in the latest supported version, several chunks in the world fail to load, and are replaced with newly generated chunks. In pre-13w02a, the game log also produces errors indicating this:

      Example output
      Couldn't load chunk [-19, 14]
      java.lang.ClassCastException: class com.mojang.serialization.DataResult cannot be cast to class com.mojang.datafixers.util.Pair (com.mojang.serialization.DataResult and com.mojang.datafixers.util.Pair are in unnamed module of loader 'app')
      	at com.mojang.datafixers.optics.Proj2.view(Proj2.java:7)
      	at com.mojang.datafixers.optics.Lens.lambda$null$0(Lens.java:48)
      	at com.mojang.datafixers.optics.Affine$Instance.lambda$null$0(Affine.java:45)
      	at com.mojang.datafixers.optics.Optics$5.preview(Optics.java:117)
      	at com.mojang.datafixers.types.templates.TaggedChoice$TaggedChoiceType$2.capPreview(TaggedChoice.java:283)
      	at com.mojang.datafixers.types.templates.TaggedChoice$TaggedChoiceType$2.preview(TaggedChoice.java:278)
      	at com.mojang.datafixers.types.templates.TaggedChoice$TaggedChoiceType$2.preview(TaggedChoice.java:271)
      	at com.mojang.datafixers.optics.Affine.lambda$null$2(Affine.java:34)
      	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34)
      	at com.mojang.datafixers.util.Pair$Instance.traverse(Pair.java:90)
      	at com.mojang.datafixers.optics.profunctors.TraversalP$1.lambda$wander$0(TraversalP.java:50)
      	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34)
      	at com.mojang.datafixers.optics.Traversal$Instance$1.lambda$wander$0(Traversal.java:34)
      	at com.mojang.datafixers.Typed.updateCap(Typed.java:164)
      	at com.mojang.datafixers.Typed.update(Typed.java:138)
      	at com.mojang.datafixers.Typed.update(Typed.java:133)
      	at akb.a(SourceFile:18)
      	at com.mojang.datafixers.DataFix.lambda$null$3(DataFix.java:86)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Fold.lambda$null$2(Fold.java:48)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$first$1(FunctionType.java:81)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$first$1(FunctionType.java:81)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Fold.lambda$null$2(Fold.java:48)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$null$3(FunctionType.java:93)
      	at com.mojang.datafixers.optics.ListTraversal.lambda$wander$0(ListTraversal.java:19)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$wander$4(FunctionType.java:94)
      	at com.mojang.datafixers.util.Either.lambda$mapRight$1(Either.java:166)
      	at com.mojang.datafixers.util.Either$Right.map(Either.java:99)
      	at com.mojang.datafixers.util.Either.mapRight(Either.java:166)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$right$6(FunctionType.java:104)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$first$1(FunctionType.java:81)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$first$1(FunctionType.java:81)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.FunctionType$Instance.lambda$first$1(FunctionType.java:81)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at java.base/java.util.function.Function.lambda$compose$0(Function.java:68)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.functions.Comp.lambda$null$5(Comp.java:69)
      	at com.mojang.datafixers.types.Type.capWrite(Type.java:167)
      	at com.mojang.datafixers.types.Type.lambda$readAndWrite$9(Type.java:159)
      	at com.mojang.serialization.DataResult.lambda$flatMap$10(DataResult.java:138)
      	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
      	at com.mojang.serialization.DataResult.flatMap(DataResult.java:136)
      	at com.mojang.datafixers.types.Type.readAndWrite(Type.java:158)
      	at com.mojang.datafixers.DataFixerUpper.update(DataFixerUpper.java:84)
      	at nm.a(SourceFile:488)
      	at cnk.a(SourceFile:37)
      	at abe.i(SourceFile:831)
      	at abe.l(SourceFile:508)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
      	at aqv.c(SourceFile:151)
      	at abp$a.c(SourceFile:528)
      	at aqv.z(SourceFile:125)
      	at abp$a.z(SourceFile:537)
      	at abp.d(SourceFile:280)
      	at net.minecraft.server.MinecraftServer.bf(SourceFile:776)
      	at net.minecraft.server.MinecraftServer.z(SourceFile:764)
      	at aqv.c(SourceFile:134)
      	at net.minecraft.server.MinecraftServer.y(SourceFile:749)
      	at net.minecraft.server.MinecraftServer.b(SourceFile:521)
      	at net.minecraft.server.MinecraftServer.e_(SourceFile:353)
      	at faq.e(SourceFile:71)
      	at net.minecraft.server.MinecraftServer.x(SourceFile:670)
      	at net.minecraft.server.MinecraftServer.a(SourceFile:270)
      	at java.base/java.lang.Thread.run(Thread.java:831)
      

      Indeed, chunk [-19, 14] is in fact corrupted:

      Expected results

      Upgrading world would work regardless of whether a given chunk contains a minecart or not. Upgrading worlds (especially pure vanilla Survival worlds) should be as safe of a process as possible and cause no unexpected damage unrelated to intended game mechanic changes.

      Actual results

      The chunks containing a minecart are just completely reset. No attempt is made to even keep the terrain and delete the entity, the whole chunk is just gone.

      Workarounds

      This can be avoided by loading the world in a slightly later version (probably 13w02a to 17w46a but I can't be sure of it; 1.6.4 definitely works though) before the latest version, as this should convert the minecarts over to the new format which the current version can understand.

        1. 2021-07-14_14.28.16.png
          2021-07-14_14.28.16.png
          773 kB
        2. 2021-07-14_14.50.37.png
          2021-07-14_14.50.37.png
          19 kB
        3. 2021-07-14_14.51.13.png
          2021-07-14_14.51.13.png
          90 kB
        4. 2021-07-14_14.52.00.png
          2021-07-14_14.52.00.png
          324 kB
        5. 2021-07-14_15.02.24.png
          2021-07-14_15.02.24.png
          428 kB
        6. 2021-07-14_15.03.12.png
          2021-07-14_15.03.12.png
          483 kB
        7. 2021-07-14_15.10.31.png
          2021-07-14_15.10.31.png
          277 kB
        8. 2021-07-14_15.10.54.png
          2021-07-14_15.10.54.png
          315 kB
        9. 2021-07-14_15.14.54.png
          2021-07-14_15.14.54.png
          72 kB
        10. 2022-03-31_11.21.17.png
          2022-03-31_11.21.17.png
          745 kB
        11. 2022-03-31_11.22.06.png
          2022-03-31_11.22.06.png
          725 kB

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            11 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: