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

Jigsaw Structures causing DataFixer spam

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w11a
    • 1.16.2
    • None
    • Confirmed
    • Structures, World generation
    • Normal

      The bug

      Similar to MC-191388 but a new issue (this is a not a duplicate or a "wasn't fixed correctly" - this is a new issue)

      Jigsaw World Gen Features is triggering codec errors like the following:

       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[\{name:"minecraft:no_op",config:{}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[{name:"minecraft:block_pile",config:{stat
       e_provider:{state:{Properties:{axis:"y"},Name:"minecraft:hay_block"},type:"minecraft:simple_state_provider"}}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[\{name:"minecraft:no_op",config:{}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[{name:"minecraft:block_pile",config:{stat
       e_provider:{state:{Properties:{axis:"y"},Name:"minecraft:hay_block"},type:"minecraft:simple_state_provider"}}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[\{name:"minecraft:no_op",config:{}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[{name:"minecraft:flower",config:{tries:64
       ,yspread:3,xspread:7,need_water:0b,zspread:7,blacklist:[L;],project:1b,block_placer:{type:"minecraft:simple_block_placer"},state_provider:{type:"minecraft:plain_flower_provider"},whitelist:[L;],can_replace:0b}}]
       [19:34:04] [Server thread/ERROR]: Input does not contain a key [type]: MapLike[\{name:"minecraft:no_op",config:{}}]
      

      Using Spigot/Paper mappings, the callstack of where this is triggered is
      https://gist.github.com/aikar/56b0c2beff6d8c70e18893a72889eb76

      Code triggering it is this:

      this.b = new BlockPosition(nbttagcompound.getInt("PosX"), nbttagcompound.getInt("PosY"), nbttagcompound.getInt("PosZ"));
      this.e = nbttagcompound.getInt("ground_level_delta");
      DataResult dataresult = WorldGenFeatureDefinedStructurePoolStructure.e.parse(DynamicOpsNBT.a, nbttagcompound.getCompound("pool_element"));
      

      Unsure about data corruption, but can be spammy.

      Reproduction steps

      1. Create a world in 1.15.2 and teleport to a village; or use the attached world MC-197883.zip
      2. Open the world in the latest version
        Multiple errors are logged

      Root Cause

      The Root Cause is that there are items in the FEATURE registry that are specifying "name" as their identifier instead of "type", and these are mixed into the same collection.

       

      This code in Spigot mappings is the source point:

       

      public class WorldGenFeatureConfigured<FC extends WorldGenFeatureConfiguration, F extends WorldGenerator<FC>> implements IDecoratable<WorldGenFeatureConfigured<?, ?>> {
          public static final Codec<WorldGenFeatureConfigured<?, ?>> a = IRegistry.FEATURE.dispatch((worldgenfeatureconfigured) -> {
              return worldgenfeatureconfigured.e;
          }, WorldGenerator::a);
          public static final Codec<Supplier<WorldGenFeatureConfigured<?, ?>>> b = RegistryFileCodec.a(IRegistry.au, WorldGenFeatureConfigured.a);
          public static final Codec<List<Supplier<WorldGenFeatureConfigured<?, ?>>>> c = RegistryFileCodec.b(IRegistry.au, WorldGenFeatureConfigured.a);
          public static final Logger LOGGER = LogManager.getLogger(); 

       

      Changing this to .dispatch("name", (....

       

      Fixes the errors for the ones listed in the ticket, however then breaks every thing using type.

      The data sets need to be updated to consistently use type.

        1. 2020-10-28_01.37.48.png
          2020-10-28_01.37.48.png
          127 kB
        2. MC-197883.zip
          4.39 MB
        3. Screenshot (1).png
          Screenshot (1).png
          174 kB
        4. villages-messed-up.png
          villages-messed-up.png
          2.73 MB

            Unassigned Unassigned
            aikar Aikar
            Votes:
            43 Vote for this issue
            Watchers:
            26 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: