Fixed slash-server commands ignoring pre-queue checks (e.g. joinfrom permission)
This commit is contained in:
+8
-4
@@ -1,6 +1,7 @@
|
|||||||
package us.ajg0702.queue.commands.commands.SlashServer;
|
package us.ajg0702.queue.commands.commands.SlashServer;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import us.ajg0702.queue.api.commands.IBaseCommand;
|
||||||
import us.ajg0702.queue.api.commands.ICommandSender;
|
import us.ajg0702.queue.api.commands.ICommandSender;
|
||||||
import us.ajg0702.queue.commands.BaseCommand;
|
import us.ajg0702.queue.commands.BaseCommand;
|
||||||
import us.ajg0702.queue.common.QueueMain;
|
import us.ajg0702.queue.common.QueueMain;
|
||||||
@@ -14,6 +15,10 @@ public class SlashServerCommand extends BaseCommand {
|
|||||||
final QueueMain main;
|
final QueueMain main;
|
||||||
final String server;
|
final String server;
|
||||||
final String command;
|
final String command;
|
||||||
|
|
||||||
|
private IBaseCommand moveCommand;
|
||||||
|
|
||||||
|
|
||||||
public SlashServerCommand(QueueMain main, String server) {
|
public SlashServerCommand(QueueMain main, String server) {
|
||||||
this.main = main;
|
this.main = main;
|
||||||
this.server = server;
|
this.server = server;
|
||||||
@@ -51,11 +56,10 @@ public class SlashServerCommand extends BaseCommand {
|
|||||||
sender.sendMessage(getMessages().getComponent("errors.player-only"));
|
sender.sendMessage(getMessages().getComponent("errors.player-only"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(main.getConfig().getBoolean("require-permission") && !sender.hasPermission("ajqueue.queue."+server)) {
|
if(moveCommand == null) {
|
||||||
sender.sendMessage(getMessages().getComponent("noperm"));
|
moveCommand = main.getPlatformMethods().getCommands().get(0);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
main.getQueueManager().addToQueue(main.getPlatformMethods().senderToPlayer(sender), server);
|
moveCommand.execute(sender, new String[]{server});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user