fixed dungeon gen

This commit is contained in:
StevenRS11
2013-06-02 23:49:47 -04:00
parent 004d06ab7d
commit a8ac17f81b
5 changed files with 42 additions and 32 deletions

View File

@@ -181,9 +181,17 @@ public class DungeonGenerator implements Serializable
}
}
catch(Exception e)
{
if(mod_pocketDim.registeredDungeons.size()>0)
{
dungeon = mod_pocketDim.registeredDungeons.get(rand.nextInt(mod_pocketDim.registeredDungeons.size()));
}
else
{
e.printStackTrace();
return;
}
}
mod_pocketDim.loader.init(dungeon.schematicPath, incoming);

View File

@@ -33,20 +33,25 @@ public class SchematicLoader
public short height;
public short length;
public short[] blocks;
public byte[] blockData;
public short[] blocks= new short[0];
public byte[] blockData= new byte[0];
public byte[] blockId =new byte[0];
public byte[] addId = new byte[0];
public byte[] blockId;
public NBTTagList entities;
public NBTTagList tileentities;
private Random rand = new Random();
// public World world;
public Point3D incomingLink= new Point3D(0,0,0);
public ArrayList<Point3D> sideLinks = new ArrayList<Point3D>();
public ArrayList<Point3D> exitLinks = new ArrayList<Point3D>();
public int transMeta;
// public Chunk chunk;
public int cX;
public int cZ;
public int cY;
@@ -58,7 +63,6 @@ public class SchematicLoader
public SchematicLoader()
{
// this.schematic="/schematics/"+filePath;
}
@@ -86,25 +90,22 @@ public class SchematicLoader
//FileInputStream fileinputstream = new FileInputStream(file);
NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(input);
width = nbtdata.getShort("Width");
height = nbtdata.getShort("Height");
length = nbtdata.getShort("Length");
blockId = nbtdata.getByteArray("Blocks");
blockData = nbtdata.getByteArray("Data");
blocks=new short[blockId.length];
if(nbtdata.getByteArray("AddBlocks")!=null)
{
this.addId = nbtdata.getByteArray("AddBlocks");
}
addId = nbtdata.getByteArray("AddBlocks");
entities = nbtdata.getTagList("Entities");
tileentities = nbtdata.getTagList("TileEntities");
this.didRead=true;
input.close();
@@ -120,8 +121,8 @@ public class SchematicLoader
if ((index & 1) == 0)
{
blocks[index] = (short) (((addId[index >> 1] & 0x0F) << 8) + (blockId[index] & 0xFF));
} else
}
else
{
blocks[index] = (short) (((addId[index >> 1] & 0xF0) << 4) + (blockId[index] & 0xFF));
}
@@ -769,7 +770,7 @@ public class SchematicLoader
if(Block.blocksList[blockToReplace]==null&&blockToReplace!=0||blockToReplace>158)
{
// blockToReplace=mod_pocketDim.blockDimWall.blockID;
blockToReplace=mod_pocketDim.blockDimWall.blockID;
}
if(blockToReplace>0)

View File

@@ -612,7 +612,7 @@ public class mod_pocketDim
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
this.blocksImmuneToRift.add(Block.bedrock.blockID);
/**
this.hubs.add(new DungeonGenerator(0, "/schematics/4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/doorTotemRuins.schematic", true));
@@ -690,7 +690,7 @@ public class mod_pocketDim
this.registeredDungeons.addAll(this.hubs);
**/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1 @@
0*7,1*7,2*7,3*7,4*7,5*7,6*7,5*7,4*7,3*7,2*7,1*7