From cb7b82d452817ea5a1d404d380d5e919bf35fe96 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sun, 19 Jun 2011 06:09:05 -0400 Subject: [PATCH] Added API to allow plugins to set the world's spawn flags. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 0a1c9d3059..2695e22750 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -765,4 +765,16 @@ public class CraftWorld implements World { public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTempRain) { return CraftChunk.getEmptyChunkSnapshot(x, z, this, includeBiome, includeBiomeTempRain); } + + public void setSpawnFlags(boolean allowMonsters, boolean allowAnimals) { + world.setSpawnFlags(allowMonsters, allowAnimals); + } + + public boolean getAllowAnimals() { + return world.allowAnimals; + } + + public boolean getAllowMonsters() { + return world.allowMonsters; + } }