Merge remote-tracking branch 'upstream/master'

This commit is contained in:
SenseiKiwi
2014-01-14 05:50:17 -04:00
3 changed files with 23 additions and 24 deletions

View File

@@ -378,13 +378,8 @@ public class Schematic {
{ {
for (dx = 0; dx < width; dx++) for (dx = 0; dx < width; dx++)
{ {
//In the future, we might want to make this more efficient by building whole chunks at a time
//Ignore air blocks setBlockDirectly(world, x + dx, y + dy, z + dz, blocks[index], metadata[index]);
//TODO
//if(blocks[index]!=0)
{
setBlockDirectly(world, x + dx, y + dy, z + dz, blocks[index], metadata[index]);
}
index++; index++;
} }
} }

View File

@@ -50,11 +50,7 @@ public abstract class BaseGateway
* I tried doing this by taking the difference between the selected coords for the door, and the position of the door relative to the bounds of the .schematic, * I tried doing this by taking the difference between the selected coords for the door, and the position of the door relative to the bounds of the .schematic,
* but it doesnt work. It seems like it should, though. Odd. * but it doesnt work. It seems like it should, though. Odd.
* *
* The other issue is with the .schematic itself. It looks like we are exporting quite a few air blocks with the real blocks. * Now we have a new issue- we get an index array out of bounds. One of the exported *blocks* is -69.
* This may be a limitation of our export function, as it wasnt really meant for this.
*
* I added a line in the generate function to skip air blocks completely, but commented it out so you can see it carrying air blocks along. Its in schematic.copyToWorld
* Should also speed up generation time.
* *
*/ */
Point3D doorLocation= new Point3D(0,0,0); Point3D doorLocation= new Point3D(0,0,0);
@@ -63,18 +59,19 @@ public abstract class BaseGateway
{ {
if(this.schematicPath!=null) if(this.schematicPath!=null)
{ {
Schematic schematic = Schematic.readFromResource(schematicPath); Schematic schematic = Schematic.readFromResource(schematicPath);
schematic.applyFilter(filter); schematic.applyFilter(filter);
doorLocation = filter.getEntranceDoorLocation();
orientation = filter.getEntranceOrientation(); doorLocation = filter.getEntranceDoorLocation();
schematic.copyToWorld(world, x-schematic.getWidth()+doorLocation.getX(), y-schematic.getHeight()+doorLocation.getY(), z-schematic.getLength()+doorLocation.getZ()); orientation = filter.getEntranceOrientation();
for(int c = 0; c<240; c++) schematic.copyToWorld(world, x-schematic.getWidth()+doorLocation.getX(), y-schematic.getHeight()+doorLocation.getY(), z-schematic.getLength()+doorLocation.getZ());
{
world.setBlock(x, y+c, z,Block.glowStone.blockID); //TODO debug code to easily locate the rifts
for(int c = 0; c<240; c++)
} {
world.setBlock(x, y+c, z,Block.glowStone.blockID);
}
} }
} }
catch (Exception e) catch (Exception e)
@@ -90,6 +87,13 @@ public abstract class BaseGateway
return true; return true;
} }
/**
* Use this function to generate randomized bits of the structure.
* @param world
* @param x
* @param y
* @param z
*/
abstract void generateRandomBits(World world, int x, int y, int z); abstract void generateRandomBits(World world, int x, int y, int z);
/** /**