New masks

This commit is contained in:
MattBDev
2020-03-17 22:20:58 -04:00
parent 85b65669bd
commit ecedc1ff12
17 changed files with 201 additions and 85 deletions

View File

@ -122,14 +122,6 @@
// }
//
// @Command(
// name = "#offset",
// desc = "Offset a mask"
// )
// public Mask offset(@Arg(desc = "double x") double x, @Arg(desc = "double y") double y, @Arg(desc = "double z") double z, @Arg(desc = "Mask") Mask mask) {
// return new OffsetMask(mask, BlockVector3.at(x, y, z));
// }
//
// @Command(
// name = "#haslight",
// desc = "Restricts to blocks with light (sky or emitted)"
// )
@ -146,23 +138,6 @@
// }
//
// @Command(
// name = "#liquid",
// desc = "If there is a solid block"
// )
// public Mask liquid(Extent extent) {
// return new BlockMaskBuilder().addAll(b -> b.getMaterial().isLiquid()).build(extent);
// }
//
// @Command(
// name = "#dregion",
// aliases = {"#dselection", "#dsel"},
// desc = "inside the player's selection"
// )
// public Mask dregion() {
// return new RegionMask(new RequestSelection());
// }
//
// @Command(
// name = "#region",
// aliases = {"#selection", "#sel"},
// desc = "inside the provided selection"
@ -220,14 +195,6 @@
// }
//
// @Command(
// name = "#air",
// desc = "Restrict to types of air"
// )
// public Mask air(Extent extent) {
// return new BlockMaskBuilder().addAll(b -> b.getMaterial().isAir()).build(extent);
// }
//
// @Command(
// name = "#wall",
// desc = "Restrict to walls (any block n,e,s,w of air)"
// )

View File

@ -570,7 +570,6 @@ public class SelectionCommands {
public void select(Actor actor, World world, LocalSession session,
@Arg(desc = "Selector to switch to", def = "")
SelectorChoice selector,
@Arg(desc = "Selector mask") Mask maskOpt,
@Switch(name = 'd', desc = "Set default selector")
boolean setDefaultSelector) throws WorldEditException {
if (selector == null) {
@ -624,14 +623,12 @@ public class SelectionCommands {
newSelector = new PolyhedralRegionSelector(world);
actor.print(TranslatableComponent.of("fawe.selection.sel.convex.polyhedral"));
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", (integer))));
limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", integer)));
actor.print(TranslatableComponent.of("fawe.selection.sel.list"));
break;
case FUZZY:
case MAGIC:
if (maskOpt == null) {
maskOpt = new IdMask(world);
}
Mask maskOpt = new IdMask(world);
//TODO Make FuzzyRegionSelector accept actors
newSelector = new FuzzyRegionSelector((Player) actor, world, maskOpt);
actor.print(TranslatableComponent.of("fawe.selection.sel.fuzzy"));