Fill treasure boxes with loot, same probabilities as for stronghold
Fill treasure boxes with loot, same probabilities as for stronghold
treasures.

--- a/net/minecraft/mazemod/MazeNode.java
+++ b/net/minecraft/mazemod/MazeNode.java
@@ -36,6 +36,24 @@
 
     private boolean exit=false;
     private boolean treasure=false;
+
+    private static final StructurePieceTreasure[] treasureItems = (new StructurePieceTreasure[] {
+            new StructurePieceTreasure(Item.enderPearl.shiftedIndex, 0, 1, 1, 10),
+	    new StructurePieceTreasure(Item.diamond.shiftedIndex, 0, 1, 3, 3), 
+	    new StructurePieceTreasure(Item.ingotIron.shiftedIndex, 0, 1, 5, 10), 
+	    new StructurePieceTreasure(Item.ingotGold.shiftedIndex, 0, 1, 3, 5),
+	    new StructurePieceTreasure(Item.redstone.shiftedIndex, 0, 4, 9, 5),
+	    new StructurePieceTreasure(Item.bread.shiftedIndex, 0, 1, 3, 15),
+	    new StructurePieceTreasure(Item.appleRed.shiftedIndex, 0, 1, 3, 15),
+	    new StructurePieceTreasure(Item.pickaxeSteel.shiftedIndex, 0, 1, 1, 5),
+	    new StructurePieceTreasure(Item.swordSteel.shiftedIndex, 0, 1, 1, 5),
+	    new StructurePieceTreasure(Item.plateSteel.shiftedIndex, 0, 1, 1, 5), 
+            new StructurePieceTreasure(Item.helmetSteel.shiftedIndex, 0, 1, 1, 5), 
+	    new StructurePieceTreasure(Item.legsSteel.shiftedIndex, 0, 1, 1, 5),
+	    new StructurePieceTreasure(Item.bootsSteel.shiftedIndex, 0, 1, 1, 5),
+	    new StructurePieceTreasure(Item.appleGold.shiftedIndex, 0, 1, 1, 1)
+        });
+
 
     public MazeNode()
     { 
@@ -129,6 +147,8 @@
 	if(drawn) return;
 
 	drawn=true;
+
+	Random r=new Random();
 	
 	// Draw the corners
 	drawWall(world,pos.plus(new iVec3D(1,0,1)));
@@ -186,6 +206,16 @@
 					break;
 				    }	
 				world.setBlockAndMetadata(chestPos.x,chestPos.y,chestPos.z,Block.chest.blockID,direction);
+				
+				// Fill the treasure box with items
+				TileEntityChest chestEntity = (TileEntityChest)world.getBlockTileEntity(chestPos.x,chestPos.y,chestPos.z);
+				for(int j=0;j<3;j++) // Put in three items
+				    {
+					StructurePieceTreasure treasure=(StructurePieceTreasure)WeightedRandom.func_35735_a(r,treasureItems);
+					int k = treasure.field_35595_c + r.nextInt((treasure.field_35593_e - treasure.field_35595_c) + 1);
+					
+					chestEntity.setInventorySlotContents(r.nextInt(chestEntity.getSizeInventory()),new ItemStack(treasure.field_35596_a, k, treasure.field_35594_b));
+				    }
 				break;
 			    }
 		    }