Skip to content
This repository was archived by the owner on Mar 6, 2021. It is now read-only.

Commit 483a1cf

Browse files
author
Kier Davis
committed
Fix compile errors
1 parent b4d22fc commit 483a1cf

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

src/ListCommandHandler.java

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import com.kierdavis.flex.FlexCommandContext;
44
import com.kierdavis.flex.FlexHandler;
5+
import java.util.Iterator;
6+
import java.util.List;
7+
import java.util.Set;
58
import org.bukkit.ChatColor;
69

710
public class ListCommandHandler {
@@ -17,16 +20,16 @@ public boolean doList(FlexCommandContext ctx) {
1720
Set<String> cmds = plugin.getCustomCommands();
1821

1922
if (cmds.size() == 0) {
20-
getSender().sendMessage(ChatColor.YELLOW + "No defined commands.");
23+
ctx.getSender().sendMessage(ChatColor.YELLOW + "No defined commands.");
2124
}
2225

2326
else {
2427
Iterator<String> it = cmds.iterator();
25-
getSender().sendMessage(ChatColor.YELLOW + "Defined commands:");
28+
ctx.getSender().sendMessage(ChatColor.YELLOW + "Defined commands:");
2629

2730
while (it.hasNext()) {
2831
String name = (String) it.next();
29-
getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + name);
32+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + name);
3033
}
3134
}
3235

@@ -37,7 +40,7 @@ public boolean doList(FlexCommandContext ctx) {
3740
String name = ctx.getArg(0);
3841

3942
if (!plugin.hasCustomCommand(name)) {
40-
getSender().sendMessage(ChatColor.YELLOW + "Command " + ChatColor.GREEN + name + ChatColor.YELLOW + " does not exist.");
43+
ctx.getSender().sendMessage(ChatColor.YELLOW + "Command " + ChatColor.GREEN + name + ChatColor.YELLOW + " does not exist.");
4144
return false;
4245
}
4346

@@ -47,53 +50,53 @@ public boolean doList(FlexCommandContext ctx) {
4750
List<String> consoleCommands = plugin.getConsoleCommands(name);
4851
String usage = plugin.getUsage(name);
4952

50-
getSender().sendMessage(ChatColor.GREEN + name + ChatColor.YELLOW + ":");
53+
ctx.getSender().sendMessage(ChatColor.GREEN + name + ChatColor.YELLOW + ":");
5154

5255
if (text == null || text.size() == 0) {
53-
getSender().sendMessage(" " + ChatColor.YELLOW + "No text for this command.");
56+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "No text for this command.");
5457
}
5558
else {
56-
getSender().sendMessage(" " + ChatColor.YELLOW + "Text:");
59+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "Text:");
5760
for (int i = 0; i < text.size(); i++) {
58-
getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', text.get(i)));
61+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', text.get(i)));
5962
}
6063
}
6164

6265
if (chat == null || chat.size() == 0) {
63-
getSender().sendMessage(" " + ChatColor.YELLOW + "No chat for this command.");
66+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "No chat for this command.");
6467
}
6568
else {
66-
getSender().sendMessage(" " + ChatColor.YELLOW + "Chat:");
69+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "Chat:");
6770
for (int i = 0; i < chat.size(); i++) {
68-
getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', chat.get(i)));
71+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', chat.get(i)));
6972
}
7073
}
7174

7275
if (playerCommands == null || playerCommands.size() == 0) {
73-
getSender().sendMessage(" " + ChatColor.YELLOW + "No player commands for this command.");
76+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "No player commands for this command.");
7477
}
7578
else {
76-
getSender().sendMessage(" " + ChatColor.YELLOW + "Player commands:");
79+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "Player commands:");
7780
for (int i = 0; i < playerCommands.size(); i++) {
78-
getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + playerCommands.get(i));
81+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + playerCommands.get(i));
7982
}
8083
}
8184

8285
if (consoleCommands == null || consoleCommands.size() == 0) {
83-
getSender().sendMessage(" " + ChatColor.YELLOW + "No console commands for this command.");
86+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "No console commands for this command.");
8487
}
8588
else {
86-
getSender().sendMessage(" " + ChatColor.YELLOW + "Console commands:");
89+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "Console commands:");
8790
for (int i = 0; i < consoleCommands.size(); i++) {
88-
getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + consoleCommands.get(i));
91+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "- " + ChatColor.GREEN + consoleCommands.get(i));
8992
}
9093
}
9194

9295
if (usage == null || usage.length() == 0) {
93-
getSender().sendMessage(" " + ChatColor.YELLOW + "No usage text for this command.");
96+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "No usage text for this command.");
9497
}
9598
else {
96-
getSender().sendMessage(" " + ChatColor.YELLOW + "Usage text: " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', usage));
99+
ctx.getSender().sendMessage(" " + ChatColor.YELLOW + "Usage text: " + ChatColor.WHITE + ChatColor.translateAlternateColorCodes('&', usage));
97100
}
98101

99102
return true;

src/RemoveCommandHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public RemoveCommandHandler(UltraCommand plugin_) {
1313

1414
@FlexHandler(value="ultracommand remove", permission="ultracommand.configure")
1515
public boolean doRemove(FlexCommandContext ctx) {
16-
String name = getArg(0);
16+
String name = ctx.getArg(0);
1717
boolean success = plugin.removeCustomCommand(name);
1818

1919
if (success) {
@@ -28,7 +28,7 @@ public boolean doRemove(FlexCommandContext ctx) {
2828

2929
@FlexHandler(value="ultracommand remove text", permission="ultracommand.configure")
3030
public boolean doRemoveText(FlexCommandContext ctx) {
31-
String name = getArg(0);
31+
String name = ctx.getArg(0);
3232
boolean success = plugin.clearText(name);
3333

3434
if (success) {
@@ -43,7 +43,7 @@ public boolean doRemoveText(FlexCommandContext ctx) {
4343

4444
@FlexHandler(value="ultracommand remove chat", permission="ultracommand.configure")
4545
public boolean doRemoveChat(FlexCommandContext ctx) {
46-
String name = getArg(0);
46+
String name = ctx.getArg(0);
4747
boolean success = plugin.clearChat(name);
4848

4949
if (success) {
@@ -58,7 +58,7 @@ public boolean doRemoveChat(FlexCommandContext ctx) {
5858

5959
@FlexHandler(value="ultracommand remove pcmd", permission="ultracommand.configure")
6060
public boolean doRemovePcmd(FlexCommandContext ctx) {
61-
String name = getArg(0);
61+
String name = ctx.getArg(0);
6262
boolean success = plugin.clearPlayerCommands(name);
6363

6464
if (success) {
@@ -73,7 +73,7 @@ public boolean doRemovePcmd(FlexCommandContext ctx) {
7373

7474
@FlexHandler(value="ultracommand remove ccmd", permission="ultracommand.configure")
7575
public boolean doRemoveCcmd(FlexCommandContext ctx) {
76-
String name = getArg(0);
76+
String name = ctx.getArg(0);
7777
boolean success = plugin.clearConsoleCommands(name);
7878

7979
if (success) {
@@ -88,7 +88,7 @@ public boolean doRemoveCcmd(FlexCommandContext ctx) {
8888

8989
@FlexHandler(value="ultracommand remove usage", permission="ultracommand.configure")
9090
public boolean doRemoveUsage(FlexCommandContext ctx) {
91-
String name = getArg(0);
91+
String name = ctx.getArg(0);
9292
boolean success = plugin.setUsage(name, null);
9393

9494
if (success) {

0 commit comments

Comments
 (0)