mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Added a few new things using block states.
* `//set ##*tag` sets all states in the tag (not just default state per type) * `//set ^type` is a pattern changing block type but copying all valid existing states * `//set ^[prop=val,...]` sets the property `prop` to `val` wherever the existing block has that property * `//set ^type[prop=val,...]` does both of the above Those work anywhere a pattern is taken, of course. * The mask syntax `^[prop=val]` matches blocks with the property `prop` set to `val`, or blocks that don't have the property at all. * The mask syntax `^=[prop=val]` only matches blocks that have the property. Those work anywhere a mask is taken, of course. (`//mask`, `//gmask`, `//replace`, etc) The `//drain` command now takes `-w` flag that removes the waterlogged state from blocks (in addition to removing water, as before).
This commit is contained in:
@ -142,7 +142,10 @@ public class UtilityCommands {
|
||||
@Command(
|
||||
aliases = { "/drain" },
|
||||
usage = "<radius>",
|
||||
flags = "w",
|
||||
desc = "Drain a pool",
|
||||
help = "Removes all connected water sources.\n" +
|
||||
" If -w is specified, also makes waterlogged blocks non-waterlogged.",
|
||||
min = 1,
|
||||
max = 1
|
||||
)
|
||||
@ -151,9 +154,10 @@ public class UtilityCommands {
|
||||
public void drain(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
|
||||
double radius = Math.max(0, args.getDouble(0));
|
||||
boolean waterlogged = args.hasFlag('w');
|
||||
we.checkMaxRadius(radius);
|
||||
int affected = editSession.drainArea(
|
||||
session.getPlacementPosition(player), radius);
|
||||
session.getPlacementPosition(player), radius, waterlogged);
|
||||
player.print(affected + " block(s) have been changed.");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user