mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fix world argument to ignore radius, and allow for skipping radius param in syntax.
This commit is contained in:
parent
9bc8f287a4
commit
fa765d3077
2 changed files with 26 additions and 19 deletions
|
@ -38,11 +38,13 @@ public class Commandremove extends EssentialsCommand
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
throw new Exception(_("numberRequired"), e);
|
world = ess.getWorld(args[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (args.length >= 3)
|
if (args.length >= 3)
|
||||||
{
|
{
|
||||||
|
// This is to prevent breaking the old syntax
|
||||||
|
radius = 0;
|
||||||
world = ess.getWorld(args[2]);
|
world = ess.getWorld(args[2]);
|
||||||
}
|
}
|
||||||
parseCommand(server, user.getSource(), args, world, radius);
|
parseCommand(server, user.getSource(), args, world, radius);
|
||||||
|
@ -65,6 +67,11 @@ public class Commandremove extends EssentialsCommand
|
||||||
List<String> types = new ArrayList<String>();
|
List<String> types = new ArrayList<String>();
|
||||||
List<String> customTypes = new ArrayList<String>();
|
List<String> customTypes = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (world == null)
|
||||||
|
{
|
||||||
|
throw new Exception(_("invalidWorld"));
|
||||||
|
}
|
||||||
|
|
||||||
if (args[0].contentEquals("*") || args[0].contentEquals("all"))
|
if (args[0].contentEquals("*") || args[0].contentEquals("all"))
|
||||||
{
|
{
|
||||||
types.add(0, "ALL");
|
types.add(0, "ALL");
|
||||||
|
|
|
@ -300,7 +300,7 @@ commands:
|
||||||
aliases: [formula,eformula,method,emethod,erecipe,recipes,erecipes]
|
aliases: [formula,eformula,method,emethod,erecipe,recipes,erecipes]
|
||||||
remove:
|
remove:
|
||||||
description: Removes entities in your world.
|
description: Removes entities in your world.
|
||||||
usage: /<command> <all|tamed|drops|arrows|boats|minecarts|xp|paintings|itemframes|endercrystals|monsters|animals|ambient|mobs|[mobType]> [radius] [world]
|
usage: /<command> <all|tamed|drops|arrows|boats|minecarts|xp|paintings|itemframes|endercrystals|monsters|animals|ambient|mobs|[mobType]> [radius|world]
|
||||||
aliases: [eremove,butcher,ebutcher,killall,ekillall,mobkill,emobkill]
|
aliases: [eremove,butcher,ebutcher,killall,ekillall,mobkill,emobkill]
|
||||||
repair:
|
repair:
|
||||||
description: Repairs the durability of one or all items.
|
description: Repairs the durability of one or all items.
|
||||||
|
|
Loading…
Reference in a new issue