mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Override setblock setting Pattern in ChunkBlockQueue
> Should stop NPE during plot analysis > Without overriding this method, DelegateLocalBlockQueue setblock Pattern is called > DelegateLocalBlockQueue's setblocks use parent.setBlock, but we set that to null in ChunkBlockQueue > ChunkBlockQueue is simply just to cache the values from generation to use in analysis > Therefore there is no need to setblocks in any other Queue implementation
This commit is contained in:
parent
179e9e1e74
commit
a8621a15ad
1 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
package com.plotsquared.core.queue;
|
||||
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
@ -79,6 +80,11 @@ public class ChunkBlockQueue extends ScopedLocalBlockQueue {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override public boolean setBlock(int x, int y, int z, Pattern pattern) {
|
||||
this.storeCache(x, y, z, pattern.apply(BlockVector3.at(x, y, z)).toImmutableState());
|
||||
return true;
|
||||
}
|
||||
|
||||
private void storeCache(final int x, final int y, final int z, final BlockState id) {
|
||||
BlockState[][] resultY = result[y];
|
||||
if (resultY == null) {
|
||||
|
|
Loading…
Reference in a new issue