Skip to content

Commit

Permalink
Fix command sign exception; resolves #544
Browse files Browse the repository at this point in the history
  • Loading branch information
Sataniel98 committed Mar 7, 2019
1 parent f8fbeec commit 6523caa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public void onInit() {

command = lines[1];
delay = NumberUtil.parseInt(attributes[0]);
executor = attributes[1];
if (attributes.length >= 2) {
executor = attributes[1];
}

cCommand = CommandsXL.getPlugin().getCCommands().getCCommand(command);

Expand All @@ -98,10 +100,10 @@ public void onInit() {

@Override
public boolean onPlayerTrigger(final Player player) {
if (executor.equalsIgnoreCase("Console")) {
if ("Console".equalsIgnoreCase(executor)) {
new CCommandExecutorTask(player, cCommand, Bukkit.getConsoleSender(), true).runTaskLater(plugin, delay * 20);

} else if (executor.equalsIgnoreCase("OP")) {
} else if ("OP".equalsIgnoreCase(executor)) {
boolean isOp = player.isOp();

player.setOp(true);
Expand Down

0 comments on commit 6523caa

Please sign in to comment.