-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Block Collision Boxes #258
Comments
I've been playing around with extracting collision box data for 1.12.2, 1.14.4, and 1.15 and came up with this data format as a compromise between file size and consumer implementation simplicity: {
"blocks": {
blockId: shapeId, // all block states have same shape -> just the shapeId
blockId: [ shapeId, ... ], // at least one state's shape different from others
// -> different shapeIds, indexed by stateId
...
},
"shapes": {
shapeId: [[xMin,yMin,zMin, xMax,yMax,zMax], ...], // e.g., the shape of a corner stair
shapeId: [[xMin,yMin,zMin, xMax,yMax,zMax], ...], // e.g., the shape of an upside-down corner stair
...
},
} The extractor is based on Fabric client mod API and also includes a sample implementation of how to consume the JSON and provide a |
+1 for this, I'm consuming a lot of minecraft-data with mcd2c and having some sort of easily consumable model data is going to be next on my list. The proposed json format is simple enough to translate into to a binary mesh so it works for me. |
This seems pretty good indeed |
Extracting 1.12.2 blocks was a bit tricky but it's done now (source), and personally I don't need any data older than that. 1.12.2 and older versions have the downside that collision boxes for a block of given (id:meta) additionally depend on adjacent blocks (e.g., cobblestone walls change their collision box if there's a solid block to N/S/E/W/above), so this dataset assumes the block is surrounded by air; this is the best that I can do without encoding the full logic for these special cases somehow. If you consider this useful I can open a PR with the 1.12.2, 1.14.4, and 1.15 collision boxes as linked in the first comment. Do you need a schema to go with that? |
A valid schema would be needed for the tests to succeed, but just providing the data would be nice, someone else can take care of the schema. ;P |
Yeah it would be useful |
Minecraft-Data should provide collision box data for each block.
A use case is implementing client physics or server entity pathfinding, for example PrismarineJS/mineflayer#228 or Gjum/Botlin#4.
This might go together with #52 and/or #83 but since the collision box data is so much it might be better to keep it in a separate file.
The text was updated successfully, but these errors were encountered: