File tree Expand file tree Collapse file tree
worldedit-core/src/main/java/com/sk89q/worldedit
extension/factory/parser/mask Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020package com .sk89q .worldedit .extension .factory .parser .mask ;
2121
2222import com .sk89q .worldedit .WorldEdit ;
23+ import com .sk89q .worldedit .blocks .ShapeType ;
2324import com .sk89q .worldedit .extension .input .InputParseException ;
2425import com .sk89q .worldedit .extension .input .ParserContext ;
2526import com .sk89q .worldedit .function .mask .FullCubeMask ;
3031
3132public class FullCubeMaskParser extends SimpleInputParser <Mask > {
3233
33- private static final List <String > aliases = List .of ("#fullcube" );
34+ private static final List <String > aliases = List .of ("#fullcube" , "#visualfullcube" );
3435
3536 public FullCubeMaskParser (WorldEdit worldEdit ) {
3637 super (worldEdit );
@@ -43,6 +44,11 @@ public List<String> getMatchedAliases() {
4344
4445 @ Override
4546 public Mask parseFromSimpleInput (String input , ParserContext context ) throws InputParseException {
46- return new FullCubeMask (context .requireExtent ());
47+ ShapeType shapeType = switch (input ) {
48+ case "#fullcube" -> ShapeType .SHAPE ;
49+ case "#visualfullcube" -> ShapeType .VISUAL_SHAPE ;
50+ default -> throw new IllegalStateException ("Unexpected value: " + input );
51+ };
52+ return new FullCubeMask (context .requireExtent (), shapeType );
4753 }
4854}
Original file line number Diff line number Diff line change 1919
2020package com .sk89q .worldedit .function .mask ;
2121
22+ import com .google .errorprone .annotations .InlineMe ;
2223import com .sk89q .worldedit .blocks .ShapeType ;
2324import com .sk89q .worldedit .extent .Extent ;
2425import com .sk89q .worldedit .math .BlockVector3 ;
2526import com .sk89q .worldedit .world .block .BlockState ;
2627
2728public final class FullCubeMask extends AbstractExtentMask {
2829
30+ private final ShapeType shapeType ;
31+
32+ @ Deprecated
33+ @ InlineMe (replacement = "this(extent, ShapeType.SHAPE)" , imports = "com.sk89q.worldedit.blocks.ShapeType" )
2934 public FullCubeMask (Extent extent ) {
35+ this (extent , ShapeType .SHAPE );
36+ }
37+
38+ public FullCubeMask (Extent extent , ShapeType shapeType ) {
3039 super (extent );
40+ this .shapeType = shapeType ;
3141 }
3242
3343 @ Override
3444 public boolean test (BlockVector3 vector ) {
3545 Extent extent = getExtent ();
3646 BlockState block = extent .getBlock (vector );
37- return block .getMaterial ().isFullCube (ShapeType . SHAPE );
47+ return block .getMaterial ().isFullCube (shapeType );
3848 }
3949
4050}
You can’t perform that action at this time.
0 commit comments