Restructured the files.
Restructured the files.

--- /dev/null
+++ b/net/minecraft/mazemod/ItemMazePaper.java
@@ -1,1 +1,211 @@
-
+/* This file is part of the Maze Mod
+ *
+ *
+ * Maze Mod is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Maze Mod is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.minecraft.src;
+
+import java.util.Stack;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Random;
+
+public class ItemMazePaper extends Item
+{
+    private int wallBlockID;
+    private int halfWidth;
+
+    public ItemMazePaper(int i)
+    {
+	super(i);
+	maxStackSize=1;
+
+	wallBlockID=Block.leaves.blockID;
+	halfWidth=20;
+    }
+
+    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
+    {
+	if(!entityplayer.capabilities.depleteBuckets)
+	    {
+		itemstack.stackSize--;
+	    }
+
+	int iPosX=(int)entityplayer.posX;
+	int iPosY=(int)entityplayer.posY;
+	int iPosZ=(int)entityplayer.posZ;
+	generateMaze(world,iPosX,iPosY-2,iPosZ);
+
+	return itemstack;
+    }
+
+    private void generateMaze(World world,int iPosX, int iPosY, int iPosZ)
+    {
+	//System.out.println("Generate maze at "+iPosX+" "+iPosY+" "+iPosZ);
+
+	// Generate a base for the maze
+	for(int  dx=-halfWidth;dx<=halfWidth;dx++)
+	    {
+		for(int dz=-halfWidth;dz<=halfWidth;dz++)
+		    {
+			// Top is dirt
+			world.setBlockWithNotify(iPosX+dx,iPosY,iPosZ+dz,Block.grass.blockID);
+			// Everything below is stone
+			for(int y=0;y<iPosY;y++)
+			    world.setBlock(iPosX+dx,y,iPosZ+dz,Block.stone.blockID);
+			// Everything two stacks above is leaves
+			world.setBlock(iPosX+dx,iPosY+1,iPosZ+dz,wallBlockID);
+
+			// Everything above is air
+			for(int y=iPosY+2;y<254;y++)
+			    world.setBlock(iPosX+dx,y,iPosZ+dz,0);
+
+		    }
+	    }
+
+	// Generate the actual maze recursively using depth-first algorithm
+	Stack<iVec3D> stack=new Stack<iVec3D>();
+	iVec3D start=new iVec3D(iPosX,iPosY+1,iPosZ);
+	mazeGen(world,start,stack);
+	
+	// Clear a starting area
+	for(int dx=-3;dx<=3;dx++)
+	    {
+		for(int dz=-3;dz<=3;dz++)
+		    {
+			world.setBlockWithNotify(iPosX+dx,iPosY+1,iPosZ+dz,0);
+			world.setBlockWithNotify(iPosX+dx,iPosY+2,iPosZ+dz,0);
+		    }
+	    }
+
+	// Pick an exit
+	boolean foundExit=false;
+	Random r=new Random();
+	while(!foundExit)
+	    {
+		int exitSide=r.nextInt(4);
+		int exitDist=r.nextInt(halfWidth*2-1)-halfWidth;
+
+		iVec3D needSpaceAt;
+		iVec3D exitPos;
+		switch(exitSide)
+		    {
+		    case 0:
+			exitPos=start.plus(new iVec3D(halfWidth,0,exitDist));
+			needSpaceAt=exitPos.plus(new iVec3D(-1,0,0));
+			break;
+		    case 1:
+			exitPos=start.plus(new iVec3D(-halfWidth,0,exitDist));
+			needSpaceAt=exitPos.plus(new iVec3D(1,0,0));
+			break;
+		    case 2:
+			exitPos=start.plus(new iVec3D(exitDist,0,halfWidth));
+			needSpaceAt=exitPos.plus(new iVec3D(0,0,-1));
+			break;
+		    case 3:
+		    default:
+			exitPos=start.plus(new iVec3D(exitDist,0,-halfWidth));
+			needSpaceAt=exitPos.plus(new iVec3D(0,0,1));
+			break;
+		    }
+		
+		if(world.getBlockId(needSpaceAt.iPosX,needSpaceAt.iPosY,needSpaceAt.iPosZ)!=wallBlockID)
+		    {
+			foundExit=true;
+			world.setBlock(exitPos.iPosX,exitPos.iPosY,exitPos.iPosZ,0);
+		    }
+	    }
+
+	// Generate the higher walls for the maze
+	for(int  dx=-halfWidth;dx<=halfWidth;dx++)
+	    {
+		for(int dz=-halfWidth;dz<=halfWidth;dz++)
+		    {
+			if(world.getBlockId(iPosX+dx,iPosY+1,iPosZ+dz)==wallBlockID)
+			    {	
+				world.setBlockWithNotify(iPosX+dx,iPosY+2,iPosZ+dz,wallBlockID);
+				world.setBlockWithNotify(iPosX+dx,iPosY+3,iPosZ+dz,wallBlockID);
+				if(wallBlockID==Block.leaves.blockID) // Add wooden base for leaves to prevent decay
+				    world.setBlockWithNotify(iPosX+dx,iPosY,iPosZ+dz,Block.wood.blockID);
+			    }
+		    }
+	    }
+    }
+    
+    private void mazeGen(World world,iVec3D pos,Stack<iVec3D> stack)
+    {
+	stack.push(pos);
+
+	// Create a list of available neighbors
+	if(isUnvisited(world, pos))
+	    {
+		world.setBlock(pos.iPosX,pos.iPosY,pos.iPosZ,0);
+
+		List<iVec3D> neighbors=new LinkedList<iVec3D>();
+		neighbors.add(new iVec3D(1,0,0));
+		neighbors.add(new iVec3D(-1,0,0));
+		neighbors.add(new iVec3D(0,0,1));
+		neighbors.add(new iVec3D(0,0,-1));
+		Random r=new Random();
+		while(!neighbors.isEmpty())
+		    {
+			int nextIdx=r.nextInt(neighbors.size());
+			iVec3D nextDir=neighbors.remove(nextIdx);
+			iVec3D nextWall=pos.plus(nextDir);
+			iVec3D nextPos=nextWall.plus(nextDir);
+			if(world.getBlockId(nextPos.iPosX,nextPos.iPosY,nextPos.iPosZ)==wallBlockID)
+			    {
+				mazeGen(world,nextPos,stack);
+				world.setBlock(nextWall.iPosX,nextWall.iPosY,nextWall.iPosZ,0);
+			    }
+		    }
+	    }
+	
+	stack.pop();
+    }
+
+    private boolean isUnvisited(World world,iVec3D pos)
+    {
+	int problems=0;
+	// Definitely visited if is already set
+	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ)!=wallBlockID)
+	    problems++;
+
+	// There will always be at most entrance, so one visited neighbor
+	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
+	    problems++;
+
+	// Make sure that there is nothing on the diagonals
+	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
+	    problems++;
+	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
+	    problems++;
+
+	if(problems>0)
+	    return false;
+	else
+	    return true;
+    }
+}

--- /dev/null
+++ b/net/minecraft/mazemod/iVec3D.java
@@ -1,1 +1,43 @@
+/* This file is part of the Maze Mod
+ *
+ *
+ * Maze Mod is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Maze Mod is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
+package net.minecraft.src;
+
+class iVec3D
+{
+    public int iPosX;
+    public int iPosY;
+    public int iPosZ;
+
+    public iVec3D(int iPosX,int iPosY, int iPosZ)
+    {
+	this.iPosX=iPosX;
+	this.iPosY=iPosY;
+	this.iPosZ=iPosZ;
+    }
+
+    public iVec3D plus(iVec3D other)
+    {
+	iVec3D result=new iVec3D(iPosX+other.iPosX,iPosY+other.iPosY,iPosZ+other.iPosZ);
+	return result;
+    }
+
+    public String toString()
+    {
+	return iPosX+" "+iPosY+" "+iPosZ;
+    }
+}

--- /dev/null
+++ b/net/minecraft/mazemod/mod_Maze.java
@@ -1,1 +1,47 @@
+/* This file is part of the Maze Mod
+ *
+ *
+ * Maze Mod is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Maze Mod is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
+package net.minecraft.src;
+
+public class mod_Maze extends BaseMod
+{
+    public static Item mazePaper;
+
+    public mod_Maze()
+    { }
+
+    public void load()
+    {
+	// Add maze paper
+	int overrideID = ModLoader.addOverride("/gui/items.png","/gui/Item_mazePaper.png");
+	mazePaper=(new ItemMazePaper(ModLoader.getUniqueEntityId())).setIconIndex(overrideID).setFull3D().setItemName("mazePaper");
+	ModLoader.AddName(mod_Maze.mazePaper,"Maze Paper");
+	
+	// Add the recipes for the new items
+	CraftingManager recipes=CraftingManager.getInstance();
+
+	recipes.addRecipe(new ItemStack(mod_Maze.mazePaper, 1),
+			  new Object[] { "XXX", "X#X","XXX", Character.valueOf('X'), Item.paper,
+					 Character.valueOf('#'), Block.torchWood });
+
+    }
+
+    public String getVersion()
+    {
+	return "0.1";
+    }
+}

--- a/net/minecraft/src/ItemMazePaper.java
+++ /dev/null
@@ -1,211 +1,1 @@
-/* This file is part of the Maze Mod
- *
- *
- * Maze Mod is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Maze Mod is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
- */
 
-package net.minecraft.src;
-
-import java.util.Stack;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Random;
-
-public class ItemMazePaper extends Item
-{
-    private int wallBlockID;
-    private int halfWidth;
-
-    public ItemMazePaper(int i)
-    {
-	super(i);
-	maxStackSize=1;
-
-	wallBlockID=Block.leaves.blockID;
-	halfWidth=20;
-    }
-
-    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
-    {
-	if(!entityplayer.capabilities.depleteBuckets)
-	    {
-		itemstack.stackSize--;
-	    }
-
-	int iPosX=(int)entityplayer.posX;
-	int iPosY=(int)entityplayer.posY;
-	int iPosZ=(int)entityplayer.posZ;
-	generateMaze(world,iPosX,iPosY-2,iPosZ);
-
-	return itemstack;
-    }
-
-    private void generateMaze(World world,int iPosX, int iPosY, int iPosZ)
-    {
-	//System.out.println("Generate maze at "+iPosX+" "+iPosY+" "+iPosZ);
-
-	// Generate a base for the maze
-	for(int  dx=-halfWidth;dx<=halfWidth;dx++)
-	    {
-		for(int dz=-halfWidth;dz<=halfWidth;dz++)
-		    {
-			// Top is dirt
-			world.setBlockWithNotify(iPosX+dx,iPosY,iPosZ+dz,Block.grass.blockID);
-			// Everything below is stone
-			for(int y=0;y<iPosY;y++)
-			    world.setBlock(iPosX+dx,y,iPosZ+dz,Block.stone.blockID);
-			// Everything two stacks above is leaves
-			world.setBlock(iPosX+dx,iPosY+1,iPosZ+dz,wallBlockID);
-
-			// Everything above is air
-			for(int y=iPosY+2;y<254;y++)
-			    world.setBlock(iPosX+dx,y,iPosZ+dz,0);
-
-		    }
-	    }
-
-	// Generate the actual maze recursively using depth-first algorithm
-	Stack<iVec3D> stack=new Stack<iVec3D>();
-	iVec3D start=new iVec3D(iPosX,iPosY+1,iPosZ);
-	mazeGen(world,start,stack);
-	
-	// Clear a starting area
-	for(int dx=-3;dx<=3;dx++)
-	    {
-		for(int dz=-3;dz<=3;dz++)
-		    {
-			world.setBlockWithNotify(iPosX+dx,iPosY+1,iPosZ+dz,0);
-			world.setBlockWithNotify(iPosX+dx,iPosY+2,iPosZ+dz,0);
-		    }
-	    }
-
-	// Pick an exit
-	boolean foundExit=false;
-	Random r=new Random();
-	while(!foundExit)
-	    {
-		int exitSide=r.nextInt(4);
-		int exitDist=r.nextInt(halfWidth*2-1)-halfWidth;
-
-		iVec3D needSpaceAt;
-		iVec3D exitPos;
-		switch(exitSide)
-		    {
-		    case 0:
-			exitPos=start.plus(new iVec3D(halfWidth,0,exitDist));
-			needSpaceAt=exitPos.plus(new iVec3D(-1,0,0));
-			break;
-		    case 1:
-			exitPos=start.plus(new iVec3D(-halfWidth,0,exitDist));
-			needSpaceAt=exitPos.plus(new iVec3D(1,0,0));
-			break;
-		    case 2:
-			exitPos=start.plus(new iVec3D(exitDist,0,halfWidth));
-			needSpaceAt=exitPos.plus(new iVec3D(0,0,-1));
-			break;
-		    case 3:
-		    default:
-			exitPos=start.plus(new iVec3D(exitDist,0,-halfWidth));
-			needSpaceAt=exitPos.plus(new iVec3D(0,0,1));
-			break;
-		    }
-		
-		if(world.getBlockId(needSpaceAt.iPosX,needSpaceAt.iPosY,needSpaceAt.iPosZ)!=wallBlockID)
-		    {
-			foundExit=true;
-			world.setBlock(exitPos.iPosX,exitPos.iPosY,exitPos.iPosZ,0);
-		    }
-	    }
-
-	// Generate the higher walls for the maze
-	for(int  dx=-halfWidth;dx<=halfWidth;dx++)
-	    {
-		for(int dz=-halfWidth;dz<=halfWidth;dz++)
-		    {
-			if(world.getBlockId(iPosX+dx,iPosY+1,iPosZ+dz)==wallBlockID)
-			    {	
-				world.setBlockWithNotify(iPosX+dx,iPosY+2,iPosZ+dz,wallBlockID);
-				world.setBlockWithNotify(iPosX+dx,iPosY+3,iPosZ+dz,wallBlockID);
-				if(wallBlockID==Block.leaves.blockID) // Add wooden base for leaves to prevent decay
-				    world.setBlockWithNotify(iPosX+dx,iPosY,iPosZ+dz,Block.wood.blockID);
-			    }
-		    }
-	    }
-    }
-    
-    private void mazeGen(World world,iVec3D pos,Stack<iVec3D> stack)
-    {
-	stack.push(pos);
-
-	// Create a list of available neighbors
-	if(isUnvisited(world, pos))
-	    {
-		world.setBlock(pos.iPosX,pos.iPosY,pos.iPosZ,0);
-
-		List<iVec3D> neighbors=new LinkedList<iVec3D>();
-		neighbors.add(new iVec3D(1,0,0));
-		neighbors.add(new iVec3D(-1,0,0));
-		neighbors.add(new iVec3D(0,0,1));
-		neighbors.add(new iVec3D(0,0,-1));
-		Random r=new Random();
-		while(!neighbors.isEmpty())
-		    {
-			int nextIdx=r.nextInt(neighbors.size());
-			iVec3D nextDir=neighbors.remove(nextIdx);
-			iVec3D nextWall=pos.plus(nextDir);
-			iVec3D nextPos=nextWall.plus(nextDir);
-			if(world.getBlockId(nextPos.iPosX,nextPos.iPosY,nextPos.iPosZ)==wallBlockID)
-			    {
-				mazeGen(world,nextPos,stack);
-				world.setBlock(nextWall.iPosX,nextWall.iPosY,nextWall.iPosZ,0);
-			    }
-		    }
-	    }
-	
-	stack.pop();
-    }
-
-    private boolean isUnvisited(World world,iVec3D pos)
-    {
-	int problems=0;
-	// Definitely visited if is already set
-	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ)!=wallBlockID)
-	    problems++;
-
-	// There will always be at most entrance, so one visited neighbor
-	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
-	    problems++;
-
-	// Make sure that there is nothing on the diagonals
-	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX+1,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ+1)!=wallBlockID)
-	    problems++;
-	if(world.getBlockId(pos.iPosX-1,pos.iPosY,pos.iPosZ-1)!=wallBlockID)
-	    problems++;
-
-	if(problems>0)
-	    return false;
-	else
-	    return true;
-    }
-}

--- a/net/minecraft/src/iVec3D.java
+++ /dev/null
@@ -1,43 +1,1 @@
-/* This file is part of the Maze Mod
- *
- *
- * Maze Mod is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Maze Mod is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
- */
 
-package net.minecraft.src;
-
-class iVec3D
-{
-    public int iPosX;
-    public int iPosY;
-    public int iPosZ;
-
-    public iVec3D(int iPosX,int iPosY, int iPosZ)
-    {
-	this.iPosX=iPosX;
-	this.iPosY=iPosY;
-	this.iPosZ=iPosZ;
-    }
-
-    public iVec3D plus(iVec3D other)
-    {
-	iVec3D result=new iVec3D(iPosX+other.iPosX,iPosY+other.iPosY,iPosZ+other.iPosZ);
-	return result;
-    }
-
-    public String toString()
-    {
-	return iPosX+" "+iPosY+" "+iPosZ;
-    }
-}

--- a/net/minecraft/src/mod_Maze.java
+++ /dev/null
@@ -1,47 +1,1 @@
-/* This file is part of the Maze Mod
- *
- *
- * Maze Mod is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Maze Mod is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
- */
 
-package net.minecraft.src;
-
-public class mod_Maze extends BaseMod
-{
-    public static Item mazePaper;
-
-    public mod_Maze()
-    { }
-
-    public void load()
-    {
-	// Add maze paper
-	int overrideID = ModLoader.addOverride("/gui/items.png","/gui/Item_mazePaper.png");
-	mazePaper=(new ItemMazePaper(ModLoader.getUniqueEntityId())).setIconIndex(overrideID).setFull3D().setItemName("mazePaper");
-	ModLoader.AddName(mod_Maze.mazePaper,"Maze Paper");
-	
-	// Add the recipes for the new items
-	CraftingManager recipes=CraftingManager.getInstance();
-
-	recipes.addRecipe(new ItemStack(mod_Maze.mazePaper, 1),
-			  new Object[] { "XXX", "X#X","XXX", Character.valueOf('X'), Item.paper,
-					 Character.valueOf('#'), Block.torchWood });
-
-    }
-
-    public String getVersion()
-    {
-	return "0.1";
-    }
-}