use of org.bukkit.event.world.SpawnChangeEvent in project Glowstone by GlowstoneMC.
the class GlowWorld method setSpawnLocation.
/**
* Sets the spawn location of the world.
*
* @param newSpawn the new spawn location
* @param anchor if true, the spawn is never unloaded while the world is running
* @return true if the spawn location has changed
*/
public boolean setSpawnLocation(Location newSpawn, boolean anchor) {
Location oldSpawn = spawnLocation;
if (newSpawn.equals(oldSpawn)) {
return false;
}
spawnLocation = newSpawn;
if (anchor) {
setKeepSpawnInMemory(keepSpawnLoaded);
}
EventFactory.getInstance().callEvent(new SpawnChangeEvent(this, oldSpawn));
return true;
}
Aggregations