mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
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:

committed by
Matt

parent
427523644c
commit
941821e453
@ -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());
|
||||
|
Reference in New Issue
Block a user