Add MiniMessage
This commit is contained in:
parent
bb5c642f31
commit
083012abfe
74 changed files with 1328 additions and 1078 deletions
|
|
@ -7,11 +7,12 @@ import java.util.Optional;
|
|||
import net.frankheijden.serverutils.common.entities.ServerUtilsPluginDescription;
|
||||
import net.frankheijden.serverutils.common.entities.results.CloseablePluginResult;
|
||||
import net.frankheijden.serverutils.common.entities.results.PluginResult;
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
import net.frankheijden.serverutils.common.entities.ServerUtilsAudience;
|
||||
import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin;
|
||||
import net.frankheijden.serverutils.common.tasks.UpdateCheckerTask;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C extends ServerCommandSender<S>, S, D extends ServerUtilsPluginDescription> {
|
||||
public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C extends ServerUtilsAudience<S>, S, D extends ServerUtilsPluginDescription> {
|
||||
|
||||
public static final int BSTATS_METRICS_ID = 7790;
|
||||
public static final String VERSION = "{version}";
|
||||
|
|
@ -31,7 +32,7 @@ public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C
|
|||
U extends ServerUtilsPlugin<P, T, C, S, D>,
|
||||
P,
|
||||
T,
|
||||
C extends ServerCommandSender<S>,
|
||||
C extends ServerUtilsAudience<S>,
|
||||
S,
|
||||
D extends ServerUtilsPluginDescription
|
||||
> void init(
|
||||
|
|
@ -45,7 +46,7 @@ public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C
|
|||
* Tries checking for updates if enabled by the config.
|
||||
*/
|
||||
public static void tryCheckForUpdates() {
|
||||
UpdateCheckerTask.tryStart(getPlugin(), getPlugin().getChatProvider().getConsoleSender(), "boot");
|
||||
UpdateCheckerTask.tryStart(getPlugin(), getPlugin().getChatProvider().getConsoleServerAudience(), "boot");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,13 +66,15 @@ public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C
|
|||
File file = plugin.getPluginManager().getPluginFile(updaterPlugin);
|
||||
PluginResult<P> disableResult = plugin.getPluginManager().disablePlugin(updaterPlugin);
|
||||
if (!disableResult.isSuccess()) {
|
||||
disableResult.getResult().sendTo(plugin.getChatProvider().getConsoleSender(), "disabl", updaterName);
|
||||
Component component = disableResult.toComponent(null);
|
||||
plugin.getChatProvider().getConsoleServerAudience().sendMessage(component);
|
||||
return;
|
||||
}
|
||||
|
||||
CloseablePluginResult<P> unloadResult = plugin.getPluginManager().unloadPlugin(disableResult.getPlugin());
|
||||
if (!unloadResult.isSuccess()) {
|
||||
unloadResult.getResult().sendTo(plugin.getChatProvider().getConsoleSender(), "unload", updaterName);
|
||||
Component component = unloadResult.toComponent(null);
|
||||
plugin.getChatProvider().getConsoleServerAudience().sendMessage(component);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +99,7 @@ public class ServerUtilsApp<U extends ServerUtilsPlugin<P, T, C, S, D>, P, T, C
|
|||
U extends ServerUtilsPlugin<P, T, C, S, D>,
|
||||
P,
|
||||
T,
|
||||
C extends ServerCommandSender<S>,
|
||||
C extends ServerUtilsAudience<S>,
|
||||
S,
|
||||
D extends ServerUtilsPluginDescription
|
||||
> U getPlugin() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue