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

Pack filters removing recipes that the player has unlocked causes data pack loading to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.21.2 Pre-Release 1
    • 24w40a
    • None
    • Confirmed
    • (Unassigned)
    • Important
    • Platform

      Reloading a data pack that removes recipes, when the player already has recipes unlocked, can cause data pack loading to fail.

      How to reproduce:

      1. Create an empty world without data packs, with cheats enabled
      2. Give yourself all the recipes
        /recipe give @s *
        
      3. Add the attached data pack MC-277148.zip to the world
      4. Run reload, which will try to add this data pack
        /reload
        
      5. "Reload failed; keeping old data"

      Stacktrace:

      [22:26:55] [Server thread/WARN]: Failed to execute reload
      java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because the return value of "java.util.Map.get(Object)" is null
              at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:722) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
              at amw.run(SourceFile:18) ~[server-24w40a.jar:?]
              at brt.d(SourceFile:164) ~[server-24w40a.jar:?]
              at brx.d(SourceFile:23) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:889) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.d(SourceFile:180) ~[server-24w40a.jar:?]
              at brt.B(SourceFile:138) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.bv(SourceFile:871) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.B(SourceFile:865) ~[server-24w40a.jar:?]
              at brt.b(SourceFile:147) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:829) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:1530) ~[server-24w40a.jar:?]
              at apg.a(SourceFile:22) ~[server-24w40a.jar:?]
              at anr.a(SourceFile:120) ~[server-24w40a.jar:?]
              at anr.i(SourceFile:63) ~[server-24w40a.jar:?]
              at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
              at ig.a(SourceFile:29) ~[server-24w40a.jar:?]
              at ig.execute(SourceFile:13) ~[server-24w40a.jar:?]
              at ia.a(SourceFile:8) ~[server-24w40a.jar:?]
              at hs.a(SourceFile:8) ~[server-24w40a.jar:?]
              at hw.a(SourceFile:107) ~[server-24w40a.jar:?]
              at ex.a(SourceFile:384) ~[server-24w40a.jar:?]
              at ex.a(SourceFile:314) ~[server-24w40a.jar:?]
              at atk.b(SourceFile:1334) ~[server-24w40a.jar:?]
              at atk.b(SourceFile:1322) ~[server-24w40a.jar:?]
              at amw.run(SourceFile:18) ~[server-24w40a.jar:?]
              at brt.d(SourceFile:164) ~[server-24w40a.jar:?]
              at brx.d(SourceFile:23) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:889) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.d(SourceFile:180) ~[server-24w40a.jar:?]
              at brt.B(SourceFile:138) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.bv(SourceFile:871) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.B(SourceFile:865) ~[server-24w40a.jar:?]
              at brt.b(SourceFile:147) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:829) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.x_(SourceFile:836) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.y(SourceFile:719) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:292) ~[server-24w40a.jar:?]
              at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
      Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because the return value of "java.util.Map.get(Object)" is null
              at dcf.a(SourceFile:208) ~[server-24w40a.jar:?]
              at asi.a(SourceFile:353) ~[server-24w40a.jar:?]
              at axk.a(SourceFile:157) ~[server-24w40a.jar:?]
              at awi.u(SourceFile:898) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:1523) ~[server-24w40a.jar:?]
              at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
              ... 39 more
      

      While testing, this other stacktrace showed up, which might be related:

      java.util.concurrent.CompletionException: java.lang.NullPointerException
              at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:722) ~[?:?]
              at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
              at amw.run(SourceFile:18) ~[server-24w40a.jar:?]
              at brt.d(SourceFile:164) ~[server-24w40a.jar:?]
              at brx.d(SourceFile:23) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:889) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.d(SourceFile:180) ~[server-24w40a.jar:?]
              at brt.B(SourceFile:138) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.bv(SourceFile:871) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.B(SourceFile:865) ~[server-24w40a.jar:?]
              at brt.b(SourceFile:147) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.b(SourceFile:829) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:1530) ~[server-24w40a.jar:?]
              at apg.a(SourceFile:22) ~[server-24w40a.jar:?]
              at apg.a(SourceFile:53) ~[server-24w40a.jar:?]
              at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
              at ig.a(SourceFile:29) ~[server-24w40a.jar:?]
              at ig.execute(SourceFile:13) ~[server-24w40a.jar:?]
              at ia.a(SourceFile:8) ~[server-24w40a.jar:?]
              at hs.a(SourceFile:8) ~[server-24w40a.jar:?]
              at hw.a(SourceFile:107) ~[server-24w40a.jar:?]
              at ex.a(SourceFile:384) ~[server-24w40a.jar:?]
              at ex.a(SourceFile:314) ~[server-24w40a.jar:?]
              at ex.a(SourceFile:304) ~[server-24w40a.jar:?]
              at aqy.br(SourceFile:300) ~[server-24w40a.jar:?]
              at aqy.G(SourceFile:282) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.c(SourceFile:1080) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:953) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.y(SourceFile:713) ~[server-24w40a.jar:?]
              at net.minecraft.server.MinecraftServer.a(SourceFile:292) ~[server-24w40a.jar:?]
              at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
      Caused by: java.lang.NullPointerException
      

            boq [Mojang] Bartosz Bok
            Deoxyribonucleic Evans DorkOrc
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: