Channelcon toggles, bunch of fixes and improvements and stuff #84

Merged
NorbiPeti merged 7 commits from dev into master 2018-11-04 00:43:21 +00:00
2 changed files with 10 additions and 7 deletions
Showing only changes of commit 8721b623cb - Show all commits

View file

@ -59,19 +59,19 @@ public class RoleCommand extends DiscordCommandBase {
DiscordPlugin.sendMessageToChannel(message.getChannel(), usage + "\nUsage: " + argsa[0] + " <rolename>");
return null;
}
String rolename = argsa[1];
StringBuilder rolename = new StringBuilder(argsa[1]);
for (int i = 2; i < argsa.length; i++)
rolename += " " + argsa[i];
if (!DiscordPlugin.GameRoles.contains(rolename)) {
rolename.append(" ").append(argsa[i]);
if (!DiscordPlugin.GameRoles.contains(rolename.toString())) {
DiscordPlugin.sendMessageToChannel(message.getChannel(), "That game role cannot be found.");
listRoles(message);
return null;
}
final List<IRole> roles = DiscordPlugin.mainServer.getRolesByName(rolename);
final List<IRole> roles = DiscordPlugin.mainServer.getRolesByName(rolename.toString());
if (roles.size() == 0) {
DiscordPlugin.sendMessageToChannel(message.getChannel(),
"The specified role cannot be found on Discord! Removing from the list.");
DiscordPlugin.GameRoles.remove(rolename);
DiscordPlugin.GameRoles.remove(rolename.toString());
return null;
}
if (roles.size() > 1) {

View file

@ -1,6 +1,7 @@
package buttondevteam.discordplugin.mccommands;
import buttondevteam.discordplugin.DiscordPlugin;
import buttondevteam.discordplugin.DiscordSenderBase;
import buttondevteam.lib.chat.CommandClass;
import buttondevteam.lib.chat.TBMCCommandBase;
import org.bukkit.Bukkit;
@ -15,9 +16,11 @@ public class ResetMCCommand extends TBMCCommandBase { //Not player-only, so not
resetting = true; //Turned off after sending enable message (ReadyEvent)
sender.sendMessage("§bDisabling DiscordPlugin...");
Bukkit.getPluginManager().disablePlugin(DiscordPlugin.plugin);
sender.sendMessage("§bEnabling DiscordPlugin...");
if (!(sender instanceof DiscordSenderBase)) //Sending to Discord errors
sender.sendMessage("§bEnabling DiscordPlugin...");
Bukkit.getPluginManager().enablePlugin(DiscordPlugin.plugin);
sender.sendMessage("§bReset finished!");
if (!(sender instanceof DiscordSenderBase)) //Sending to Discord errors
sender.sendMessage("§bReset finished!");
});
return true;
}