Remove the -l lightning flag from butcher

This commit is contained in:
Matthew Miller 2019-04-26 23:42:57 +10:00
parent 23279c007e
commit 968decf62e
4 changed files with 2 additions and 27 deletions

View File

@ -86,8 +86,6 @@ subprojects {
mavenCentral() mavenCentral()
maven { url "http://maven.sk89q.com/repo/" } maven { url "http://maven.sk89q.com/repo/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
// temporary, for Piston
mavenLocal()
} }
} }

View File

@ -257,9 +257,7 @@ public class BrushCommands {
@Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)") @Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)")
boolean killFriendly, boolean killFriendly,
@Switch(name = 'r', desc = "Also destroy armor stands") @Switch(name = 'r', desc = "Also destroy armor stands")
boolean killArmorStands, boolean killArmorStands) throws WorldEditException {
@Switch(name = 'l', desc = "Kill via lightning. Currently non-functioning.")
boolean killWithLightning) throws WorldEditException {
LocalConfiguration config = worldEdit.getConfiguration(); LocalConfiguration config = worldEdit.getConfiguration();
double maxRadius = config.maxBrushRadius; double maxRadius = config.maxBrushRadius;
@ -284,8 +282,6 @@ public class BrushCommands {
flags.or(CreatureButcher.Flags.TAGGED , killWithName, "worldedit.butcher.tagged"); flags.or(CreatureButcher.Flags.TAGGED , killWithName, "worldedit.butcher.tagged");
flags.or(CreatureButcher.Flags.ARMOR_STAND , killArmorStands, "worldedit.butcher.armorstands"); flags.or(CreatureButcher.Flags.ARMOR_STAND , killArmorStands, "worldedit.butcher.armorstands");
flags.or(CreatureButcher.Flags.WITH_LIGHTNING, killWithLightning, "worldedit.butcher.lightning");
BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());
tool.setSize(radius); tool.setSize(radius);
tool.setBrush(new ButcherBrush(flags), "worldedit.brush.butcher"); tool.setBrush(new ButcherBrush(flags), "worldedit.brush.butcher");

View File

@ -375,9 +375,7 @@ public class UtilityCommands {
@Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)") @Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)")
boolean killFriendly, boolean killFriendly,
@Switch(name = 'r', desc = "Also destroy armor stands") @Switch(name = 'r', desc = "Also destroy armor stands")
boolean killArmorStands, boolean killArmorStands) throws WorldEditException {
@Switch(name = 'l', desc = "Kill via lightning. Currently non-functioning.")
boolean killWithLightning) throws WorldEditException {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
Player player = actor instanceof Player ? (Player) actor : null; Player player = actor instanceof Player ? (Player) actor : null;
@ -406,8 +404,6 @@ public class UtilityCommands {
flags.or(CreatureButcher.Flags.TAGGED, killWithName, "worldedit.butcher.tagged"); flags.or(CreatureButcher.Flags.TAGGED, killWithName, "worldedit.butcher.tagged");
flags.or(CreatureButcher.Flags.ARMOR_STAND, killArmorStands, "worldedit.butcher.armorstands"); flags.or(CreatureButcher.Flags.ARMOR_STAND, killArmorStands, "worldedit.butcher.armorstands");
flags.or(CreatureButcher.Flags.WITH_LIGHTNING, killWithLightning, "worldedit.butcher.lightning");
int killed = killMatchingEntities(radius, player, flags::createFunction); int killed = killMatchingEntities(radius, player, flags::createFunction);
actor.print("Killed " + killed + (killed != 1 ? " mobs" : " mob") + (radius < 0 ? "" : " in a radius of " + radius) + "."); actor.print("Killed " + killed + (killed != 1 ? " mobs" : " mob") + (radius < 0 ? "" : " in a radius of " + radius) + ".");

View File

@ -19,7 +19,6 @@
package com.sk89q.worldedit.command.util; package com.sk89q.worldedit.command.util;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.entity.metadata.EntityProperties;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.function.EntityFunction; import com.sk89q.worldedit.function.EntityFunction;
@ -39,7 +38,6 @@ public class CreatureButcher {
public static final int TAGGED = 1 << 5; public static final int TAGGED = 1 << 5;
public static final int FRIENDLY = PETS | NPCS | ANIMALS | GOLEMS | AMBIENT | TAGGED; public static final int FRIENDLY = PETS | NPCS | ANIMALS | GOLEMS | AMBIENT | TAGGED;
public static final int ARMOR_STAND = 1 << 6; public static final int ARMOR_STAND = 1 << 6;
public static final int WITH_LIGHTNING = 1 << 20;
private Flags() { private Flags() {
} }
@ -64,19 +62,6 @@ public class CreatureButcher {
} }
} }
public void fromCommand(CommandContext args) {
or(Flags.FRIENDLY , args.hasFlag('f')); // No permission check here. Flags will instead be filtered by the subsequent calls.
or(Flags.PETS , args.hasFlag('p'), "worldedit.butcher.pets");
or(Flags.NPCS , args.hasFlag('n'), "worldedit.butcher.npcs");
or(Flags.GOLEMS , args.hasFlag('g'), "worldedit.butcher.golems");
or(Flags.ANIMALS , args.hasFlag('a'), "worldedit.butcher.animals");
or(Flags.AMBIENT , args.hasFlag('b'), "worldedit.butcher.ambient");
or(Flags.TAGGED , args.hasFlag('t'), "worldedit.butcher.tagged");
or(Flags.ARMOR_STAND , args.hasFlag('r'), "worldedit.butcher.armorstands");
or(Flags.WITH_LIGHTNING, args.hasFlag('l'), "worldedit.butcher.lightning");
}
public EntityFunction createFunction() { public EntityFunction createFunction() {
return entity -> { return entity -> {
boolean killPets = (flags & Flags.PETS) != 0; boolean killPets = (flags & Flags.PETS) != 0;