Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added to /bw join and /bw gui the permission. #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public void execute(CommandSender s, String[] args) {
s.sendMessage(getMsg(p, Messages.COMMAND_JOIN_USAGE));
return;
}
if (!p.hasPermission("bw.join." + args[0].toLowerCase())) {
p.sendMessage(getMsg(p, Messages.COMMAND_NOT_FOUND_OR_INSUFF_PERMS));
return;
}
if (args[0].equalsIgnoreCase("random")) {
if (!ArenaManager.getInstance().joinRandomArena(p)) {
s.sendMessage(getMsg(p, Messages.COMMAND_JOIN_NO_EMPTY_FOUND));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.andrei1058.bedwars.proxy.command.main;

import com.andrei1058.bedwars.proxy.api.Messages;
import com.andrei1058.bedwars.proxy.arenamanager.ArenaGUI;
import com.andrei1058.bedwars.proxy.command.SubCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;

import static com.andrei1058.bedwars.proxy.language.Language.getMsg;

public class SelectorCMD extends SubCommand {
/**
* Create a new sub-command.
Expand All @@ -28,7 +31,10 @@ public void execute(CommandSender s, String[] args) {
if (args.length == 1) {
group = args[0];
}

if (!p.hasPermission("bw.gui." + group.toLowerCase())) {
p.sendMessage(getMsg(p, Messages.COMMAND_NOT_FOUND_OR_INSUFF_PERMS));
return;
}
ArenaGUI.openGui(p, group);
}
}