Skip to content
Success

Changes

Summary

  1. #914: Add World#spawn with randomizeData parameter (details)
Commit 18027d02396873ce97258c2985ef8505523962bf by md_5
#914: 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.
The file was modifiedsrc/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java