mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-21 23:33:48 -07:00
@@ -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
|
||||
|
Reference in New Issue
Block a user