mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
allow more complex patterns to work correctly
This commit is contained in:
parent
b740d5854c
commit
42f0b70e85
@ -183,7 +183,11 @@ public class GenChunk extends ScopedQueueCoordinator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
|
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
|
@Override
|
||||||
|
@ -29,7 +29,6 @@ import com.sk89q.worldedit.extension.input.ParserContext;
|
|||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
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) {
|
public static BaseBlock apply(@NonNull Pattern pattern, int x, int y, int z) {
|
||||||
Preconditions.checkNotNull(pattern, "Pattern may not be null");
|
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 BlockState || pattern instanceof BlockType
|
||||||
|| pattern instanceof BaseBlock) {
|
|| pattern instanceof BaseBlock) {
|
||||||
return pattern.applyBlock(BlockVector3.ZERO);
|
return pattern.applyBlock(BlockVector3.ZERO);
|
||||||
|
Loading…
Reference in New Issue
Block a user