This commit is contained in:
boy0001 2015-04-22 00:19:46 +10:00
parent 80a3c14189
commit 29cf1326f6
2 changed files with 31 additions and 14 deletions

View File

@ -63,11 +63,15 @@ public class AugmentedPopulator extends BlockPopulator {
} }
} }
private short[][] x_loc; private static short[][] x_loc;
private short[][] y_loc; private static short[][] y_loc;
private short[][] z_loc; private static short[][] z_loc;
public AugmentedPopulator(final String world, final PlotGenerator generator, final PlotCluster cluster, final boolean p, final boolean b) { public AugmentedPopulator(final String world, final PlotGenerator generator, final PlotCluster cluster, final boolean p, final boolean b) {
if (x_loc == null) {
x_loc = new short[16][4096];
y_loc = new short[16][4096];
z_loc = new short[16][4096];
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
int i4 = i << 4; int i4 = i << 4;
for (int j = 0; j < 4096; j++) { for (int j = 0; j < 4096; j++) {
@ -80,6 +84,7 @@ public class AugmentedPopulator extends BlockPopulator {
z_loc[i][j] = (short) z1; z_loc[i][j] = (short) z1;
} }
} }
}
this.cluster = cluster; this.cluster = cluster;
this.generator = generator; this.generator = generator;
@ -113,7 +118,6 @@ public class AugmentedPopulator extends BlockPopulator {
@Override @Override
public void populate(final World world, final Random rand, final Chunk chunk) { public void populate(final World world, final Random rand, final Chunk chunk) {
if (this.plotworld.TERRAIN == 3) { if (this.plotworld.TERRAIN == 3) {
// FIXME check CURRENT_PLOT_CLEAR && FORCE_PASTE
return; return;
} }
final int X = chunk.getX(); final int X = chunk.getX();

View File

@ -76,6 +76,19 @@ public abstract class PlotPopulator extends BlockPopulator {
* @param data * @param data
*/ */
public void setBlock(int x, int y, int z, byte data) { public void setBlock(int x, int y, int z, byte data) {
if (data != 0) {
world.getBlockAt(X + x, y, Z + z).setData(data);
}
}
/**
* Like setblock, but lacks the data != 0 check
* @param x
* @param y
* @param z
* @param data
*/
public void setBlockAbs(int x, int y, int z, byte data) {
world.getBlockAt(X + x, y, Z + z).setData(data); world.getBlockAt(X + x, y, Z + z).setData(data);
} }