-
Bug
-
Resolution: Fixed
-
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
- Create a world in 1.15.2 and teleport to a village; or use the attached world MC-197883.zip
- 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.