Avoid component newlines, instead send message per line

This commit is contained in:
Frank van der Heijden 2021-08-03 16:41:09 +02:00
parent 083012abfe
commit 12b3aa5720
No known key found for this signature in database
GPG key ID: B808721C2DD5B5B8
11 changed files with 133 additions and 160 deletions

View file

@ -10,7 +10,6 @@ import net.frankheijden.serverutils.common.entities.results.PluginResult;
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 ServerUtilsAudience<S>, S, D extends ServerUtilsPluginDescription> {
@ -66,15 +65,13 @@ 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()) {
Component component = disableResult.toComponent(null);
plugin.getChatProvider().getConsoleServerAudience().sendMessage(component);
disableResult.sendTo(plugin.getChatProvider().getConsoleServerAudience(), null);
return;
}
CloseablePluginResult<P> unloadResult = plugin.getPluginManager().unloadPlugin(disableResult.getPlugin());
if (!unloadResult.isSuccess()) {
Component component = unloadResult.toComponent(null);
plugin.getChatProvider().getConsoleServerAudience().sendMessage(component);
unloadResult.sendTo(plugin.getChatProvider().getConsoleServerAudience(), null);
return;
}