Convert all PlotBlocks to BaseBlocks in the BasicLocalBlockQueue

The `BukkitLocalQueue` only supports using one of the sets (the removed `baseBlocks` variable in `BasicLocalBlockQueue` was the deciding factor for which one won out) which led to issues with missing blocks when trying to use both types at the same time, such as in the `HybridPlotManager`s `clearPlot` method, where `PlotBlock` is used to fill in the various layers, while the`createSchemAbs` method uses `BaseBlock` for its data.
This commit is contained in:
Alexander Krivács Schrøder
2019-05-30 13:21:26 +02:00
committed by Matt
parent 427523644c
commit 941821e453
2 changed files with 22 additions and 85 deletions

View File

@ -70,11 +70,7 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
}
@Override public final void setComponents(LocalChunk<T> lc) {
if (isBaseBlocks()) {
setBaseBlocks(lc);
} else {
setBlocks(lc);
}
setBaseBlocks(lc);
}
public World getBukkitWorld() {
@ -85,30 +81,6 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
return getBukkitWorld().getChunkAt(x, z);
}
public void setBlocks(LocalChunk<T> lc) {
World worldObj = Bukkit.getWorld(getWorld());
Chunk chunk = worldObj.getChunkAt(lc.getX(), lc.getZ());
chunk.load(true);
for (int layer = 0; layer < lc.blocks.length; layer++) {
PlotBlock[] blocksLayer = (PlotBlock[]) lc.blocks[layer];
if (blocksLayer != null) {
for (int j = 0; j < blocksLayer.length; j++) {
if (blocksLayer[j] != null) {
PlotBlock block = blocksLayer[j];
int x = MainUtil.x_loc[layer][j];
int y = MainUtil.y_loc[layer][j];
int z = MainUtil.z_loc[layer][j];
Block existing = chunk.getBlock(x, y, z);
if (equals(block, existing)) {
continue;
}
setMaterial(block, existing);
}
}
}
}
}
public void setBaseBlocks(LocalChunk<T> lc) {
World worldObj = Bukkit.getWorld(getWorld());
Chunk chunk = worldObj.getChunkAt(lc.getX(), lc.getZ());