summaryrefslogtreecommitdiffstats
path: root/nms-patches/WorldServer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/WorldServer.patch')
-rw-r--r--nms-patches/WorldServer.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch
index bde040ab..bd17e446 100644
--- a/nms-patches/WorldServer.patch
+++ b/nms-patches/WorldServer.patch
@@ -223,21 +223,21 @@
@@ -128,9 +271,12 @@
}
- this.methodProfiler.a("spawner");
+ this.methodProfiler.enter("spawner");
- if (this.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
- this.spawnerCreature.a(this, this.allowMonsters, this.allowAnimals, this.worldData.getTime() % 400L == 0L);
-- this.getChunkProviderServer().a(this, this.allowMonsters, this.allowAnimals);
+- this.getChunkProvider().a(this, this.allowMonsters, this.allowAnimals);
+ // 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.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
+ this.spawnerCreature.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L);
-+ this.getChunkProviderServer().a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L));
++ this.getChunkProvider().a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L));
+ // CraftBukkit end
}
- this.methodProfiler.c("chunkSource");
+ this.methodProfiler.exitEnter("chunkSource");
@@ -160,6 +306,8 @@
- this.methodProfiler.e();
+ this.methodProfiler.exit();
this.an();
this.P = false;
+
@@ -413,7 +413,7 @@
WorldServer.a.warn("Unable to find spawn biome");
}
@@ -647,6 +848,7 @@
- ChunkProviderServer chunkproviderserver = this.getChunkProviderServer();
+ ChunkProviderServer chunkproviderserver = this.getChunkProvider();
if (chunkproviderserver.d()) {
+ org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit