Added a random monster spawner to the mazes. Same probabilities as for
Added a random monster spawner to the mazes. Same probabilities as for
dungeons.

--- a/net/minecraft/mazemod/Maze.java
+++ b/net/minecraft/mazemod/Maze.java
@@ -77,6 +77,11 @@
 	MazeNode treasureNode=ends.remove(treasureIdx);
 	treasureNode.setTreasure(true);
 
+	// Pick a spanwer box
+	int spawnerIdx=r.nextInt(ends.size());
+	MazeNode spawnerNode=ends.remove(spawnerIdx);
+	spawnerNode.setSpawner(true);	
+
     }
 
     private void generate()

--- a/net/minecraft/mazemod/MazeNode.java
+++ b/net/minecraft/mazemod/MazeNode.java
@@ -36,6 +36,7 @@
 
     private boolean exit=false;
     private boolean treasure=false;
+    private boolean spawner=false;
 
     private static final StructurePieceTreasure[] treasureItems = (new StructurePieceTreasure[] {
             new StructurePieceTreasure(Item.enderPearl.shiftedIndex, 0, 1, 1, 10),
@@ -113,6 +114,11 @@
 	this.treasure=treasure;
     }
 
+    public void setSpawner(boolean spawner)
+    {
+	this.spawner=spawner;
+    }
+
     public void generate()
     {
 	visited=true;
@@ -220,6 +226,18 @@
 			    }
 		    }
 	    }
+
+	// Draw the spawners
+	if(spawner)
+	    {
+		iVec3D spawnerPos=pos.plus(new iVec3D(0,1,0));
+		world.setBlockWithNotify(spawnerPos.x,spawnerPos.y,spawnerPos.z,Block.mobSpawner.blockID);
+
+		// Pick a monster type
+		TileEntityMobSpawner mobSpawnerEntity = (TileEntityMobSpawner)world.getBlockTileEntity(spawnerPos.x,spawnerPos.y,spawnerPos.z);
+		mobSpawnerEntity.setMobID(pickMobSpawner(r));
+
+	    }
     }
 
     public void drawGround(World world,iVec3D pos)
@@ -251,4 +269,30 @@
 		world.setBlock(pos.x,y,pos.z,Block.stone.blockID);
 
     }
+
+    // Source: WorldGenDungeons class
+    private String pickMobSpawner(Random random)
+    {
+        int i = random.nextInt(4);
+        if(i == 0)
+        {
+            return "Skeleton";
+        }
+        if(i == 1)
+        {
+            return "Zombie";
+        }
+        if(i == 2)
+        {
+            return "Zombie";
+        }
+        if(i == 3)
+        {
+            return "Spider";
+        } else
+        {
+            return "";
+        }
+    }
+
 }