mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
[Bleeding] Avoid spawn checks on empty worlds. Fixes BUKKIT-2508
Change a server wide check for players to be world specific. Worlds without players will not spawn entities.
This commit is contained in:
parent
4c0dd6964e
commit
9a4b85c931
1 changed files with 1 additions and 1 deletions
|
@ -151,7 +151,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
|||
this.methodProfiler.a("mobSpawner");
|
||||
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
|
||||
long time = this.worldData.getTime();
|
||||
if ((this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.getServer().getHandle().players.size() > 0)) {
|
||||
if ((this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
|
||||
SpawnerCreature.spawnEntities(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L));
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
|
Loading…
Reference in a new issue