Pokechu22 / Burger

A simple tool for picking out information from the minecraft JARs, primarily useful for developers.
https://b.wiki.vg
MIT License
83 stars 15 forks source link

>1.16 block properties are not always extracted correctly #23

Open Moondarker opened 3 years ago

Moondarker commented 3 years ago

Since 1.16 some blocks are just inheriting things like hardness and blast resistance from parent blocks, some examples are:

brick_stairs ... AbstractBlock.Properties.from(BRICKS) quartz_stairs ... AbstractBlock.Properties.from(QUARTZ_BLOCK) cobblestone_wall ... AbstractBlock.Properties.from(COBBLESTONE) granite_slab ... AbstractBlock.Properties.from(GRANITE) gilded_blackstone ... AbstractBlock.Properties.from(BLACKSTONE)

Complete list of affected properties: material, hardness, resistance, blocksMovement, ticksRandomly, lightLevel, blockColors, soundType, slipperiness, speedFactor, variableOpacity, isSolid, isAir, requiresTool

All these blocks lose inherited properties in burger output, I'd love to fix it myself, but I'm not experienced enough to make burger follow such method calls and extract parents properties :( Thanks for the great tools, Pokechu and contributors!

Pokechu22 commented 3 years ago

Versions prior to 1.16 also do a similar thing (for instance, MCP names, public static final Block BRICK_STAIRS = register("brick_stairs", new StairsBlock(BRICKS.getDefaultState(), Block.Properties.from(BRICKS))); from circa 1.14), which I think is handled by this code (but I'm not 100% sure):

https://github.com/Pokechu22/Burger/blob/fd0f3a5d87ce999d52de31f88869f554366619e3/burger/toppings/blocks.py#L360-L370

I'm not sure why that wouldn't be working now.

Moondarker commented 3 years ago

Whoops, I didn't notice that there was similar code in <=1.15, looks like they just made an abstract class and moved most of stuff previously done in class Block to abstract class AbstractBlock, including method /*Abstract*/Block.Properties.from(/*Abstract*/Block blockIn)

I'm not sure why wouldn't it work, signatures should look pretty similar, but again, I can only guess based on Burger's output and MCP-mapped Minecraft code :(