Fix
This commit is contained in:
parent
17887707cb
commit
8721b623cb
2 changed files with 10 additions and 7 deletions
|
@ -59,19 +59,19 @@ public class RoleCommand extends DiscordCommandBase {
|
||||||
DiscordPlugin.sendMessageToChannel(message.getChannel(), usage + "\nUsage: " + argsa[0] + " <rolename>");
|
DiscordPlugin.sendMessageToChannel(message.getChannel(), usage + "\nUsage: " + argsa[0] + " <rolename>");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String rolename = argsa[1];
|
StringBuilder rolename = new StringBuilder(argsa[1]);
|
||||||
for (int i = 2; i < argsa.length; i++)
|
for (int i = 2; i < argsa.length; i++)
|
||||||
rolename += " " + argsa[i];
|
rolename.append(" ").append(argsa[i]);
|
||||||
if (!DiscordPlugin.GameRoles.contains(rolename)) {
|
if (!DiscordPlugin.GameRoles.contains(rolename.toString())) {
|
||||||
DiscordPlugin.sendMessageToChannel(message.getChannel(), "That game role cannot be found.");
|
DiscordPlugin.sendMessageToChannel(message.getChannel(), "That game role cannot be found.");
|
||||||
listRoles(message);
|
listRoles(message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final List<IRole> roles = DiscordPlugin.mainServer.getRolesByName(rolename);
|
final List<IRole> roles = DiscordPlugin.mainServer.getRolesByName(rolename.toString());
|
||||||
if (roles.size() == 0) {
|
if (roles.size() == 0) {
|
||||||
DiscordPlugin.sendMessageToChannel(message.getChannel(),
|
DiscordPlugin.sendMessageToChannel(message.getChannel(),
|
||||||
"The specified role cannot be found on Discord! Removing from the list.");
|
"The specified role cannot be found on Discord! Removing from the list.");
|
||||||
DiscordPlugin.GameRoles.remove(rolename);
|
DiscordPlugin.GameRoles.remove(rolename.toString());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (roles.size() > 1) {
|
if (roles.size() > 1) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package buttondevteam.discordplugin.mccommands;
|
package buttondevteam.discordplugin.mccommands;
|
||||||
|
|
||||||
import buttondevteam.discordplugin.DiscordPlugin;
|
import buttondevteam.discordplugin.DiscordPlugin;
|
||||||
|
import buttondevteam.discordplugin.DiscordSenderBase;
|
||||||
import buttondevteam.lib.chat.CommandClass;
|
import buttondevteam.lib.chat.CommandClass;
|
||||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
@ -15,8 +16,10 @@ public class ResetMCCommand extends TBMCCommandBase { //Not player-only, so not
|
||||||
resetting = true; //Turned off after sending enable message (ReadyEvent)
|
resetting = true; //Turned off after sending enable message (ReadyEvent)
|
||||||
sender.sendMessage("§bDisabling DiscordPlugin...");
|
sender.sendMessage("§bDisabling DiscordPlugin...");
|
||||||
Bukkit.getPluginManager().disablePlugin(DiscordPlugin.plugin);
|
Bukkit.getPluginManager().disablePlugin(DiscordPlugin.plugin);
|
||||||
|
if (!(sender instanceof DiscordSenderBase)) //Sending to Discord errors
|
||||||
sender.sendMessage("§bEnabling DiscordPlugin...");
|
sender.sendMessage("§bEnabling DiscordPlugin...");
|
||||||
Bukkit.getPluginManager().enablePlugin(DiscordPlugin.plugin);
|
Bukkit.getPluginManager().enablePlugin(DiscordPlugin.plugin);
|
||||||
|
if (!(sender instanceof DiscordSenderBase)) //Sending to Discord errors
|
||||||
sender.sendMessage("§bReset finished!");
|
sender.sendMessage("§bReset finished!");
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue