Fix placeholders not parsing inside log messages (#5635)

This commit is contained in:
Josh Roy 2024-02-03 21:13:18 -05:00 committed by GitHub
parent 746627c4b5
commit 23093b68d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 123 additions and 92 deletions

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -79,7 +80,7 @@ public class Backup implements Runnable {
taskLock.complete(new Object()); taskLock.complete(new Object());
return; return;
} }
ess.getLogger().log(Level.INFO, tlLiteral("backupStarted")); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("backupStarted")));
final CommandSender cs = server.getConsoleSender(); final CommandSender cs = server.getConsoleSender();
server.dispatchCommand(cs, "save-all"); server.dispatchCommand(cs, "save-all");
server.dispatchCommand(cs, "save-off"); server.dispatchCommand(cs, "save-off");
@ -118,7 +119,7 @@ public class Backup implements Runnable {
} }
active = false; active = false;
taskLock.complete(new Object()); taskLock.complete(new Object());
ess.getLogger().log(Level.INFO, tlLiteral("backupFinished")); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("backupFinished")));
} }
} }

View File

@ -232,7 +232,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
i18n.updateLocale("en"); i18n.updateLocale("en");
Console.setInstance(this); Console.setInstance(this);
LOGGER.log(Level.INFO, tlLiteral("usingTempFolderForTesting")); LOGGER.log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("usingTempFolderForTesting")));
LOGGER.log(Level.INFO, dataFolder.toString()); LOGGER.log(Level.INFO, dataFolder.toString());
settings = new Settings(this); settings = new Settings(this);
mail = new MailServiceImpl(this); mail = new MailServiceImpl(this);
@ -282,33 +282,33 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
switch (VersionUtil.getServerSupportStatus()) { switch (VersionUtil.getServerSupportStatus()) {
case NMS_CLEANROOM: case NMS_CLEANROOM:
getLogger().severe(tlLiteral("serverUnsupportedCleanroom")); getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedCleanroom")));
break; break;
case DANGEROUS_FORK: case DANGEROUS_FORK:
getLogger().severe(tlLiteral("serverUnsupportedDangerous")); getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedDangerous")));
break; break;
case STUPID_PLUGIN: case STUPID_PLUGIN:
getLogger().severe(tlLiteral("serverUnsupportedDumbPlugins")); getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedDumbPlugins")));
break; break;
case UNSTABLE: case UNSTABLE:
getLogger().severe(tlLiteral("serverUnsupportedMods")); getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedMods")));
break; break;
case OUTDATED: case OUTDATED:
getLogger().severe(tlLiteral("serverUnsupported")); getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupported")));
break; break;
case LIMITED: case LIMITED:
getLogger().info(tlLiteral("serverUnsupportedLimitedApi")); getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedLimitedApi")));
break; break;
} }
if (VersionUtil.getSupportStatusClass() != null) { if (VersionUtil.getSupportStatusClass() != null) {
getLogger().info(tlLiteral("serverUnsupportedClass", VersionUtil.getSupportStatusClass())); getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedClass", VersionUtil.getSupportStatusClass())));
} }
final PluginManager pm = getServer().getPluginManager(); final PluginManager pm = getServer().getPluginManager();
for (final Plugin plugin : pm.getPlugins()) { for (final Plugin plugin : pm.getPlugins()) {
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) { if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {
getLogger().warning(tlLiteral("versionMismatch", plugin.getDescription().getName())); getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("versionMismatch", plugin.getDescription().getName())));
} }
} }
@ -582,7 +582,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
public void onDisable() { public void onDisable() {
final boolean stopping = getServerStateProvider().isStopping(); final boolean stopping = getServerStateProvider().isStopping();
if (!stopping) { if (!stopping) {
LOGGER.log(Level.SEVERE, tlLiteral("serverReloading")); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("serverReloading")));
} }
getBackup().setPendingShutdown(true); getBackup().setPendingShutdown(true);
for (final User user : getOnlineUsers()) { for (final User user : getOnlineUsers()) {
@ -602,7 +602,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
} }
cleanupOpenInventories(); cleanupOpenInventories();
if (getBackup().getTaskLock() != null && !getBackup().getTaskLock().isDone()) { if (getBackup().getTaskLock() != null && !getBackup().getTaskLock().isDone()) {
LOGGER.log(Level.SEVERE, tlLiteral("backupInProgress")); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("backupInProgress")));
getBackup().getTaskLock().join(); getBackup().getTaskLock().join();
} }
if (i18n != null) { if (i18n != null) {
@ -709,7 +709,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
cmd = loadCommand(commandPath, command.getName(), module, classLoader); cmd = loadCommand(commandPath, command.getName(), module, classLoader);
} catch (final Exception ex) { } catch (final Exception ex) {
sender.sendTl("commandNotLoaded", commandLabel); sender.sendTl("commandNotLoaded", commandLabel);
LOGGER.log(Level.SEVERE, tlLiteral("commandNotLoaded", commandLabel), ex); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandNotLoaded", commandLabel)), ex);
return Collections.emptyList(); return Collections.emptyList();
} }
@ -732,11 +732,11 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
} catch (final Exception ex) { } catch (final Exception ex) {
showError(sender, ex, commandLabel); showError(sender, ex, commandLabel);
// Tab completion shouldn't fail // Tab completion shouldn't fail
LOGGER.log(Level.SEVERE, tlLiteral("commandFailed", commandLabel), ex); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandFailed", commandLabel)), ex);
return Collections.emptyList(); return Collections.emptyList();
} }
} catch (final Throwable ex) { } catch (final Throwable ex) {
LOGGER.log(Level.SEVERE, tlLiteral("commandFailed", commandLabel), ex); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandFailed", commandLabel)), ex);
return Collections.emptyList(); return Collections.emptyList();
} }
} }
@ -820,13 +820,13 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
cmd = loadCommand(commandPath, command.getName(), module, classLoader); cmd = loadCommand(commandPath, command.getName(), module, classLoader);
} catch (final Exception ex) { } catch (final Exception ex) {
sender.sendTl("commandNotLoaded", commandLabel); sender.sendTl("commandNotLoaded", commandLabel);
LOGGER.log(Level.SEVERE, tlLiteral("commandNotLoaded", commandLabel), ex); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandNotLoaded", commandLabel)), ex);
return true; return true;
} }
// Check authorization // Check authorization
if (user != null && !user.isAuthorized(cmd, permissionPrefix)) { if (user != null && !user.isAuthorized(cmd, permissionPrefix)) {
LOGGER.log(Level.INFO, tlLiteral("deniedAccessCommand", user.getName())); LOGGER.log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("deniedAccessCommand", user.getName())));
user.sendTl("noAccessCommand"); user.sendTl("noAccessCommand");
return true; return true;
} }
@ -877,7 +877,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
return true; return true;
} }
} catch (final Throwable ex) { } catch (final Throwable ex) {
LOGGER.log(Level.SEVERE, tlLiteral("commandFailed", commandLabel), ex); LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandFailed", commandLabel)), ex);
return true; return true;
} }
} }
@ -909,7 +909,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
sender.sendTl("errorWithMessage", exception.getMessage()); sender.sendTl("errorWithMessage", exception.getMessage());
} }
if (getSettings().isDebug()) { if (getSettings().isDebug()) {
LOGGER.log(Level.INFO, tlLiteral("errorCallingCommand", commandLabel), exception); LOGGER.log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("errorCallingCommand", commandLabel)), exception);
} }
} }

View File

@ -6,6 +6,7 @@ import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput; import com.earth2me.essentials.textreader.TextInput;
import com.earth2me.essentials.textreader.TextPager; import com.earth2me.essentials.textreader.TextPager;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommonPlaceholders; import com.earth2me.essentials.utils.CommonPlaceholders;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
@ -188,7 +189,7 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
} }
} }
ess.getLogger().info(tlLiteral("mutedUserSpeaks", user.getName(), event.getMessage())); ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("mutedUserSpeaks", user.getName(), event.getMessage())));
} }
try { try {
final Iterator<Player> it = event.getRecipients().iterator(); final Iterator<Player> it = event.getRecipients().iterator();
@ -669,7 +670,7 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
user.sendTl("voiceSilencedTime", dateDiff); user.sendTl("voiceSilencedTime", dateDiff);
} }
} }
ess.getLogger().info(tlLiteral("mutedUserSpeaks", player.getName(), event.getMessage())); ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("mutedUserSpeaks", player.getName(), event.getMessage())));
return; return;
} }

View File

@ -495,7 +495,7 @@ public class EssentialsUpgrade {
doneFile.setProperty("move" + name + "ToFile", true); doneFile.setProperty("move" + name + "ToFile", true);
doneFile.save(); doneFile.save();
} catch (final IOException e) { } catch (final IOException e) {
ess.getLogger().log(Level.SEVERE, tlLiteral("upgradingFilesError"), e); ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("upgradingFilesError")), e);
} }
} }
@ -658,15 +658,15 @@ public class EssentialsUpgrade {
final File tmpFile = new File(listOfFile.getParentFile(), sanitizedFilename + ".tmp"); final File tmpFile = new File(listOfFile.getParentFile(), sanitizedFilename + ".tmp");
final File newFile = new File(listOfFile.getParentFile(), sanitizedFilename); final File newFile = new File(listOfFile.getParentFile(), sanitizedFilename);
if (!listOfFile.renameTo(tmpFile)) { if (!listOfFile.renameTo(tmpFile)) {
ess.getLogger().log(Level.WARNING, tlLiteral("userdataMoveError", filename, sanitizedFilename)); ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("userdataMoveError", filename, sanitizedFilename)));
continue; continue;
} }
if (newFile.exists()) { if (newFile.exists()) {
ess.getLogger().log(Level.WARNING, tlLiteral("duplicatedUserdata", filename, sanitizedFilename)); ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("duplicatedUserdata", filename, sanitizedFilename)));
continue; continue;
} }
if (!tmpFile.renameTo(newFile)) { if (!tmpFile.renameTo(newFile)) {
ess.getLogger().log(Level.WARNING, tlLiteral("userdataMoveBackError", sanitizedFilename, sanitizedFilename)); ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("userdataMoveBackError", sanitizedFilename, sanitizedFilename)));
} }
} }
doneFile.setProperty("sanitizeAllUserFilenames", true); doneFile.setProperty("sanitizeAllUserFilenames", true);

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials;
import com.earth2me.essentials.config.ConfigurateUtil; import com.earth2me.essentials.config.ConfigurateUtil;
import com.earth2me.essentials.config.EssentialsConfiguration; import com.earth2me.essentials.config.EssentialsConfiguration;
import com.earth2me.essentials.config.entities.LazyLocation; import com.earth2me.essentials.config.entities.LazyLocation;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import net.ess3.api.IUser; import net.ess3.api.IUser;
import net.ess3.api.TranslatableException; import net.ess3.api.TranslatableException;
@ -294,9 +295,9 @@ public class Jails implements net.ess3.api.IJails {
event.setRespawnLocation(getJail(user.getJail())); event.setRespawnLocation(getJail(user.getJail()));
} catch (final Exception ex) { } catch (final Exception ex) {
if (ess.getSettings().isDebug()) { if (ess.getSettings().isDebug()) {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())), ex);
} else { } else {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())));
} }
} }
} }
@ -316,9 +317,9 @@ public class Jails implements net.ess3.api.IJails {
event.setTo(getJail(user.getJail())); event.setTo(getJail(user.getJail()));
} catch (final Exception ex) { } catch (final Exception ex) {
if (ess.getSettings().isDebug()) { if (ess.getSettings().isDebug()) {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())), ex);
} else { } else {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())));
} }
} }
user.sendTl("jailMessage"); user.sendTl("jailMessage");
@ -340,9 +341,9 @@ public class Jails implements net.ess3.api.IJails {
final CompletableFuture<Boolean> future = new CompletableFuture<>(); final CompletableFuture<Boolean> future = new CompletableFuture<>();
future.exceptionally(ex -> { future.exceptionally(ex -> {
if (ess.getSettings().isDebug()) { if (ess.getSettings().isDebug()) {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())), ex);
} else { } else {
ess.getLogger().log(Level.INFO, tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())));
} }
return false; return false;
}); });

View File

@ -6,6 +6,7 @@ import com.earth2me.essentials.craftbukkit.Inventories;
import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.SimpleTextInput; import com.earth2me.essentials.textreader.SimpleTextInput;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
@ -193,7 +194,7 @@ public class Kit {
if (kitItem.startsWith("@")) { if (kitItem.startsWith("@")) {
if (ess.getSerializationProvider() == null) { if (ess.getSerializationProvider() == null) {
ess.getLogger().log(Level.WARNING, tlLiteral("kitError3", kitName, user.getName())); ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("kitError3", kitName, user.getName())));
continue; continue;
} }
stack = ess.getSerializationProvider().deserializeItem(Base64Coder.decodeLines(kitItem.substring(1))); stack = ess.getSerializationProvider().deserializeItem(Base64Coder.decodeLines(kitItem.substring(1)));

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
@ -45,7 +46,7 @@ public class ManagedFile {
try { try {
copyResourceAscii("/" + filename, file); copyResourceAscii("/" + filename, file);
} catch (final IOException ex) { } catch (final IOException ex) {
Essentials.getWrappedLogger().log(Level.SEVERE, tlLiteral("itemsCsvNotLoaded", filename), ex); Essentials.getWrappedLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("itemsCsvNotLoaded", filename)), ex);
} }
} }
} }

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.EnumUtil; import com.earth2me.essentials.utils.EnumUtil;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
@ -171,7 +172,7 @@ public enum Mob {
public Entity spawn(final World world, final Server server, final Location loc) throws MobException { public Entity spawn(final World world, final Server server, final Location loc) throws MobException {
final Entity entity = world.spawn(loc, this.bukkitType.getEntityClass()); final Entity entity = world.spawn(loc, this.bukkitType.getEntityClass());
if (entity == null) { if (entity == null) {
Essentials.getWrappedLogger().log(Level.WARNING, tlLiteral("unableToSpawnMob")); Essentials.getWrappedLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("unableToSpawnMob")));
throw new MobException(); throw new MobException();
} }
return entity; return entity;

View File

@ -818,7 +818,7 @@ public class Settings implements net.ess3.api.ISettings {
final ItemStack iStack = itemDb.get(itemName); final ItemStack iStack = itemDb.get(itemName);
epItemSpwn.add(iStack.getType()); epItemSpwn.add(iStack.getType());
} catch (final Exception ex) { } catch (final Exception ex) {
ess.getLogger().log(Level.SEVERE, tlLiteral("unknownItemInList", itemName, "item-spawn-blacklist"), ex); ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("unknownItemInList", itemName, "item-spawn-blacklist")), ex);
} }
} }
return epItemSpwn; return epItemSpwn;
@ -846,7 +846,7 @@ public class Settings implements net.ess3.api.ISettings {
try { try {
newSigns.add(Signs.valueOf(signName).getSign()); newSigns.add(Signs.valueOf(signName).getSign());
} catch (final Exception ex) { } catch (final Exception ex) {
ess.getLogger().log(Level.SEVERE, tlLiteral("unknownItemInList", signName, "enabledSigns")); ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("unknownItemInList", signName, "enabledSigns")));
continue; continue;
} }
signsEnabled = true; signsEnabled = true;
@ -965,7 +965,7 @@ public class Settings implements net.ess3.api.ISettings {
} }
if (mat == null) { if (mat == null) {
ess.getLogger().log(Level.SEVERE, tlLiteral("unknownItemInList", itemName, configName)); ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("unknownItemInList", itemName, configName)));
} else { } else {
list.add(mat); list.add(mat);
} }
@ -1713,7 +1713,7 @@ public class Settings implements net.ess3.api.ISettings {
try { try {
newSigns.add(Signs.valueOf(signName).getSign()); newSigns.add(Signs.valueOf(signName).getSign());
} catch (final Exception ex) { } catch (final Exception ex) {
ess.getLogger().log(Level.SEVERE, tlLiteral("unknownItemInList", signName, "unprotected-sign-names")); ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("unknownItemInList", signName, "unprotected-sign-names")));
} }
} }
return newSigns; return newSigns;

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials;
import com.earth2me.essentials.commands.WarpNotFoundException; import com.earth2me.essentials.commands.WarpNotFoundException;
import com.earth2me.essentials.config.EssentialsConfiguration; import com.earth2me.essentials.config.EssentialsConfiguration;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import net.ess3.api.InvalidNameException; import net.ess3.api.InvalidNameException;
import net.ess3.api.InvalidWorldException; import net.ess3.api.InvalidWorldException;
@ -134,7 +135,7 @@ public class Warps implements IConf, net.ess3.api.IWarps {
warpPoints.put(new StringIgnoreCase(name), conf); warpPoints.put(new StringIgnoreCase(name), conf);
} }
} catch (final Exception ex) { } catch (final Exception ex) {
Essentials.getWrappedLogger().log(Level.WARNING, tlLiteral("loadWarpError", filename), ex); Essentials.getWrappedLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("loadWarpError", filename)), ex);
} }
} }
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.OfflinePlayerStub; import com.earth2me.essentials.OfflinePlayerStub;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import net.ess3.api.TranslatableException; import net.ess3.api.TranslatableException;
import org.bukkit.BanList; import org.bukkit.BanList;
@ -55,7 +56,7 @@ public class Commandban extends EssentialsCommand {
final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName); final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName);
user.getBase().kickPlayer(banDisplay); user.getBase().kickPlayer(banDisplay);
ess.getLogger().log(Level.INFO, tlLiteral("playerBanned", senderDisplayName, user.getName(), banDisplay)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("playerBanned", senderDisplayName, user.getName(), banDisplay)));
if (nomatch) { if (nomatch) {
sender.sendTl("userUnknown", user.getName()); sender.sendTl("userUnknown", user.getName());

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.BanList; import org.bukkit.BanList;
import org.bukkit.Server; import org.bukkit.Server;
@ -54,7 +55,7 @@ public class Commandbanip extends EssentialsCommand {
final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName); final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName);
ess.getServer().getBanList(BanList.Type.IP).addBan(ipAddress, banReason, null, senderName); ess.getServer().getBanList(BanList.Type.IP).addBan(ipAddress, banReason, null, senderName);
ess.getLogger().log(Level.INFO, tlLiteral("playerBanIpAddress", senderDisplayName, ipAddress, banReason)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("playerBanIpAddress", senderDisplayName, ipAddress, banReason)));
for (final Player player : ess.getServer().getOnlinePlayers()) { for (final Player player : ess.getServer().getOnlinePlayers()) {
if (player.getAddress().getAddress().getHostAddress().equalsIgnoreCase(ipAddress)) { if (player.getAddress().getAddress().getHostAddress().equalsIgnoreCase(ipAddress)) {

View File

@ -7,6 +7,7 @@ import com.earth2me.essentials.craftbukkit.Inventories;
import com.earth2me.essentials.economy.EconomyLayer; import com.earth2me.essentials.economy.EconomyLayer;
import com.earth2me.essentials.economy.EconomyLayers; import com.earth2me.essentials.economy.EconomyLayers;
import com.earth2me.essentials.userstorage.ModernUserMap; import com.earth2me.essentials.userstorage.ModernUserMap;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommandMapUtil; import com.earth2me.essentials.utils.CommandMapUtil;
import com.earth2me.essentials.utils.CommonPlaceholders; import com.earth2me.essentials.utils.CommonPlaceholders;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
@ -464,8 +465,8 @@ public class Commandessentials extends EssentialsCommand {
sender.sendTl("dumpUrl", dumpUrl); sender.sendTl("dumpUrl", dumpUrl);
sender.sendTl("dumpDeleteKey", result.getDeletionKey()); sender.sendTl("dumpDeleteKey", result.getDeletionKey());
if (sender.isPlayer()) { if (sender.isPlayer()) {
ess.getLogger().info(tlLiteral("dumpConsoleUrl", dumpUrl)); ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("dumpConsoleUrl", dumpUrl)));
ess.getLogger().info(tlLiteral("dumpDeleteKey", result.getDeletionKey())); ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("dumpDeleteKey", result.getDeletionKey())));
} }
} }
files.clear(); files.clear();

View File

@ -41,7 +41,7 @@ public class Commandhelpop extends EssentialsCommand {
final String message = FormatUtil.stripFormat(getFinalArg(args, 0)); final String message = FormatUtil.stripFormat(getFinalArg(args, 0));
final AdventureUtil.ParsedPlaceholder displayName = CommonPlaceholders.displayNameRecipient(from); final AdventureUtil.ParsedPlaceholder displayName = CommonPlaceholders.displayNameRecipient(from);
ess.getLogger().log(Level.INFO, tlLiteral("helpOp", displayName, message)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("helpOp", displayName, message)));
final List<IUser> recipients = new ArrayList<>(); final List<IUser> recipients = new ArrayList<>();
for (IUser user : ess.getOnlineUsers()) { for (IUser user : ess.getOnlineUsers()) {

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import net.ess3.api.TranslatableException; import net.ess3.api.TranslatableException;
import net.essentialsx.api.v2.events.UserKickEvent; import net.essentialsx.api.v2.events.UserKickEvent;
@ -54,7 +55,7 @@ public class Commandkick extends EssentialsCommand {
final String tlKey = "playerKicked"; final String tlKey = "playerKicked";
final Object[] objects = {senderDisplayName, target.getName(), kickReason}; final Object[] objects = {senderDisplayName, target.getName(), kickReason};
ess.getLogger().log(Level.INFO, tlLiteral(tlKey, objects)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral(tlKey, objects)));
ess.broadcastTl(null, "essentials.kick.notify", tlKey, objects); ess.broadcastTl(null, "essentials.kick.notify", tlKey, objects);
} }

View File

@ -3,9 +3,9 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.OfflinePlayerStub; import com.earth2me.essentials.OfflinePlayerStub;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommonPlaceholders; import com.earth2me.essentials.utils.CommonPlaceholders;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import net.ess3.api.IUser;
import net.ess3.api.TranslatableException; import net.ess3.api.TranslatableException;
import net.ess3.api.events.MuteStatusChangeEvent; import net.ess3.api.events.MuteStatusChangeEvent;
import org.bukkit.Server; import org.bukkit.Server;
@ -87,18 +87,18 @@ public class Commandmute extends EssentialsCommand {
if (muted) { if (muted) {
if (muteTimestamp > 0) { if (muteTimestamp > 0) {
if (!user.hasMuteReason()) { if (!user.hasMuteReason()) {
sender.sendTl("mutedPlayerFor", CommonPlaceholders.displayName((IUser) user), muteTime); sender.sendTl("mutedPlayerFor", CommonPlaceholders.displayName(user), muteTime);
user.sendTl("playerMutedFor", muteTime); user.sendTl("playerMutedFor", muteTime);
} else { } else {
sender.sendTl("mutedPlayerForReason", CommonPlaceholders.displayName((IUser) user), muteTime, user.getMuteReason()); sender.sendTl("mutedPlayerForReason", CommonPlaceholders.displayName(user), muteTime, user.getMuteReason());
user.sendTl("playerMutedForReason", muteTime, user.getMuteReason()); user.sendTl("playerMutedForReason", muteTime, user.getMuteReason());
} }
} else { } else {
if (!user.hasMuteReason()) { if (!user.hasMuteReason()) {
sender.sendTl("mutedPlayer", CommonPlaceholders.displayName((IUser) user)); sender.sendTl("mutedPlayer", CommonPlaceholders.displayName(user));
user.sendTl("playerMuted"); user.sendTl("playerMuted");
} else { } else {
sender.sendTl("mutedPlayerReason", CommonPlaceholders.displayName((IUser) user), user.getMuteReason()); sender.sendTl("mutedPlayerReason", CommonPlaceholders.displayName(user), user.getMuteReason());
user.sendTl("playerMutedReason", user.getMuteReason()); user.sendTl("playerMutedReason", user.getMuteReason());
} }
} }
@ -118,10 +118,10 @@ public class Commandmute extends EssentialsCommand {
objects = new Object[]{sender.getSender().getName(), user.getName(), muteTime}; objects = new Object[]{sender.getSender().getName(), user.getName(), muteTime};
} }
ess.getLogger().log(Level.INFO, tlLiteral(tlKey, objects)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral(tlKey, objects)));
ess.broadcastTl(null, "essentials.mute.notify", tlKey, objects); ess.broadcastTl(null, "essentials.mute.notify", tlKey, objects);
} else { } else {
sender.sendTl("unmutedPlayer", CommonPlaceholders.displayName((IUser) user)); sender.sendTl("unmutedPlayer", CommonPlaceholders.displayName(user));
user.sendTl("playerUnmuted"); user.sendTl("playerUnmuted");
} }
} }

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Trade; import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.craftbukkit.Inventories; import com.earth2me.essentials.craftbukkit.Inventories;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommonPlaceholders; import com.earth2me.essentials.utils.CommonPlaceholders;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@ -122,7 +123,7 @@ public class Commandsell extends EssentialsCommand {
final String typeName = is.getType().toString().toLowerCase(Locale.ENGLISH); final String typeName = is.getType().toString().toLowerCase(Locale.ENGLISH);
final String worthDisplay = NumberUtil.displayCurrency(worth, ess); final String worthDisplay = NumberUtil.displayCurrency(worth, ess);
user.sendTl("itemSold", NumberUtil.displayCurrency(result, ess), amount, typeName, worthDisplay); user.sendTl("itemSold", NumberUtil.displayCurrency(result, ess), amount, typeName, worthDisplay);
ess.getLogger().log(Level.INFO, tlLiteral("itemSoldConsole", user.getName(), typeName, NumberUtil.displayCurrency(result, ess), amount, worthDisplay, CommonPlaceholders.displayName(user))); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("itemSoldConsole", user.getName(), typeName, NumberUtil.displayCurrency(result, ess), amount, worthDisplay, CommonPlaceholders.displayName(user))));
return result; return result;
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.IUser; import com.earth2me.essentials.IUser;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import org.bukkit.BanList; import org.bukkit.BanList;
import org.bukkit.Server; import org.bukkit.Server;
@ -54,7 +55,7 @@ public class Commandtempban extends EssentialsCommand {
user.getBase().kickPlayer(user.playerTl("tempBanned", expiry, senderDisplayName, banReason)); user.getBase().kickPlayer(user.playerTl("tempBanned", expiry, senderDisplayName, banReason));
ess.getLogger().log(Level.INFO, tlLiteral("playerTempBanned", senderDisplayName, user.getName(), expiry, banReason)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("playerTempBanned", senderDisplayName, user.getName(), expiry, banReason)));
ess.broadcastTl((IUser) null, "essentials.ban.notify", "playerTempBanned", senderDisplayName, user.getName(), expiry, banReason); ess.broadcastTl((IUser) null, "essentials.ban.notify", "playerTempBanned", senderDisplayName, user.getName(), expiry, banReason);
} }

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.BanList; import org.bukkit.BanList;
@ -71,7 +72,7 @@ public class Commandtempbanip extends EssentialsCommand {
final String tlKey = "playerTempBanIpAddress"; final String tlKey = "playerTempBanIpAddress";
final Object[] objects = {senderDisplayName, ipAddress, banReason, DateUtil.formatDateDiff(banTimestamp), banReason}; final Object[] objects = {senderDisplayName, ipAddress, banReason, DateUtil.formatDateDiff(banTimestamp), banReason};
ess.getLogger().log(Level.INFO, tlLiteral(tlKey, objects)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral(tlKey, objects)));
ess.broadcastTl(null, "essentials.banip.notify", tlKey, objects); ess.broadcastTl(null, "essentials.banip.notify", tlKey, objects);
} }

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.ISettings; import com.earth2me.essentials.ISettings;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.EnumUtil; import com.earth2me.essentials.utils.EnumUtil;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
@ -97,7 +98,7 @@ public class Commandtogglejail extends EssentialsCommand {
sender.sendTl("playerJailed", player.getName()); sender.sendTl("playerJailed", player.getName());
} }
ess.getLogger().log(Level.INFO, tlLiteral(tlKey, objects)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral(tlKey, objects)));
ess.broadcastTl(null, "essentials.jail.notify", tlKey, objects); ess.broadcastTl(null, "essentials.jail.notify", tlKey, objects);
} }
}); });
@ -125,7 +126,7 @@ public class Commandtogglejail extends EssentialsCommand {
final String tlKey = "jailNotifySentenceExtended"; final String tlKey = "jailNotifySentenceExtended";
final Object[] objects = new Object[]{player.getName(), DateUtil.formatDateDiff(displayTimeDiff), sender.getSender().getName()}; final Object[] objects = new Object[]{player.getName(), DateUtil.formatDateDiff(displayTimeDiff), sender.getSender().getName()};
ess.getLogger().log(Level.INFO, tlLiteral(tlKey, objects)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral(tlKey, objects)));
ess.broadcastTl(null, "essentials.jail.notify", tlKey, objects); ess.broadcastTl(null, "essentials.jail.notify", tlKey, objects);
return; return;
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.IUser; import com.earth2me.essentials.IUser;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.TranslatableException; import net.ess3.api.TranslatableException;
import org.bukkit.BanList; import org.bukkit.BanList;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -39,7 +40,7 @@ public class Commandunban extends EssentialsCommand {
} }
final String senderDisplayName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.DISPLAY_NAME; final String senderDisplayName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.DISPLAY_NAME;
ess.getLogger().log(Level.INFO, tlLiteral("playerUnbanned", senderDisplayName, name)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("playerUnbanned", senderDisplayName, name)));
ess.broadcastTl((IUser) null, "essentials.ban.notify", "playerUnbanned", senderDisplayName, name); ess.broadcastTl((IUser) null, "essentials.ban.notify", "playerUnbanned", senderDisplayName, name);
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.IUser; import com.earth2me.essentials.IUser;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.BanList; import org.bukkit.BanList;
import org.bukkit.Server; import org.bukkit.Server;
@ -41,7 +42,7 @@ public class Commandunbanip extends EssentialsCommand {
ess.getServer().getBanList(BanList.Type.IP).pardon(ipAddress); ess.getServer().getBanList(BanList.Type.IP).pardon(ipAddress);
final String senderDisplayName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.DISPLAY_NAME; final String senderDisplayName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.DISPLAY_NAME;
ess.getLogger().log(Level.INFO, tlLiteral("playerUnbanIpAddress", senderDisplayName, ipAddress)); ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("playerUnbanIpAddress", senderDisplayName, ipAddress)));
ess.broadcastTl((IUser) null, "essentials.banip.notify", "playerUnbanIpAddress", senderDisplayName, ipAddress); ess.broadcastTl((IUser) null, "essentials.banip.notify", "playerUnbanIpAddress", senderDisplayName, ipAddress);
} }

View File

@ -12,6 +12,7 @@ import com.earth2me.essentials.config.serializers.CommandCooldownSerializer;
import com.earth2me.essentials.config.serializers.LocationTypeSerializer; import com.earth2me.essentials.config.serializers.LocationTypeSerializer;
import com.earth2me.essentials.config.serializers.MailMessageSerializer; import com.earth2me.essentials.config.serializers.MailMessageSerializer;
import com.earth2me.essentials.config.serializers.MaterialTypeSerializer; import com.earth2me.essentials.config.serializers.MaterialTypeSerializer;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.InvalidWorldException; import net.ess3.api.InvalidWorldException;
import net.essentialsx.api.v2.services.mail.MailMessage; import net.essentialsx.api.v2.services.mail.MailMessage;
import org.bukkit.Location; import org.bukkit.Location;
@ -367,7 +368,7 @@ public class EssentialsConfiguration {
if (configFile.getParentFile() != null && !configFile.getParentFile().exists()) { if (configFile.getParentFile() != null && !configFile.getParentFile().exists()) {
if (!configFile.getParentFile().mkdirs()) { if (!configFile.getParentFile().mkdirs()) {
Essentials.getWrappedLogger().log(Level.SEVERE, tlLiteral("failedToCreateConfig", configFile.toString())); Essentials.getWrappedLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("failedToCreateConfig", configFile.toString())));
return; return;
} }
} }
@ -379,10 +380,10 @@ public class EssentialsConfiguration {
convertAltFile(); convertAltFile();
} else if (templateName != null) { } else if (templateName != null) {
try (final InputStream is = resourceClass.getResourceAsStream(templateName)) { try (final InputStream is = resourceClass.getResourceAsStream(templateName)) {
Essentials.getWrappedLogger().log(Level.INFO, tlLiteral("creatingConfigFromTemplate", configFile.toString())); Essentials.getWrappedLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("creatingConfigFromTemplate", configFile.toString())));
Files.copy(is, configFile.toPath()); Files.copy(is, configFile.toPath());
} catch (IOException e) { } catch (IOException e) {
Essentials.getWrappedLogger().log(Level.SEVERE, tlLiteral("failedToWriteConfig", configFile.toString()), e); Essentials.getWrappedLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("failedToWriteConfig", configFile.toString())), e);
} }
} }
} }

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials.textreader; package com.earth2me.essentials.textreader;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
@ -117,7 +118,7 @@ public class HelpInput implements IText {
} catch (final NullPointerException ignored) { } catch (final NullPointerException ignored) {
} catch (final Exception ex) { } catch (final Exception ex) {
if (!reported) { if (!reported) {
ess.getLogger().log(Level.WARNING, user.playerTl("commandHelpFailedForPlugin", pluginNameLow), ex); ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(user.playerTl("commandHelpFailedForPlugin", pluginNameLow)), ex);
} }
reported = true; reported = true;
} }

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.antibuild;
import com.earth2me.essentials.IConf; import com.earth2me.essentials.IConf;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -17,7 +18,7 @@ class EssentialsConnect {
EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) { EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) {
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) { if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) {
essProtect.getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); essProtect.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
ess = (IEssentials) essPlugin; ess = (IEssentials) essPlugin;
protect = (IAntiBuild) essProtect; protect = (IAntiBuild) essProtect;
@ -32,7 +33,7 @@ class EssentialsConnect {
void alert(final User user, final String item, final String tlKey) { void alert(final User user, final String item, final String tlKey) {
final Location loc = user.getLocation(); final Location loc = user.getLocation();
protect.getLogger().log(Level.WARNING, tlLiteral("alertFormat", user.getName(), tlLiteral(tlKey), item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ())); protect.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("alertFormat", user.getName(), tlLiteral(tlKey), item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ())));
for (final Player p : ess.getServer().getOnlinePlayers()) { for (final Player p : ess.getServer().getOnlinePlayers()) {
final User alertUser = ess.getUser(p); final User alertUser = ess.getUser(p);
if (alertUser.isAuthorized("essentials.protect.alerts")) { if (alertUser.isAuthorized("essentials.protect.alerts")) {

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.EssentialsLogger; import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.chat.processing.ChatHandler; import com.earth2me.essentials.chat.processing.ChatHandler;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -24,7 +25,7 @@ public class EssentialsChat extends JavaPlugin {
final PluginManager pluginManager = getServer().getPluginManager(); final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials) pluginManager.getPlugin("Essentials"); ess = (IEssentials) pluginManager.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
if (!ess.isEnabled()) { if (!ess.isEnabled()) {
this.setEnabled(false); this.setEnabled(false);

View File

@ -3,6 +3,7 @@ package net.essentialsx.discord;
import com.earth2me.essentials.IConf; import com.earth2me.essentials.IConf;
import com.earth2me.essentials.config.ConfigurateUtil; import com.earth2me.essentials.config.ConfigurateUtil;
import com.earth2me.essentials.config.EssentialsConfiguration; import com.earth2me.essentials.config.EssentialsConfiguration;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import net.dv8tion.jda.api.OnlineStatus; import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.entities.Activity;
@ -457,7 +458,7 @@ public class DiscordSettings implements IConf {
@Override @Override
public void reloadConfig() { public void reloadConfig() {
if (plugin.isInvalidStartup()) { if (plugin.isInvalidStartup()) {
plugin.getLogger().warning(tlLiteral("discordReloadInvalid")); plugin.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordReloadInvalid")));
return; return;
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.IEssentialsModule; import com.earth2me.essentials.IEssentialsModule;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import net.essentialsx.discord.interactions.InteractionControllerImpl; import net.essentialsx.discord.interactions.InteractionControllerImpl;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -35,7 +36,7 @@ public class EssentialsDiscord extends JavaPlugin implements IEssentialsModule {
return; return;
} }
if (!getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
// JDK-8274349 - Mitigation for a regression in Java 17 on 1 core systems which was fixed in 17.0.2 // JDK-8274349 - Mitigation for a regression in Java 17 on 1 core systems which was fixed in 17.0.2
@ -62,7 +63,7 @@ public class EssentialsDiscord extends JavaPlugin implements IEssentialsModule {
jda.startup(); jda.startup();
ess.scheduleSyncDelayedTask(() -> ((InteractionControllerImpl) jda.getInteractionController()).processBatchRegistration()); ess.scheduleSyncDelayedTask(() -> ((InteractionControllerImpl) jda.getInteractionController()).processBatchRegistration());
} catch (Exception e) { } catch (Exception e) {
getLogger().log(Level.SEVERE, tlLiteral("discordErrorLogin", e.getMessage())); getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("discordErrorLogin", e.getMessage())));
if (ess.getSettings().isDebug()) { if (ess.getSettings().isDebug()) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -3,6 +3,7 @@ package net.essentialsx.discordlink;
import com.earth2me.essentials.EssentialsLogger; import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import net.essentialsx.api.v2.services.discord.DiscordService; import net.essentialsx.api.v2.services.discord.DiscordService;
import net.essentialsx.api.v2.services.discord.InteractionException; import net.essentialsx.api.v2.services.discord.InteractionException;
@ -44,7 +45,7 @@ public class EssentialsDiscordLink extends JavaPlugin {
return; return;
} }
if (!getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
api = getServer().getServicesManager().load(DiscordService.class); api = getServer().getServicesManager().load(DiscordService.class);

View File

@ -1,6 +1,7 @@
package net.essentialsx.discordlink.rolesync; package net.essentialsx.discordlink.rolesync;
import com.earth2me.essentials.UUIDPlayer; import com.earth2me.essentials.UUIDPlayer;
import com.earth2me.essentials.utils.AdventureUtil;
import com.google.common.collect.BiMap; import com.google.common.collect.BiMap;
import net.essentialsx.api.v2.events.discordlink.DiscordLinkStatusChangeEvent; import net.essentialsx.api.v2.events.discordlink.DiscordLinkStatusChangeEvent;
import net.essentialsx.api.v2.services.discord.InteractionMember; import net.essentialsx.api.v2.services.discord.InteractionMember;
@ -145,21 +146,21 @@ public class RoleSyncManager implements Listener {
final String group = entry.getKey(); final String group = entry.getKey();
final InteractionRole role = ess.getApi().getRole(entry.getValue()); final InteractionRole role = ess.getApi().getRole(entry.getValue());
if (!groups.contains(group)) { if (!groups.contains(group)) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidGroup", group, entry.getValue(), groups)); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidGroup", group, entry.getValue(), groups)));
continue; continue;
} }
if (role == null) { if (role == null) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidRole", entry.getValue(), group)); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRole", entry.getValue(), group)));
continue; continue;
} }
if (role.isManaged() || role.isPublicRole()) { if (role.isManaged() || role.isPublicRole()) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidRoleManaged", role.getName(), role.getId())); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRoleManaged", role.getName(), role.getId())));
continue; continue;
} }
if (!role.canInteract()) { if (!role.canInteract()) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidRoleInteract", role.getName(), role.getId())); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRoleInteract", role.getName(), role.getId())));
continue; continue;
} }
@ -174,11 +175,11 @@ public class RoleSyncManager implements Listener {
final InteractionRole role = ess.getApi().getRole(entry.getKey()); final InteractionRole role = ess.getApi().getRole(entry.getKey());
final String group = entry.getValue(); final String group = entry.getValue();
if (role == null) { if (role == null) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidRole", entry.getKey(), group)); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRole", entry.getKey(), group)));
continue; continue;
} }
if (!groups.contains(group)) { if (!groups.contains(group)) {
ess.getLogger().warning(tlLiteral("discordLinkInvalidGroup", group, entry.getKey(), groups)); ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidGroup", group, entry.getKey(), groups)));
continue; continue;
} }

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.geoip;
import com.earth2me.essentials.EssentialsLogger; import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -21,7 +22,7 @@ public class EssentialsGeoIP extends JavaPlugin {
final PluginManager pm = getServer().getPluginManager(); final PluginManager pm = getServer().getPluginManager();
final IEssentials ess = (IEssentials) pm.getPlugin("Essentials"); final IEssentials ess = (IEssentials) pm.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
if (!ess.isEnabled()) { if (!ess.isEnabled()) {
this.setEnabled(false); this.setEnabled(false);

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.geoip;
import com.earth2me.essentials.IConf; import com.earth2me.essentials.IConf;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.config.EssentialsConfiguration; import com.earth2me.essentials.config.EssentialsConfiguration;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommonPlaceholders; import com.earth2me.essentials.utils.CommonPlaceholders;
import com.ice.tar.TarEntry; import com.ice.tar.TarEntry;
import com.ice.tar.TarInputStream; import com.ice.tar.TarInputStream;
@ -68,7 +69,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
if (mmreader == null) { if (mmreader == null) {
essGeo.getLogger().log(Level.WARNING, tlLiteral("geoIpErrorOnJoin", u.getName())); essGeo.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("geoIpErrorOnJoin", u.getName())));
return; return;
} }
@ -108,10 +109,10 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
} }
// GeoIP2 API forced this when address not found in their DB. jar will not complied without this. // GeoIP2 API forced this when address not found in their DB. jar will not complied without this.
// TODO: Maybe, we can set a new custom msg about addr-not-found in messages.properties. // TODO: Maybe, we can set a new custom msg about addr-not-found in messages.properties.
essGeo.getLogger().log(Level.INFO, tlLiteral("cantReadGeoIpDB") + " " + ex.getLocalizedMessage()); essGeo.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("cantReadGeoIpDB")) + " " + ex.getLocalizedMessage());
} catch (final IOException | GeoIp2Exception ex) { } catch (final IOException | GeoIp2Exception ex) {
// GeoIP2 API forced this when address not found in their DB. jar will not complied without this. // GeoIP2 API forced this when address not found in their DB. jar will not complied without this.
essGeo.getLogger().log(Level.SEVERE, tlLiteral("cantReadGeoIpDB") + " " + ex.getLocalizedMessage()); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("cantReadGeoIpDB")) + " " + ex.getLocalizedMessage());
} }
if (config.getBoolean("show-on-whois", true)) { if (config.getBoolean("show-on-whois", true)) {
u.setGeoLocation(sb.toString()); u.setGeoLocation(sb.toString());
@ -155,7 +156,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
if (config.getBoolean("database.download-if-missing", true)) { if (config.getBoolean("database.download-if-missing", true)) {
downloadDatabase(); downloadDatabase();
} else { } else {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("cantFindGeoIpDB")); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("cantFindGeoIpDB")));
return; return;
} }
} else if (config.getBoolean("database.update.enable", true)) { } else if (config.getBoolean("database.update.enable", true)) {
@ -179,7 +180,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
mmreader = new DatabaseReader.Builder(databaseFile).build(); mmreader = new DatabaseReader.Builder(databaseFile).build();
} }
} catch (final IOException ex) { } catch (final IOException ex) {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("cantReadGeoIpDB"), ex); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("cantReadGeoIpDB")), ex);
} }
} }
@ -192,16 +193,16 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
url = config.getString("database.download-url", null); url = config.getString("database.download-url", null);
} }
if (url == null || url.isEmpty()) { if (url == null || url.isEmpty()) {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("geoIpUrlEmpty")); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("geoIpUrlEmpty")));
return; return;
} }
final String licenseKey = config.getString("database.license-key", ""); final String licenseKey = config.getString("database.license-key", "");
if (licenseKey == null || licenseKey.isEmpty()) { if (licenseKey == null || licenseKey.isEmpty()) {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("geoIpLicenseMissing")); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("geoIpLicenseMissing")));
return; return;
} }
url = url.replace("{LICENSEKEY}", licenseKey); url = url.replace("{LICENSEKEY}", licenseKey);
essGeo.getLogger().log(Level.INFO, tlLiteral("downloadingGeoIp")); essGeo.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("downloadingGeoIp")));
final URL downloadUrl = new URL(url); final URL downloadUrl = new URL(url);
final URLConnection conn = downloadUrl.openConnection(); final URLConnection conn = downloadUrl.openConnection();
conn.setConnectTimeout(10000); conn.setConnectTimeout(10000);
@ -235,9 +236,9 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
output.close(); output.close();
input.close(); input.close();
} catch (final MalformedURLException ex) { } catch (final MalformedURLException ex) {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("geoIpUrlInvalid"), ex); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("geoIpUrlInvalid")), ex);
} catch (final IOException ex) { } catch (final IOException ex) {
essGeo.getLogger().log(Level.SEVERE, tlLiteral("connectionFailed"), ex); essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("connectionFailed")), ex);
} }
} }

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials.protect; package com.earth2me.essentials.protect;
import com.earth2me.essentials.IConf; import com.earth2me.essentials.IConf;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@ -14,7 +15,7 @@ class EssentialsConnect {
EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) { EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) {
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) { if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) {
essProtect.getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); essProtect.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
ess = (IEssentials) essPlugin; ess = (IEssentials) essPlugin;
protect = (IProtect) essProtect; protect = (IProtect) essProtect;

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.spawn;
import com.earth2me.essentials.EssentialsLogger; import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -28,7 +29,7 @@ public class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn {
final PluginManager pluginManager = getServer().getPluginManager(); final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials) pluginManager.getPlugin("Essentials"); ess = (IEssentials) pluginManager.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
if (!ess.isEnabled()) { if (!ess.isEnabled()) {
this.setEnabled(false); this.setEnabled(false);

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.EssentialsLogger; import com.earth2me.essentials.EssentialsLogger;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.metrics.MetricsWrapper; import com.earth2me.essentials.metrics.MetricsWrapper;
import com.earth2me.essentials.utils.AdventureUtil;
import net.ess3.api.IUser; import net.ess3.api.IUser;
import org.bstats.charts.SimplePie; import org.bstats.charts.SimplePie;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -41,7 +42,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP {
final PluginManager pluginManager = getServer().getPluginManager(); final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials) pluginManager.getPlugin("Essentials"); ess = (IEssentials) pluginManager.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
getLogger().log(Level.WARNING, tlLiteral("versionMismatchAll")); getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("versionMismatchAll")));
} }
if (!ess.isEnabled()) { if (!ess.isEnabled()) {
this.setEnabled(false); this.setEnabled(false);

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.Console; import com.earth2me.essentials.Console;
import com.earth2me.essentials.IConf; import com.earth2me.essentials.IConf;
import com.earth2me.essentials.config.EssentialsConfiguration; import com.earth2me.essentials.config.EssentialsConfiguration;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import net.ess3.api.IUser; import net.ess3.api.IUser;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -158,7 +159,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
final void updatePresence() { final void updatePresence() {
if (connection == null) { if (connection == null) {
parent.getEss().getLogger().warning(tlLiteral("xmppNotConfigured")); parent.getEss().getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("xmppNotConfigured")));
return; return;
} }