Gets a chunk and casts it to the specified custom chunk type.
Gets a chunk and casts it to the specified custom chunk type.
- Template Parameters
-
| T | The custom chunk type (must inherit from Chunk). |
- Parameters
-
| id | The chunk ID to retrieve. |
- Returns
- A shared_ptr to the chunk cast to type T.
- Note
- This is a convenience method that performs a static_pointer_cast internally. If the chunk doesn't exist, returns nullptr. customChunk = world->getChunkAs<MyCustomChunk>(chunkID);