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

Properties should not be created in the block class #11

Open
LukeGi opened this issue Jun 25, 2020 · 1 comment
Open

Properties should not be created in the block class #11

LukeGi opened this issue Jun 25, 2020 · 1 comment

Comments

@LukeGi
Copy link

LukeGi commented Jun 25, 2020

It is not best practice to create properties in the block class. You should instead pass properties to the constructor when creating the block.
By doing this you allow for other mods to potentially extend the block, may not be applicable here but it is still not good to demonstrate bad practices.
See:

super(Properties.create(Material.IRON)
.sound(SoundType.METAL)
.hardnessAndResistance(2.0f)
.lightValue(14)

@LukeGi
Copy link
Author

LukeGi commented Jun 25, 2020

The same is true for Items.
See:

super(new Item.Properties()
.maxStackSize(1)
.group(ModSetup.ITEM_GROUP));

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

1 participant