mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-21 04:49:51 +08:00
Made /butcher print the radius it uses and added an "all" parameter.
This commit is contained in:
parent
cacf2cabe2
commit
0bc9369cc8
@ -367,11 +367,16 @@ public void butcher(CommandContext args, LocalSession session, LocalPlayer playe
|
||||
EditSession editSession) throws WorldEditException {
|
||||
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
|
||||
|
||||
final int radius;
|
||||
|
||||
if(args.argsLength() > 0){
|
||||
radius = Math.max(1, args.getInteger(0));
|
||||
|
||||
if (args.argsLength() > 0) {
|
||||
if (args.getString(0).equals("all")) {
|
||||
radius = -1;
|
||||
}
|
||||
else {
|
||||
radius = Math.max(1, args.getInteger(0));
|
||||
}
|
||||
}
|
||||
else{
|
||||
radius = config.butcherDefaultRadius;
|
||||
@ -395,7 +400,10 @@ public void butcher(CommandContext args, LocalSession session, LocalPlayer playe
|
||||
}
|
||||
}
|
||||
|
||||
player.print("Killed " + killed + " mobs.");
|
||||
if (radius < 0)
|
||||
player.print("Killed " + killed + " mobs.");
|
||||
else
|
||||
player.print("Killed " + killed + " mobs in a radius of "+radius+".");
|
||||
}
|
||||
|
||||
public class FlagContainer {
|
||||
|
Loading…
Reference in New Issue
Block a user