From 968decf62eebde9ed77143a27edc6fa56e5036ac Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 26 Apr 2019 23:42:57 +1000 Subject: [PATCH] Remove the -l lightning flag from butcher --- build.gradle | 2 -- .../sk89q/worldedit/command/BrushCommands.java | 6 +----- .../sk89q/worldedit/command/UtilityCommands.java | 6 +----- .../worldedit/command/util/CreatureButcher.java | 15 --------------- 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 45076d4ed..41de17bb8 100644 --- a/build.gradle +++ b/build.gradle @@ -86,8 +86,6 @@ subprojects { mavenCentral() maven { url "http://maven.sk89q.com/repo/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - // temporary, for Piston - mavenLocal() } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index d187723ba..0b29fdede 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -257,9 +257,7 @@ public class BrushCommands { @Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)") boolean killFriendly, @Switch(name = 'r', desc = "Also destroy armor stands") - boolean killArmorStands, - @Switch(name = 'l', desc = "Kill via lightning. Currently non-functioning.") - boolean killWithLightning) throws WorldEditException { + boolean killArmorStands) throws WorldEditException { LocalConfiguration config = worldEdit.getConfiguration(); double maxRadius = config.maxBrushRadius; @@ -284,8 +282,6 @@ public class BrushCommands { flags.or(CreatureButcher.Flags.TAGGED , killWithName, "worldedit.butcher.tagged"); 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()); tool.setSize(radius); tool.setBrush(new ButcherBrush(flags), "worldedit.brush.butcher"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 12988ab56..ea292a855 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -375,9 +375,7 @@ public class UtilityCommands { @Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)") boolean killFriendly, @Switch(name = 'r', desc = "Also destroy armor stands") - boolean killArmorStands, - @Switch(name = 'l', desc = "Kill via lightning. Currently non-functioning.") - boolean killWithLightning) throws WorldEditException { + boolean killArmorStands) throws WorldEditException { LocalConfiguration config = we.getConfiguration(); 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.ARMOR_STAND, killArmorStands, "worldedit.butcher.armorstands"); - flags.or(CreatureButcher.Flags.WITH_LIGHTNING, killWithLightning, "worldedit.butcher.lightning"); - int killed = killMatchingEntities(radius, player, flags::createFunction); actor.print("Killed " + killed + (killed != 1 ? " mobs" : " mob") + (radius < 0 ? "" : " in a radius of " + radius) + "."); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java index 940d6a99c..e43fee9d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/CreatureButcher.java @@ -19,7 +19,6 @@ package com.sk89q.worldedit.command.util; -import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.EntityFunction; @@ -39,7 +38,6 @@ public class CreatureButcher { public static final int TAGGED = 1 << 5; public static final int FRIENDLY = PETS | NPCS | ANIMALS | GOLEMS | AMBIENT | TAGGED; public static final int ARMOR_STAND = 1 << 6; - public static final int WITH_LIGHTNING = 1 << 20; 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() { return entity -> { boolean killPets = (flags & Flags.PETS) != 0;