diff options
author | EvilSeph <evilseph@gmail.com> | 2012-02-10 10:23:52 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-10 12:16:06 -0500 |
commit | 63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41 (patch) | |
tree | 72c18a521abb13b2bcb232ee9f3b0d4cd0316b2d /src/main/java/net | |
parent | c38fcb360a818c57d835b7942dd581e8471b0c26 (diff) | |
download | craftbukkit-63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41.tar craftbukkit-63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41.tar.gz craftbukkit-63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41.tar.lz craftbukkit-63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41.tar.xz craftbukkit-63b9ed9ab4ddd0adc424147a1c30f4d7f3f93d41.zip |
Added configurable animal and monster ticks per spawn setting.
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/World.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index bae74075..a065810f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -77,6 +77,8 @@ public class World implements IBlockAccess { public boolean allowMonsters; // CraftBukkit - private -> public public boolean allowAnimals; // CraftBukkit - private -> public private LongHashset chunkTickList; // CraftBukkit + public long ticksPerAnimalSpawns; // CraftBukkit + public long ticksPerMonsterSpawns; // CraftBukkit private int U; int[] H; private List V; @@ -148,6 +150,8 @@ public class World implements IBlockAccess { this.allowMonsters = true; this.allowAnimals = true; this.chunkTickList = new LongHashset(); // CraftBukkit + this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit + this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit this.U = this.random.nextInt(12000); this.H = new int['\u8000']; this.V = new ArrayList(); @@ -1722,8 +1726,9 @@ public class World implements IBlockAccess { // MethodProfiler.a("mobSpawner"); // CraftBukkit - not in production code // 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)) { - SpawnerCreature.spawnEntities(this, this.allowMonsters, this.allowAnimals && this.worldData.getTime() % 400L == 0L); + SpawnerCreature.spawnEntities(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L)); } // CraftBukkit end // MethodProfiler.b("chunkSource"); // CraftBukkit - not in production code |