#653: Add World#spawn with randomizeData parameter (details)
by md_5 (md_5)
#653: Add World#spawn with randomizeData parameter
The current implementation of World#spawn or World#spawnEntity respectively, always prepares/finalizes the spawn of every entity spawned through the API. While this is great to simulate natural spawning of entities in the world through the API, it fails at reliably creating default entities for purposes other than vanilla gameplay.
While the caller of the API could attempt to undo all of the customization that is applied in the prepare/finalization step, they are numerous (reaching from sheep colour to equipment) and in some cases, such as the chicken jockey, even spawn in other entities.
Hence this commit introduces a new overload to the World#spawn and World#spawnEntity methods that accepts the 'randomizeData' parameter that, when set to false, skips the prior mentioned preparation/finalization step.