mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +00:00
Added getLazyBlock() to Extent for performance.
This commit is contained in:
@ -40,7 +40,7 @@ public class ExistingBlockMask extends AbstractExtentMask {
|
||||
|
||||
@Override
|
||||
public boolean test(Vector vector) {
|
||||
return getExtent().getBlockType(vector) != BlockID.AIR;
|
||||
return getExtent().getLazyBlock(vector).getType() != BlockID.AIR;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ public class FuzzyBlockMask extends BlockMask {
|
||||
public boolean test(Vector vector) {
|
||||
Extent extent = getExtent();
|
||||
Collection<BaseBlock> blocks = getBlocks();
|
||||
BaseBlock compare = new BaseBlock(extent.getBlockType(vector), extent.getBlockData(vector));
|
||||
BaseBlock lazyBlock = extent.getLazyBlock(vector);
|
||||
BaseBlock compare = new BaseBlock(lazyBlock.getType(), lazyBlock.getData());
|
||||
return BaseBlock.containsFuzzy(blocks, compare);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
@ -32,7 +33,8 @@ public class SolidBlockMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(Vector vector) {
|
||||
Extent extent = getExtent();
|
||||
return !BlockType.canPassThrough(extent.getBlockType(vector), extent.getBlockData(vector));
|
||||
BaseBlock lazyBlock = extent.getLazyBlock(vector);
|
||||
return !BlockType.canPassThrough(lazyBlock.getType(), lazyBlock.getData());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user