Renamed permission
This commit is contained in:
parent
eca680000b
commit
f6bfb40a81
2 changed files with 5 additions and 4 deletions
|
@ -52,8 +52,9 @@ public class ShowAPI {
|
||||||
throw new InvalidTriggerException("Provided trigger " + triggerType + " does not exists!");
|
throw new InvalidTriggerException("Provided trigger " + triggerType + " does not exists!");
|
||||||
|
|
||||||
Constructor<T> ctor = (Constructor<T>) triggers.get(triggerType).getConstructor(String[].class);
|
Constructor<T> ctor = (Constructor<T>) triggers.get(triggerType).getConstructor(String[].class);
|
||||||
if (dataSplitter.length < triggers.get(triggerType).getAnnotation(TriggerIdentifier.class).minArgs() + 1)
|
TriggerIdentifier identifier = triggers.get(triggerType).getAnnotation(TriggerIdentifier.class);
|
||||||
throw new TooFewArgumentsException("Provided triggerdata " + data + " has too few arguments!");
|
if (dataSplitter.length < identifier.minArgs() + 1)
|
||||||
|
throw new TooFewArgumentsException(identifier.argDesc());
|
||||||
return ctor.newInstance(new Object[]{dataSplitterNew});
|
return ctor.newInstance(new Object[]{dataSplitterNew});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandAlias("showcontrol|sc")
|
@CommandAlias("showcontrol|sc")
|
||||||
@CommandPermission("mctp.show")
|
@CommandPermission("sc.admin")
|
||||||
public class ShowCMD extends BaseCommand {
|
public class ShowCMD extends BaseCommand {
|
||||||
@Subcommand("create")
|
@Subcommand("create")
|
||||||
@Description("")
|
@Description("")
|
||||||
|
@ -71,7 +71,7 @@ public class ShowCMD extends BaseCommand {
|
||||||
sender.sendMessage(ChatColor.RED + "The provided trigger does not exists.");
|
sender.sendMessage(ChatColor.RED + "The provided trigger does not exists.");
|
||||||
return;
|
return;
|
||||||
} catch (TooFewArgumentsException e) {
|
} catch (TooFewArgumentsException e) {
|
||||||
sender.sendMessage(ChatColor.RED + "You did not provide enough information for the chosen trigger.");
|
sender.sendMessage(ChatColor.RED + "You did not provide enough information for the chosen trigger! Required arguments: " + e.getMessage());
|
||||||
return;
|
return;
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
sender.sendMessage(ChatColor.RED + "Couldn't create the trigger: " + e.getMessage());
|
sender.sendMessage(ChatColor.RED + "Couldn't create the trigger: " + e.getMessage());
|
||||||
|
|
Loading…
Add table
Reference in a new issue