Property-based BlockData
dfsek opened this issue ยท 0 comments
Use a property-based approach to Block Data, rather than the current inheritance-based approach.
E.G. instead of having Waterlogged
, Stairs
, Slab
interfaces, have a BlockData
interface that can contain properties such as waterlogged
, slab_half
, etc. These properties would be accessed via a @NotNull getProperty(Class<? extends Property>)
method. To avoid having to do null checking, all properties would use a null-object pattern to specify that the property is unspecified. The hasProperty(Class<? extends Property>)
can then simply check if the property's value is a null-object.
This would allow for more platform-independence, since if some platforms have additional properties we can simply implement them on the platform. It also would allow the Fabric implementation to be completely mixin-ified, as currently the only thing on Fabric that is not mixin-ified is block data, because of how Minecraft handles properties.