summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2012-09-03 21:44:18 -0500
committerEvilSeph <evilseph@gmail.com>2012-09-12 22:06:36 -0400
commit9a4b85c931741dbbb8c163c38d5d218974076115 (patch)
tree402a626c4041bf56078c73b5cf744db83178a44c /src
parent4c0dd6964eebbfb2a3dd3ab8abc0de790c2fef2a (diff)
downloadcraftbukkit-9a4b85c931741dbbb8c163c38d5d218974076115.tar
craftbukkit-9a4b85c931741dbbb8c163c38d5d218974076115.tar.gz
craftbukkit-9a4b85c931741dbbb8c163c38d5d218974076115.tar.lz
craftbukkit-9a4b85c931741dbbb8c163c38d5d218974076115.tar.xz
craftbukkit-9a4b85c931741dbbb8c163c38d5d218974076115.zip
[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.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/WorldServer.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index aad73324..16db56b4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -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