docs: add more comments

This commit is contained in:
Martin Prokoph
2025-02-03 17:15:57 +01:00
parent 693c389e3f
commit c813274a6c
8 changed files with 158 additions and 58 deletions

View File

@@ -32,6 +32,14 @@ public:
registerBlock(SAND);
}
/**
* Gets a block by its encoding.
*
* If the block is not registered, a non-solid decoration block is created for it.
*
* @param encoding The encoding of the block to get.
* @return The block with the given encoding.
*/
const Block getByEncoding(char encoding) {
for (Block block : registeredBlocks) {
if (block.getEncoding() == encoding) return block;