mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-03 01:19:42 +01:00
Merge pull request #101 from wizjany/master
Fixed some commands not accepting flags they should
This commit is contained in:
commit
30961483e1
@ -36,7 +36,7 @@ public class GeneralCommands {
|
|||||||
@Command(aliases = {"god"},
|
@Command(aliases = {"god"},
|
||||||
usage = "[player]",
|
usage = "[player]",
|
||||||
desc = "Enable godmode on a player",
|
desc = "Enable godmode on a player",
|
||||||
flags = "", min = 0, max = 1)
|
flags = "s", min = 0, max = 1)
|
||||||
public static void god(CommandContext args, WorldGuardPlugin plugin,
|
public static void god(CommandContext args, WorldGuardPlugin plugin,
|
||||||
CommandSender sender) throws CommandException {
|
CommandSender sender) throws CommandException {
|
||||||
ConfigurationManager config = plugin.getGlobalConfiguration();
|
ConfigurationManager config = plugin.getGlobalConfiguration();
|
||||||
@ -84,7 +84,7 @@ public static void god(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
@Command(aliases = {"ungod"},
|
@Command(aliases = {"ungod"},
|
||||||
usage = "[player]",
|
usage = "[player]",
|
||||||
desc = "Disable godmode on a player",
|
desc = "Disable godmode on a player",
|
||||||
flags = "", min = 0, max = 1)
|
flags = "s", min = 0, max = 1)
|
||||||
public static void ungod(CommandContext args, WorldGuardPlugin plugin,
|
public static void ungod(CommandContext args, WorldGuardPlugin plugin,
|
||||||
CommandSender sender) throws CommandException {
|
CommandSender sender) throws CommandException {
|
||||||
ConfigurationManager config = plugin.getGlobalConfiguration();
|
ConfigurationManager config = plugin.getGlobalConfiguration();
|
||||||
@ -124,14 +124,14 @@ public static void ungod(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
// The player didn't receive any items, then we need to send the
|
// The player didn't receive any items, then we need to send the
|
||||||
// user a message so s/he know that something is indeed working
|
// user a message so s/he know that something is indeed working
|
||||||
if (!included && args.hasFlag('s')) {
|
if (!included && args.hasFlag('s')) {
|
||||||
sender.sendMessage(ChatColor.YELLOW.toString() + "Players now have god mode.");
|
sender.sendMessage(ChatColor.YELLOW.toString() + "Players no longer have god mode.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(aliases = {"heal"},
|
@Command(aliases = {"heal"},
|
||||||
usage = "[player]",
|
usage = "[player]",
|
||||||
desc = "Heal a player",
|
desc = "Heal a player",
|
||||||
flags = "", min = 0, max = 1)
|
flags = "s", min = 0, max = 1)
|
||||||
public static void heal(CommandContext args, WorldGuardPlugin plugin,
|
public static void heal(CommandContext args, WorldGuardPlugin plugin,
|
||||||
CommandSender sender) throws CommandException {
|
CommandSender sender) throws CommandException {
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ public static void heal(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
@Command(aliases = {"slay"},
|
@Command(aliases = {"slay"},
|
||||||
usage = "[player]",
|
usage = "[player]",
|
||||||
desc = "Slay a player",
|
desc = "Slay a player",
|
||||||
flags = "", min = 0, max = 1)
|
flags = "s", min = 0, max = 1)
|
||||||
public static void slay(CommandContext args, WorldGuardPlugin plugin,
|
public static void slay(CommandContext args, WorldGuardPlugin plugin,
|
||||||
CommandSender sender) throws CommandException {
|
CommandSender sender) throws CommandException {
|
||||||
|
|
||||||
@ -202,12 +202,12 @@ public static void slay(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
|
|
||||||
// Tell the user
|
// Tell the user
|
||||||
if (player.equals(sender)) {
|
if (player.equals(sender)) {
|
||||||
player.sendMessage(ChatColor.YELLOW + "Slayed!");
|
player.sendMessage(ChatColor.YELLOW + "Slain!");
|
||||||
|
|
||||||
// Keep track of this
|
// Keep track of this
|
||||||
included = true;
|
included = true;
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.YELLOW + "Slayed by "
|
player.sendMessage(ChatColor.YELLOW + "Slain by "
|
||||||
+ plugin.toName(sender) + ".");
|
+ plugin.toName(sender) + ".");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ public static void slay(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
// The player didn't receive any items, then we need to send the
|
// The player didn't receive any items, then we need to send the
|
||||||
// user a message so s/he know that something is indeed working
|
// user a message so s/he know that something is indeed working
|
||||||
if (!included && args.hasFlag('s')) {
|
if (!included && args.hasFlag('s')) {
|
||||||
sender.sendMessage(ChatColor.YELLOW.toString() + "Players slayed.");
|
sender.sendMessage(ChatColor.YELLOW.toString() + "Players slain.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user