YouTubeModding14 icon indicating copy to clipboard operation
YouTubeModding14 copied to clipboard

Properties should not be created in the block class

Open Iuhegi opened this issue 5 years ago • 1 comments

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

Iuhegi avatar Jun 25 '20 13:06 Iuhegi

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

Iuhegi avatar Jun 25 '20 13:06 Iuhegi