Capabilities and goggle information expanded to blocks #9700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Capabilities
Since 20.3 neoforge capabilities are not anymore block-entity related, but can be also queried on normal blocks. I know it's a very advanced topic and won't affect 90% of mods because almost every fluid/item providing block is always attached with a block entity, but I was working on a create addon when encountered this issue, so I was hoping to solve this without several bad-looking mixins in my mod.
Goggle information
The second idea is to allow blocks to extend IHaveGoggleInformation. This allows to remove the special case for piston extension poles which are hard coded and allow any developer to implement the interface on blocks, rather than requiring a block entity. A new method has been added to the IHaveGoggleInformation interface to pass world data (block state, block position and level) when creating the goggle tooltip
Thanks for reading, have a nice day ;)