1.14 support, fixes #105

Merged
NorbiPeti merged 21 commits from dev into master 2019-10-30 18:35:43 +00:00
5 changed files with 25 additions and 2 deletions
Showing only changes of commit 049ad55168 - Show all commits

View file

@ -4,6 +4,7 @@ import buttondevteam.chat.commands.MWikiCommand;
import buttondevteam.chat.commands.ucmds.HelpCommand; import buttondevteam.chat.commands.ucmds.HelpCommand;
import buttondevteam.chat.commands.ucmds.HistoryCommand; import buttondevteam.chat.commands.ucmds.HistoryCommand;
import buttondevteam.chat.commands.ucmds.InfoCommand; import buttondevteam.chat.commands.ucmds.InfoCommand;
import buttondevteam.chat.commands.ucmds.ReloadCommand;
import buttondevteam.chat.commands.ucmds.admin.DebugCommand; import buttondevteam.chat.commands.ucmds.admin.DebugCommand;
import buttondevteam.chat.components.announce.AnnouncerComponent; import buttondevteam.chat.components.announce.AnnouncerComponent;
import buttondevteam.chat.components.appendext.AppendTextComponent; import buttondevteam.chat.components.appendext.AppendTextComponent;
@ -77,6 +78,7 @@ public class PluginMain extends ButtonPlugin { // Translated to Java: 2015.07.15
getCommand2MC().registerCommand(new HistoryCommand()); getCommand2MC().registerCommand(new HistoryCommand());
getCommand2MC().registerCommand(new InfoCommand()); getCommand2MC().registerCommand(new InfoCommand());
getCommand2MC().registerCommand(new MWikiCommand()); getCommand2MC().registerCommand(new MWikiCommand());
getCommand2MC().registerCommand(new ReloadCommand());
} }
public static Essentials essentials = null; public static Essentials essentials = null;

View file

@ -0,0 +1,20 @@
package buttondevteam.chat.commands.ucmds;
import buttondevteam.chat.PluginMain;
import buttondevteam.lib.chat.Command2;
import buttondevteam.lib.chat.CommandClass;
import org.bukkit.command.CommandSender;
@CommandClass(helpText = {
"Reload",
"Reloads Thorpe-Chat"
}, modOnly = true)
public class ReloadCommand extends UCommandBase {
@Command2.Subcommand
public void def(CommandSender sender) {
if (PluginMain.Instance.tryReloadConfig())
sender.sendMessage("§bReloaded config");
else
sender.sendMessage("§cFailed to reload config.");
}
}

View file

@ -113,6 +113,7 @@ public class TownColorComponent extends Component<PluginMain> implements Listene
if (useNationColors().get()) if (useNationColors().get())
registerCommand(new buttondevteam.chat.components.towncolors.admin.NationColorCommand()); registerCommand(new buttondevteam.chat.components.towncolors.admin.NationColorCommand());
registerCommand(new TCCount()); registerCommand(new TCCount());
registerCommand(new NColorCommand());
registerListener(new TownyListener()); registerListener(new TownyListener());
registerListener(this); registerListener(this);
} }

View file

@ -35,7 +35,7 @@ public class NationColorCommand extends AdminCommandBase {
if (!c.get().getName().equals(Color.White.getName())) { //Default nation color if (!c.get().getName().equals(Color.White.getName())) { //Default nation color
for (val e : TownColorComponent.NationColor.entrySet()) { for (val e : TownColorComponent.NationColor.entrySet()) {
if (e.getValue().getName().equals(c.get().getName())) { if (e.getValue().getName().equals(c.get().getName())) {
sender.sendMessage("§The nation " + e.getKey() + " already uses this color!"); sender.sendMessage("§cThe nation " + e.getKey() + " already uses this color!");
return true; return true;
} }
} }

View file

@ -41,7 +41,7 @@ public class TownColorCommand extends AdminCommandBase { //TODO: Command path al
val c = getColorOrSendError(colors[i], sender); val c = getColorOrSendError(colors[i], sender);
if (!c.isPresent()) if (!c.isPresent())
return true; return true;
clrs[i - 1] = c.get(); clrs[i] = c.get();
} }
Color tnc; Color tnc;
boolean usenc = TownColorComponent.getComponent().useNationColors().get(); boolean usenc = TownColorComponent.getComponent().useNationColors().get();