BlockStates also don't seem to want to copy over using /plot paste

This commit is contained in:
boy0001 2014-10-23 21:44:19 +11:00
parent f39d31836d
commit 356923d3e8
2 changed files with 1 additions and 34 deletions

View File

@ -28,10 +28,6 @@ public class PlotSelection {
private Biome biome; private Biome biome;
private BlockState[] tiles = null;
private Location origin = null;
public PlotSelection(int width, World world, Plot plot) { public PlotSelection(int width, World world, Plot plot) {
this.width = width; this.width = width;
this.plot = plot; this.plot = plot;
@ -52,26 +48,6 @@ public class PlotSelection {
this.biome = world.getBiome(minX, minZ); this.biome = world.getBiome(minX, minZ);
ArrayList<BlockState> states = new ArrayList<BlockState>();
for (int i = (bot.getBlockX() / 16) * 16; i < (16 + ((top.getBlockX() / 16) * 16)); i += 16) {
for (int j = (bot.getBlockZ() / 16) * 16; j < (16 + ((top.getBlockZ() / 16) * 16)); j += 16) {
Chunk chunk = world.getChunkAt(i, j);
for (BlockState tile :chunk.getTileEntities()) {
PlotId id = PlayerFunctions.getPlot(tile.getLocation());
if ((id != null) && id.equals(plot.id)) {
states.add(tile);
}
}
}
}
if (states.size() > 0) {
this.tiles = (BlockState[]) states.toArray();
this.origin = bot;
}
int index = 0; int index = 0;
for (int x = minX; x < maxX; x++) { for (int x = minX; x < maxX; x++) {
for (int z = minZ; z < maxZ; z++) { for (int z = minZ; z < maxZ; z++) {
@ -105,8 +81,6 @@ public class PlotSelection {
public static boolean swap(World world, PlotId id1, PlotId id2) { public static boolean swap(World world, PlotId id1, PlotId id2) {
Location bot2 = PlotHelper.getPlotBottomLocAbs(world, id2).add(1, 0, 1); Location bot2 = PlotHelper.getPlotBottomLocAbs(world, id2).add(1, 0, 1);
Location top2 = PlotHelper.getPlotTopLocAbs(world, id2);
Location bot1 = PlotHelper.getPlotBottomLocAbs(world, id1).add(1, 0, 1); Location bot1 = PlotHelper.getPlotBottomLocAbs(world, id1).add(1, 0, 1);
Location top1 = PlotHelper.getPlotTopLocAbs(world, id1); Location top1 = PlotHelper.getPlotTopLocAbs(world, id1);
@ -184,13 +158,6 @@ public class PlotSelection {
PlotHelper.setBiome(world, plot, this.biome); PlotHelper.setBiome(world, plot, this.biome);
} }
if (this.origin!=null) {
for (BlockState state : this.tiles) {
Location loc = new Location(world,state.getX() - this.origin.getBlockX() + minX + 1, state.getY() - this.origin.getBlockY() + minY, state.getZ() - this.origin.getBlockZ() + minZ + 1);
world.getBlockAt(loc).getState().setRawData(state.getRawData());
}
}
int index = 0; int index = 0;
PlotBlock current; PlotBlock current;
for (int x = minX; x < maxX; x++) { for (int x = minX; x < maxX; x++) {

View File

@ -33,7 +33,7 @@ public class Copy extends SubCommand {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS); PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;
} }
if (!plot.settings.isMerged()) { if (plot.settings.isMerged()) {
PlayerFunctions.sendMessage(plr, C.UNLINK_REQUIRED); PlayerFunctions.sendMessage(plr, C.UNLINK_REQUIRED);
return false; return false;
} }