mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 11:45:19 +01:00
Make more complex patterns work correctly (#3847)
allow more complex patterns to work correctly
This commit is contained in:
parent
11dd013333
commit
e244527538
@ -183,7 +183,11 @@ public class GenChunk extends ScopedQueueCoordinator {
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
|
||||
return setBlock(x, y, z, PatternUtil.apply(Preconditions.checkNotNull(pattern, "Pattern may not be null"), x, y, z));
|
||||
final BaseBlock block = PatternUtil.apply(Preconditions.checkNotNull(
|
||||
pattern,
|
||||
"Pattern may not be null"
|
||||
), x + (chunkX << 4), y, z + (chunkZ << 4));
|
||||
return setBlock(x, y, z, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +29,6 @@ import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -44,7 +43,7 @@ public class PatternUtil {
|
||||
|
||||
public static BaseBlock apply(@NonNull Pattern pattern, int x, int y, int z) {
|
||||
Preconditions.checkNotNull(pattern, "Pattern may not be null");
|
||||
if (pattern instanceof BlockPattern || pattern instanceof RandomPattern
|
||||
if (pattern instanceof BlockPattern
|
||||
|| pattern instanceof BlockState || pattern instanceof BlockType
|
||||
|| pattern instanceof BaseBlock) {
|
||||
return pattern.applyBlock(BlockVector3.ZERO);
|
||||
|
Loading…
Reference in New Issue
Block a user