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.16 block properties are not always extracted correctly #23

Open
Moondarker opened this issue Mar 22, 2021 · 2 comments
Open

>1.16 block properties are not always extracted correctly #23

Moondarker opened this issue Mar 22, 2021 · 2 comments

Comments

@Moondarker
Copy link

Moondarker commented Mar 22, 2021

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
Copy link
Owner

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):

elif const.class_.name == builder_class:
if desc.args[0].name == superclass: # Copy constructor
copy = dict(args[0])
del copy["text_id"]
del copy["numeric_id"]
del copy["class"]
if "display_name" in copy:
del copy["display_name"]
return copy
else:
return {} # Append current block

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

@Moondarker
Copy link
Author

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 :(

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

No branches or pull requests

2 participants