McJty / YouTubeModding14

Source code for my YouTube modding tutorial series for Minecraft 1.15 and 1.16
MIT License
107 stars 35 forks source link

Properties should not be created in the block class #11

Open LukeGi opened 4 years ago

LukeGi commented 4 years ago

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: https://github.com/McJty/YouTubeModding14/blob/513b17928b94af66c667babcef4fe2fa43aa191b/src/main/java/com/mcjty/mytutorial/blocks/FirstBlock.java#L36-L39

LukeGi commented 4 years ago

The same is true for Items. See: https://github.com/McJty/YouTubeModding14/blob/513b17928b94af66c667babcef4fe2fa43aa191b/src/main/java/com/mcjty/mytutorial/items/FirstItem.java#L18-L20