it's working now. (so far at least)

This commit is contained in:
boy0001 2014-10-15 21:36:23 +11:00
parent 47d26531aa
commit eee4a44fcb

View File

@ -33,24 +33,25 @@ public class SchematicHandler {
DataCollection[] blocks = schematic.getBlockCollection(); DataCollection[] blocks = schematic.getBlockCollection();
Location l1 = PlotHelper.getPlotBottomLoc(plot.getWorld(), plot.getId()); Location l1 = PlotHelper.getPlotBottomLoc(plot.getWorld(), plot.getId());
int sx = l1.getBlockX() + 1;
int sz = l1.getBlockZ() + 1; int sy = location.getWorld().getHighestBlockYAt(l1.getBlockX()+1, l1.getBlockZ()+1);
int sy = location.getWorld().getHighestBlockYAt(sx, sz);
l1 = l1.add(1, sy-1, 1);
l1 = l1.add(sx,sy + 1,sz);
World world = location.getWorld(); World world = location.getWorld();
for (int x = 0; x < WIDTH; ++x) { for (int x = 0; x < WIDTH; x++) {
for (int z = 0; z < LENGTH; ++z) { for (int z = 0; z < LENGTH; z++) {
for (int y = 0; y < HEIGHT; y++) { for (int y = 0; y < HEIGHT; y++) {
int index = y * WIDTH * LENGTH + z * WIDTH + x; int index = y * WIDTH * LENGTH + z * WIDTH + x;
short id = blocks[index].getBlock(); short id = blocks[index].getBlock();
byte data = blocks[index].getData(); byte data = blocks[index].getData();
Block block = world.getBlockAt(l1.add(x,y,z)); Block block = world.getBlockAt(l1.getBlockX()+x, l1.getBlockY()+y, l1.getBlockZ()+z);
PlotBlock plotblock = new PlotBlock(id, data); PlotBlock plotblock = new PlotBlock(id, data);