#dataconverter

1 messages · Page 1 of 1 (latest)

lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.20.2
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.20.2
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.20.3
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.20.3
lean narwhalBOT
lean narwhalBOT
#

ah, I see.
It is probably an issue almost only for me, as it breaks https://github.com/mircokroon/minecraft-world-downloader ability to get the correct blockstateid for leaves from worlds that are converted. This is due to minecraft --reports generation (https://github.com/mircokroon/minecraft-world-downloader/blob/master/src/main/java/game/data/registries/RegistryLoader.java#L135) returning blockstates with waterlogged property always present, and if it isnt present no id can be found and s...

lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: commands
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: commands
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: component-argument
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: component-argument
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.20.6
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.20.5
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: summon-command
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#

3138743 Update to 1.20.5-pre2 - Spottedleaf
b4681be Update to 1.20.5-rc2 - Spottedleaf
8849493 Custom command converter - Spottedleaf
31c84ba Add subversion to DATA_COMPONENTS command conve... - Spottedleaf
0583383 Add CommandArgumentUpgrader (#11) - jpenilla
ce5e022 Add itemstack parsing - Spottedleaf
59e1a03 Correctly retrieve lists without checking type - Spottedleaf
e83959c Add null check for missing filtered pages - Spottedleaf
e169d13 Null check sign messages for command converter - Spottedleaf

#
[PaperMC/DataConverter] branch deleted: dev/1.20.6
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: summon-command
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#

If there is a command that places a hopper with items in it for example, the items won't be converted to the item component format.

I noticed this with this command:
`/setblock -39 30 707 minecraft:hopper[enabled=true,facing=east]{Items:[{Count:41b,Slot:0b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ","italic":true,"color":"gray"}]','[{"text":"ƅɛhɪпժ ɫhɛ ɛпժlɛss ɫᴜппɛl.","italic":true,"color":"gray"}]'],Name:'[{"text":"🌊","italic":false,"color":"aqua"},{"text":" "},{"text":"Λզ","bold":true},{"text":"ᴜɑ","bold":true,"color":"dark_aqua"},{"text":" ","bold":true},{"text":"Δᴜ","bold":true,"color":"blue"},{"text":"sɫ","bold":true,"color":"dark_blue"},{"text":" ","bold":false,"color":"dark_blue"},{"text":"🌊","bold":false,"color":"dark_blue"}]'}}},{Count:1b,Slot:1b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":t...

lean narwhalBOT
#

Close #20

Adds support for block state argument from set and fill commands

Example input:

/setblock -39 30 707 minecraft:hopper[enabled=true,facing=east]{Items:[{Count:41b,Slot:0b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ","italic":true,"color":"gray"}]','[{"text":"ƅɛhɪпժ ɫhɛ ɛпժlɛss ɫᴜппɛl.","italic":true,"color":"gray"}]'],Name:'[{"text":"🌊","italic":false,"color":"aqua"},{"text":" "},{"text":"Λզ","bold":true},{"text":"ᴜɑ","bold":true,"color":"dark_aqua"},{"text":" ","bold":true},{"text":"Δᴜ","bold":true,"color":"blue"},{"text":"sɫ","bold":true,"color":"dark_blue"},{"text":" ","bold":false,"color":"dark_blue"},{"text":"🌊","bold":false,"color":"dark_blue"}]'}}},{Count:1b,Slot:1b,id:"minecraft:blue_dye",tag:{display:{Lore:['[{"text":"- gɾɑпɫs ɫhɛ gɪƒɫ oƒ ᴜпժɛɾɯɑɫɛɾ","italic":true,"color":"gray"}]','[{"text":"ɾɛsρɪɾɑɫɪoп oпcɛ gɪνɛп ɫo ɫhɛ shɾɪпɛ"...
lean narwhalBOT
lean narwhalBOT
#
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
            var regs = server.registryAccess();
            var reg = regs.registryOrThrow(Registries.BLOCK_ENTITY_TYPE);
            var blocks = regs.registryOrThrow(Registries.BLOCK);
            var builder = new StringBuilder();
            for (var entity : reg) {
                var id = reg.getKey(entity);
                for (var block : entity.validBlocks) {
                    if (!Objects.equals(id, blocks.getKey(block))) {
                        builder.append("\ncase \"").append(blocks.getKey(block)).append("\" -> \"").append(id).append('"').append(';');
                    }
                }
            }
            System.out.println(builder);
        });

with accessible field net/minecraft/world/level/block/entity/BlockEntityType validBlocks Ljava/util/Set; access widener, then used intellij's suggestions to group them

lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.21.2
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.21.3
#
[PaperMC/DataConverter] branch deleted: dev/1.21.2
#
[PaperMC/DataConverter] branch deleted: dev/1.21.3
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.21.4
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.21.4
lean narwhalBOT
#

In 1.20.5 Mojang also changed how extra data is specified for particles that need them. For example:
/particle minecraft:block netherrack -309 27.6 860 1 1 7 0.1 230
should become
/particle minecraft:block{block_state:"minecraft:netherrack"} -309 27.6 860 1 1 7 0.1 230

Currently this conversion does not take place. I know this is technically not an "item component" related change, but it would still be nice to have conversion for this.

lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.21.5
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: dev/1.21.6
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.21.5
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#

The logic attempts to parse the string representation of components for the flattening in 1.21.5.
In the below example, the component {"text":"",extra:["Hello\\n\\nthere"]} is parsed in an initial step into a NBTMapType.
This parsing however is not only top level, it also parses the entire extra array into a List and JsonPrimitive.
The single string component is then once again attempted to be "flattened" eventho it and its siblings were fully parsed from json in the initial parsing. This leads to a plain string being passed to the JsonParser, which promptly dies if the string does not comply with the json specs for an unquoted string literal (e.g. \n in the middle of a string)

1.21.4 itemstack /give @p written_book[written_book_content={title:"",author:"",pages:['{"text":"",extra:["Hello\\n\\nthere"]}']}] 1

[ca.spottedleaf.dataconverter.minecraft.versions.V4290] Failed to convert json to nbt: Hello

there
com.google.gson.JsonSyntaxException: com.google.gson.stream.Mal```...
lean narwhalBOT
#
[PaperMC/DataConverter] branch deleted: dev/1.21.6
lean narwhalBOT
lean narwhalBOT
#

Exception when upgrading 1.21.4 world on latest paper server.

Repro

Server must be run with --forceUpgrade for some reason.
repro.zip

Paper version

This server is running Paper version 1.21.6-DEV-HEAD@d7510ef (1970-01-01T00:00:00Z) (Implementing API version 1.21.6-R0.1-SNAPSHOT)

Stacktrace

[09:08:36 ERROR]: [ca.spottedleaf.dataconverter.minecraft.versions.V4290] Failed to convert json to nbt: Tricky Tracks
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setStrictness(Strictness.LENIENT) to accept malformed JSON at line 1 column 9 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json
        at com.google.gson.JsonParser.parseReader(JsonParser.java:116) ~[gson-2.11.0.jar:?]
        at com.google.gson.JsonParser.parseString(JsonParser.java:92) ~[gson-2.11.0.jar:?]
        at ca.spottedleaf.dataconverter.minecraft.versions.V4290$1.convert(V4290.java:235) ~[paper-1.21.6.jar:1.21.6-DEV-d7510ef]```...
lean narwhalBOT
lean narwhalBOT
#

Stack trace

https://mclo.gs/XtdkdPx

Plugin and Datapack List

Paper Plugins (4):
CraftBook5, HuskHomes, LiteEco
Bukkit Plugins (31):
ChunkSpawnerLimiter, Chunky, ColoredSigns, CommandBook, DiscordSRV, FarmControl, FlyingCarpet, LogBlock, LogBlockQuestioner, LuckPerms, LWC, mcMMO, Multiverse-Core, Multiverse-Portals, OpenInv, ProtocolLib, QuickShop-Hikari, RedstoneClockDetector, SignRewards, TitleManager, VanishNoPacket, Vault, VaultChatFormatter, ViaVersion, Votifier, WorldBorder, WorldEdit, WorldGuard, ZHorse

Actions to reproduce (if known)

No response

Paper version

This server is running Paper version 1.21.6-46-main@35b2c6e (2025-06-26T18:53:41Z) (Implementing API version 1.21.6-R0.1-SNAPSHOT)

Other

I haven't done force-upgrade recently. Not sure when last but it should be a few major versions ago.

lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#

Old stats files (likely from before the flattening?) don't seem to load properly.
A message like [18:17:02 WARN]: Invalid statistic in ./helloclan/stats/16b85949-5c9a-4611-b4b7-d70074984149.json: Don't know what minecraft:276 is (which might be from some plugin? but I replicated the general error on a clean server) pops up in console, and the stats file fails to load.

See that file for example:
16b85949-5c9a-4611-b4b7-d70074984149.json

Can reproduce a similar error by:

  1. putting that file in your world/stats folder
  2. Copying some player data file and giving it that UUID as its name
  3. Loading these stats, I used Debuggery with dserver getOfflinePlayer(UUID) 16b85949-5c9a-4611-b4b7-d70074984149 getStatistic(Statistic) PLAY_ONE_MINUTE

Tested on latest 1.21.8 Paper:

> version
[00:44:44 INFO]: Checking version, please wait...
[00:44:45 INFO]: This server is running Paper version 1.21.8-22-main@bf465e0 (2025-08-03T15:29:10Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
You are runnin```...
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
lean narwhalBOT
#

Related Mojira issue created (reproduced separately): https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-305352

Running a paper server. An item dropped on the ground from before 1.13 (so say 1.12.2). When loaded the following error is logged into the console.

chunk@[-1488, 1166]:
  [1]: Failed to decode value '"ellisbrewer"' from field 'Thrower': Not a list```

Item entities used to store the Thrower as a player name. Then on the 1.12 -> 1.13 update, they started storing as UUID L/M version. Though, searching the code, I cannot find a datafixer that dropped the old data.
https://minecraft.wiki/w/Java_Edition_1.13#:~:text=in%20each%20compound.-,thrower,-and

Then in the 1.15.2 -> 1.16 update. They convert the UUID L/M to the array of 4 Ints. (Data converter 2514)
https://minecraft.wiki/w/Java_Edition_1.16#:~:text=now%20much%20darker.-,uuids,...
lean narwhalBOT
#

In V4658.java - current line 118: convertInt(gameRules, "minecartMaxSpeed", "minecraft:max_minecart_speed"); There is a (correct) data converter for the experimental gamerule max_minecart_speed. Since it is only experimental, most servers do not even have this value set yet.
https://github.com/PaperMC/DataConverter/blob/c0a465e1eb785d1b348d4e4b3fc46ed6c64433ca/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4658.java#L118C17-L118C91

The problem is that the convertInt method sets an empty string as the value
https://github.com/PaperMC/DataConverter/blob/c0a465e1eb785d1b348d4e4b3fc46ed6c64433ca/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4658.java#L48

Causing the following server error log when loading a world that does not have this gamerule set in its world files.
[22:09:35 WARN]: Not a number missed input: {"minecraft:max_minecart_speed":""}
Inspecting the level.dat prior to running it through a 1.21.11 server shows that this gamerule was never se...

lean narwhalBOT
lean narwhalBOT
#

Noting that the Mojang issue was closed as "Won't Fix".
https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-305352

There was no further commentary on it. My take, is that non-essential conversion errors that 'just' result in one-time console spam is not considered worth dev time for such old versions. And I don't necessarily blame them for that perspective (if that is it).

The other possibility, is the desire to "keep" that invalid data around as long as possible, since they or 3rd parties that want to inject and save that data to a different location, instead of just throwing it away. Why change it to be discarded, when someone might want the data to stick around. (But it is getting discarded right now anyway...)

I am running the patch on our server and it tested fine when recreating the issue. Doesn't matter to me one way or the other whether this PR is merged. The only difference is no console errors; no data integrity is necessarily improved.

lean narwhalBOT
#

Noting the following as a follow-up. This Pull Request does have one flaw.

The error will still occur if a chunk was loaded after the DataVersion 2514, but loaded on a version before the codecs that make this error so strict.

chunk@[-1282, 1142][0]: Failed to decode value '"ellisbrewer"' from field 'Thrower': Not a list```

(the same error as before). When loading up that chunk before the latest loading, it shows to have been loaded in Minecraft version 1.19.2 (Data Version 3120).

So the "Proper" fix of cleaning up this data - is actually to remove this non-list of integers in a NEW or more new datafixer. Not necessarily the original fixer that messed things up.

As of right now, I am satisfied enough with the current state of my change. Acknowledging it does have a flaw...

Advise if anything in particular is desired on this....
lean narwhalBOT
#
[PaperMC/DataConverter] New branch created: ver/26.1
lean narwhalBOT