Supporting clean installs, broadcast toggles, command improvements #92
2 changed files with 28 additions and 1 deletions
|
@ -148,7 +148,8 @@ class MCListener implements Listener {
|
|||
String name = event.getSender() instanceof Player ? ((Player) event.getSender()).getDisplayName()
|
||||
: event.getSender().getName();
|
||||
//Channel channel = ChromaGamerBase.getFromSender(event.getSender()).channel().get(); - TODO
|
||||
MCChatUtils.forAllMCChat(MCChatUtils.send(name + " <:YEEHAW:" + DiscordPlugin.mainServer.getEmojiByName("YEEHAW").getStringID() + ">s")); //TODO: Don't require emoji
|
||||
val yeehaw = DiscordPlugin.mainServer.getEmojiByName("YEEHAW");
|
||||
MCChatUtils.forAllMCChat(MCChatUtils.send(name + (yeehaw != null ? " <:YEEHAW:" + yeehaw.getStringID() + ">s" : " YEEHAWs")));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package buttondevteam.discordplugin.mccommands;
|
||||
|
||||
import buttondevteam.discordplugin.DiscordPlugin;
|
||||
import buttondevteam.lib.chat.CommandClass;
|
||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@CommandClass(path = "discord reload")
|
||||
public class ReloadMCCommand extends TBMCCommandBase {
|
||||
@Override
|
||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||
if (DiscordPlugin.plugin.tryReloadConfig())
|
||||
sender.sendMessage("§bConfig reloaded."); //TODO: Convert to new command system
|
||||
else
|
||||
sender.sendMessage("§cFailed to reload config.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] GetHelpText(String alias) {
|
||||
return new String[]{
|
||||
"Reload",
|
||||
"Reloads the config. To apply some changes, you may need to also run /discord reset."
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue