diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java index 2bafd5f..6407dd4 100755 --- a/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java +++ b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java @@ -47,26 +47,31 @@ public class JewelrycraftCommands extends CommandBase { public void processCommand(ICommandSender commandSender,
String[] astring) {
if (astring.length == 0 || astring[0].equals("help"))
- throw new WrongUsageException(getCommandUsage(commandSender));
+ throw new WrongUsageException(
+ getCommandUsage(commandSender));
if (astring[0].equals("getCursePoints")) {
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- commandSender.addChatMessage(new ChatComponentTranslation(
- Integer.toString(JewelrycraftUtil
- .getCursePoints(entityplayermp))));
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ commandSender.addChatMessage(
+ new ChatComponentTranslation(
+ Integer.toString(
+ JewelrycraftUtil.getCursePoints(
+ entityplayermp))));
} else if (astring[0].equals("addCursePoints")) {
- int points = CommandBase.parseIntWithMin(commandSender,
- astring[2], 0);
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- JewelrycraftUtil.addCursePoints(entityplayermp, points);
+ int points = CommandBase.parseIntWithMin(
+ commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp,
+ points);
} else if (astring[0].equals("setCursePoints")) {
- int points = CommandBase.parseIntWithMin(commandSender,
- astring[2], 0);
- EntityPlayerMP entityplayermp =
- getPlayer(commandSender, astring[1]);
- JewelrycraftUtil.addCursePoints(entityplayermp, points
- - JewelrycraftUtil.getCursePoints(entityplayermp));
+ int points = CommandBase.parseIntWithMin(
+ commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(
+ commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp,
+ points - JewelrycraftUtil
+ .getCursePoints(entityplayermp));
}
}
@@ -74,16 +79,21 @@ public class JewelrycraftCommands extends CommandBase { public List addTabCompletionOptions(ICommandSender icommandsender,
String[] astring) {
final List<String> MATCHES = new LinkedList<String>();
- final String ARG_LC = astring[astring.length - 1].toLowerCase();
+ final String ARG_LC = astring[astring.length - 1]
+ .toLowerCase();
if (astring.length == 1) {
- if ("addCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("addCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("addCursePoints");
- if ("getCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("getCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("getCursePoints");
- if ("setCursePoints".toLowerCase().startsWith(ARG_LC))
+ if ("setCursePoints".toLowerCase()
+ .startsWith(ARG_LC))
MATCHES.add("setCursePoints");
} else if (astring.length == 2) {
- for (String un : MinecraftServer.getServer().getAllUsernames())
+ for (String un : MinecraftServer.getServer()
+ .getAllUsernames())
if (un.toLowerCase().startsWith(ARG_LC))
MATCHES.add(un);
}
|
