Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20 - Block States data is in incorrect order #757

Closed
matelgaard opened this issue Aug 19, 2023 · 2 comments · Fixed by #766
Closed

1.20 - Block States data is in incorrect order #757

matelgaard opened this issue Aug 19, 2023 · 2 comments · Fixed by #766

Comments

@matelgaard
Copy link
Contributor

In blocks.json, the list of states for various blocks is in incorrect order.

For example, the states for oak_door are listed in the order: "half", "facing", "open", "hinge", "powered"

{
"id": 195,
"displayName": "Oak Door",
"name": "oak_door",
"hardness": 3,
"resistance": 3,
"minStateId": 4590,
"maxStateId": 4653,
"states": [
{
"name": "half",
"type": "enum",
"values": [
"UPPER",
"LOWER"
],
"num_values": 2
},
{
"name": "facing",
"type": "direction",
"values": [
"NORTH",
"EAST",
"SOUTH",
"WEST"
],
"num_values": 4
},
{
"name": "open",
"type": "bool",
"num_values": 2
},
{
"name": "hinge",
"type": "enum",
"values": [
"LEFT",
"RIGHT"
],
"num_values": 2
},
{
"name": "powered",
"type": "bool",
"num_values": 2
}
],
"drops": [
689
],
"diggable": true,
"transparent": true,
"filterLight": 0,
"emitLight": 0,
"boundingBox": "block",
"stackSize": 64,
"material": "mineable/axe",
"defaultState": 4601
},

But in Minecraft, the actual order is: "facing", "half", "hinge", "open", "powered"

javaw_4N2FtKKm7L

This is breaking compatibility with e.g. prismarine-block's block.getProperties()

Other blocks that have an incorrect state order include trapdoors, fence gates, buttons, redstone and pistons.

Previous versions don't have the incorrect ordering, I checked versions between 1.16.0 - 1.19.4, and all of the blocks have the correct order.

@extremeheat
Copy link
Member

cc @u9g, do you know how the extractor for this works? Does it do any sorting or keep the vanilla order? Maybe we could add a test for this.

@u9g
Copy link
Member

u9g commented Aug 19, 2023

cc @u9g, do you know how the extractor for this works? Does it do any sorting or keep the vanilla order? Maybe we could add a test for this.

https://github.com/PrismarineJS/minecraft-data-generator-server/blob/83fca6907591ce30458334620bfd5386df6d8f98/src/main/java/dev/u9g/minecraftdatagenerator/generators/BlocksDataGenerator.java#L84

Might be worth looking at this with a debugger or even looking how the minecraft server does it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants