mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 00:58:50 +01:00
Fix placeholders not parsing inside log messages (#5635)
This commit is contained in:
parent
746627c4b5
commit
23093b68d7
@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -79,7 +80,7 @@ public class Backup implements Runnable {
|
||||
taskLock.complete(new Object());
|
||||
return;
|
||||
}
|
||||
ess.getLogger().log(Level.INFO, tlLiteral("backupStarted"));
|
||||
ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("backupStarted")));
|
||||
final CommandSender cs = server.getConsoleSender();
|
||||
server.dispatchCommand(cs, "save-all");
|
||||
server.dispatchCommand(cs, "save-off");
|
||||
@ -118,7 +119,7 @@ public class Backup implements Runnable {
|
||||
}
|
||||
active = false;
|
||||
taskLock.complete(new Object());
|
||||
ess.getLogger().log(Level.INFO, tlLiteral("backupFinished"));
|
||||
ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("backupFinished")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
i18n.updateLocale("en");
|
||||
Console.setInstance(this);
|
||||
|
||||
LOGGER.log(Level.INFO, tlLiteral("usingTempFolderForTesting"));
|
||||
LOGGER.log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("usingTempFolderForTesting")));
|
||||
LOGGER.log(Level.INFO, dataFolder.toString());
|
||||
settings = new Settings(this);
|
||||
mail = new MailServiceImpl(this);
|
||||
@ -282,33 +282,33 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
|
||||
switch (VersionUtil.getServerSupportStatus()) {
|
||||
case NMS_CLEANROOM:
|
||||
getLogger().severe(tlLiteral("serverUnsupportedCleanroom"));
|
||||
getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedCleanroom")));
|
||||
break;
|
||||
case DANGEROUS_FORK:
|
||||
getLogger().severe(tlLiteral("serverUnsupportedDangerous"));
|
||||
getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedDangerous")));
|
||||
break;
|
||||
case STUPID_PLUGIN:
|
||||
getLogger().severe(tlLiteral("serverUnsupportedDumbPlugins"));
|
||||
getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedDumbPlugins")));
|
||||
break;
|
||||
case UNSTABLE:
|
||||
getLogger().severe(tlLiteral("serverUnsupportedMods"));
|
||||
getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedMods")));
|
||||
break;
|
||||
case OUTDATED:
|
||||
getLogger().severe(tlLiteral("serverUnsupported"));
|
||||
getLogger().severe(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupported")));
|
||||
break;
|
||||
case LIMITED:
|
||||
getLogger().info(tlLiteral("serverUnsupportedLimitedApi"));
|
||||
getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedLimitedApi")));
|
||||
break;
|
||||
}
|
||||
|
||||
if (VersionUtil.getSupportStatusClass() != null) {
|
||||
getLogger().info(tlLiteral("serverUnsupportedClass", VersionUtil.getSupportStatusClass()));
|
||||
getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("serverUnsupportedClass", VersionUtil.getSupportStatusClass())));
|
||||
}
|
||||
|
||||
final PluginManager pm = getServer().getPluginManager();
|
||||
for (final Plugin plugin : pm.getPlugins()) {
|
||||
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() {
|
||||
final boolean stopping = getServerStateProvider().isStopping();
|
||||
if (!stopping) {
|
||||
LOGGER.log(Level.SEVERE, tlLiteral("serverReloading"));
|
||||
LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("serverReloading")));
|
||||
}
|
||||
getBackup().setPendingShutdown(true);
|
||||
for (final User user : getOnlineUsers()) {
|
||||
@ -602,7 +602,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
}
|
||||
cleanupOpenInventories();
|
||||
if (getBackup().getTaskLock() != null && !getBackup().getTaskLock().isDone()) {
|
||||
LOGGER.log(Level.SEVERE, tlLiteral("backupInProgress"));
|
||||
LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("backupInProgress")));
|
||||
getBackup().getTaskLock().join();
|
||||
}
|
||||
if (i18n != null) {
|
||||
@ -709,7 +709,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
cmd = loadCommand(commandPath, command.getName(), module, classLoader);
|
||||
} catch (final Exception ex) {
|
||||
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();
|
||||
}
|
||||
|
||||
@ -732,11 +732,11 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
} catch (final Exception ex) {
|
||||
showError(sender, ex, commandLabel);
|
||||
// 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();
|
||||
}
|
||||
} 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();
|
||||
}
|
||||
}
|
||||
@ -820,13 +820,13 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
cmd = loadCommand(commandPath, command.getName(), module, classLoader);
|
||||
} catch (final Exception ex) {
|
||||
sender.sendTl("commandNotLoaded", commandLabel);
|
||||
LOGGER.log(Level.SEVERE, tlLiteral("commandNotLoaded", commandLabel), ex);
|
||||
LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandNotLoaded", commandLabel)), ex);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check authorization
|
||||
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");
|
||||
return true;
|
||||
}
|
||||
@ -877,7 +877,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
return true;
|
||||
}
|
||||
} catch (final Throwable ex) {
|
||||
LOGGER.log(Level.SEVERE, tlLiteral("commandFailed", commandLabel), ex);
|
||||
LOGGER.log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("commandFailed", commandLabel)), ex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -909,7 +909,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
sender.sendTl("errorWithMessage", exception.getMessage());
|
||||
}
|
||||
if (getSettings().isDebug()) {
|
||||
LOGGER.log(Level.INFO, tlLiteral("errorCallingCommand", commandLabel), exception);
|
||||
LOGGER.log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("errorCallingCommand", commandLabel)), exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.TextInput;
|
||||
import com.earth2me.essentials.textreader.TextPager;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.CommonPlaceholders;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
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 {
|
||||
final Iterator<Player> it = event.getRecipients().iterator();
|
||||
@ -669,7 +670,7 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ public class EssentialsUpgrade {
|
||||
doneFile.setProperty("move" + name + "ToFile", true);
|
||||
doneFile.save();
|
||||
} 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 newFile = new File(listOfFile.getParentFile(), sanitizedFilename);
|
||||
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;
|
||||
}
|
||||
if (newFile.exists()) {
|
||||
ess.getLogger().log(Level.WARNING, tlLiteral("duplicatedUserdata", filename, sanitizedFilename));
|
||||
ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("duplicatedUserdata", filename, sanitizedFilename)));
|
||||
continue;
|
||||
}
|
||||
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);
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials;
|
||||
import com.earth2me.essentials.config.ConfigurateUtil;
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.config.entities.LazyLocation;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.api.TranslatableException;
|
||||
@ -294,9 +295,9 @@ public class Jails implements net.ess3.api.IJails {
|
||||
event.setRespawnLocation(getJail(user.getJail()));
|
||||
} catch (final Exception ex) {
|
||||
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 {
|
||||
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()));
|
||||
} catch (final Exception ex) {
|
||||
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 {
|
||||
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");
|
||||
@ -340,9 +341,9 @@ public class Jails implements net.ess3.api.IJails {
|
||||
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||
future.exceptionally(ex -> {
|
||||
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 {
|
||||
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;
|
||||
});
|
||||
|
@ -6,6 +6,7 @@ import com.earth2me.essentials.craftbukkit.Inventories;
|
||||
import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.SimpleTextInput;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
@ -193,7 +194,7 @@ public class Kit {
|
||||
|
||||
if (kitItem.startsWith("@")) {
|
||||
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;
|
||||
}
|
||||
stack = ess.getSerializationProvider().deserializeItem(Base64Coder.decodeLines(kitItem.substring(1)));
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
@ -45,7 +46,7 @@ public class ManagedFile {
|
||||
try {
|
||||
copyResourceAscii("/" + filename, file);
|
||||
} catch (final IOException ex) {
|
||||
Essentials.getWrappedLogger().log(Level.SEVERE, tlLiteral("itemsCsvNotLoaded", filename), ex);
|
||||
Essentials.getWrappedLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("itemsCsvNotLoaded", filename)), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import org.bukkit.Location;
|
||||
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 {
|
||||
final Entity entity = world.spawn(loc, this.bukkitType.getEntityClass());
|
||||
if (entity == null) {
|
||||
Essentials.getWrappedLogger().log(Level.WARNING, tlLiteral("unableToSpawnMob"));
|
||||
Essentials.getWrappedLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("unableToSpawnMob")));
|
||||
throw new MobException();
|
||||
}
|
||||
return entity;
|
||||
|
@ -818,7 +818,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
final ItemStack iStack = itemDb.get(itemName);
|
||||
epItemSpwn.add(iStack.getType());
|
||||
} 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;
|
||||
@ -846,7 +846,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
try {
|
||||
newSigns.add(Signs.valueOf(signName).getSign());
|
||||
} 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;
|
||||
}
|
||||
signsEnabled = true;
|
||||
@ -965,7 +965,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
}
|
||||
|
||||
if (mat == null) {
|
||||
ess.getLogger().log(Level.SEVERE, tlLiteral("unknownItemInList", itemName, configName));
|
||||
ess.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("unknownItemInList", itemName, configName)));
|
||||
} else {
|
||||
list.add(mat);
|
||||
}
|
||||
@ -1713,7 +1713,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
try {
|
||||
newSigns.add(Signs.valueOf(signName).getSign());
|
||||
} 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;
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.commands.WarpNotFoundException;
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import net.ess3.api.InvalidNameException;
|
||||
import net.ess3.api.InvalidWorldException;
|
||||
@ -134,7 +135,7 @@ public class Warps implements IConf, net.ess3.api.IWarps {
|
||||
warpPoints.put(new StringIgnoreCase(name), conf);
|
||||
}
|
||||
} catch (final Exception ex) {
|
||||
Essentials.getWrappedLogger().log(Level.WARNING, tlLiteral("loadWarpError", filename), ex);
|
||||
Essentials.getWrappedLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("loadWarpError", filename)), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.OfflinePlayerStub;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.ess3.api.TranslatableException;
|
||||
import org.bukkit.BanList;
|
||||
@ -55,7 +56,7 @@ public class Commandban extends EssentialsCommand {
|
||||
final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName);
|
||||
|
||||
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) {
|
||||
sender.sendTl("userUnknown", user.getName());
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Server;
|
||||
@ -54,7 +55,7 @@ public class Commandbanip extends EssentialsCommand {
|
||||
final String banDisplay = tlLiteral("banFormat", banReason, senderDisplayName);
|
||||
|
||||
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()) {
|
||||
if (player.getAddress().getAddress().getHostAddress().equalsIgnoreCase(ipAddress)) {
|
||||
|
@ -7,6 +7,7 @@ import com.earth2me.essentials.craftbukkit.Inventories;
|
||||
import com.earth2me.essentials.economy.EconomyLayer;
|
||||
import com.earth2me.essentials.economy.EconomyLayers;
|
||||
import com.earth2me.essentials.userstorage.ModernUserMap;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.CommandMapUtil;
|
||||
import com.earth2me.essentials.utils.CommonPlaceholders;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
@ -464,8 +465,8 @@ public class Commandessentials extends EssentialsCommand {
|
||||
sender.sendTl("dumpUrl", dumpUrl);
|
||||
sender.sendTl("dumpDeleteKey", result.getDeletionKey());
|
||||
if (sender.isPlayer()) {
|
||||
ess.getLogger().info(tlLiteral("dumpConsoleUrl", dumpUrl));
|
||||
ess.getLogger().info(tlLiteral("dumpDeleteKey", result.getDeletionKey()));
|
||||
ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("dumpConsoleUrl", dumpUrl)));
|
||||
ess.getLogger().info(AdventureUtil.miniToLegacy(tlLiteral("dumpDeleteKey", result.getDeletionKey())));
|
||||
}
|
||||
}
|
||||
files.clear();
|
||||
|
@ -41,7 +41,7 @@ public class Commandhelpop extends EssentialsCommand {
|
||||
|
||||
final String message = FormatUtil.stripFormat(getFinalArg(args, 0));
|
||||
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<>();
|
||||
for (IUser user : ess.getOnlineUsers()) {
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.ess3.api.TranslatableException;
|
||||
import net.essentialsx.api.v2.events.UserKickEvent;
|
||||
@ -54,7 +55,7 @@ public class Commandkick extends EssentialsCommand {
|
||||
|
||||
final String tlKey = "playerKicked";
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,9 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.OfflinePlayerStub;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.CommonPlaceholders;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.api.TranslatableException;
|
||||
import net.ess3.api.events.MuteStatusChangeEvent;
|
||||
import org.bukkit.Server;
|
||||
@ -87,18 +87,18 @@ public class Commandmute extends EssentialsCommand {
|
||||
if (muted) {
|
||||
if (muteTimestamp > 0) {
|
||||
if (!user.hasMuteReason()) {
|
||||
sender.sendTl("mutedPlayerFor", CommonPlaceholders.displayName((IUser) user), muteTime);
|
||||
sender.sendTl("mutedPlayerFor", CommonPlaceholders.displayName(user), muteTime);
|
||||
user.sendTl("playerMutedFor", muteTime);
|
||||
} 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());
|
||||
}
|
||||
} else {
|
||||
if (!user.hasMuteReason()) {
|
||||
sender.sendTl("mutedPlayer", CommonPlaceholders.displayName((IUser) user));
|
||||
sender.sendTl("mutedPlayer", CommonPlaceholders.displayName(user));
|
||||
user.sendTl("playerMuted");
|
||||
} else {
|
||||
sender.sendTl("mutedPlayerReason", CommonPlaceholders.displayName((IUser) user), user.getMuteReason());
|
||||
sender.sendTl("mutedPlayerReason", CommonPlaceholders.displayName(user), 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};
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
sender.sendTl("unmutedPlayer", CommonPlaceholders.displayName((IUser) user));
|
||||
sender.sendTl("unmutedPlayer", CommonPlaceholders.displayName(user));
|
||||
user.sendTl("playerUnmuted");
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.craftbukkit.Inventories;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.CommonPlaceholders;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
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 worthDisplay = NumberUtil.displayCurrency(worth, ess);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.IUser;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Server;
|
||||
@ -54,7 +55,7 @@ public class Commandtempban extends EssentialsCommand {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import org.bukkit.BanList;
|
||||
@ -71,7 +72,7 @@ public class Commandtempbanip extends EssentialsCommand {
|
||||
|
||||
final String tlKey = "playerTempBanIpAddress";
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.ISettings;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.google.common.collect.Iterables;
|
||||
@ -97,7 +98,7 @@ public class Commandtogglejail extends EssentialsCommand {
|
||||
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);
|
||||
}
|
||||
});
|
||||
@ -125,7 +126,7 @@ public class Commandtogglejail extends EssentialsCommand {
|
||||
|
||||
final String tlKey = "jailNotifySentenceExtended";
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.IUser;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.TranslatableException;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@ -39,7 +40,7 @@ public class Commandunban extends EssentialsCommand {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.IUser;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Server;
|
||||
@ -41,7 +42,7 @@ public class Commandunbanip extends EssentialsCommand {
|
||||
|
||||
ess.getServer().getBanList(BanList.Type.IP).pardon(ipAddress);
|
||||
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);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import com.earth2me.essentials.config.serializers.CommandCooldownSerializer;
|
||||
import com.earth2me.essentials.config.serializers.LocationTypeSerializer;
|
||||
import com.earth2me.essentials.config.serializers.MailMessageSerializer;
|
||||
import com.earth2me.essentials.config.serializers.MaterialTypeSerializer;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.InvalidWorldException;
|
||||
import net.essentialsx.api.v2.services.mail.MailMessage;
|
||||
import org.bukkit.Location;
|
||||
@ -367,7 +368,7 @@ public class EssentialsConfiguration {
|
||||
|
||||
if (configFile.getParentFile() != null && !configFile.getParentFile().exists()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -379,10 +380,10 @@ public class EssentialsConfiguration {
|
||||
convertAltFile();
|
||||
} else if (templateName != null) {
|
||||
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());
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.textreader;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.ess3.api.IEssentials;
|
||||
@ -117,7 +118,7 @@ public class HelpInput implements IText {
|
||||
} catch (final NullPointerException ignored) {
|
||||
} catch (final Exception ex) {
|
||||
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;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.antibuild;
|
||||
|
||||
import com.earth2me.essentials.IConf;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -17,7 +18,7 @@ class EssentialsConnect {
|
||||
|
||||
EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) {
|
||||
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;
|
||||
protect = (IAntiBuild) essProtect;
|
||||
@ -32,7 +33,7 @@ class EssentialsConnect {
|
||||
|
||||
void alert(final User user, final String item, final String tlKey) {
|
||||
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()) {
|
||||
final User alertUser = ess.getUser(p);
|
||||
if (alertUser.isAuthorized("essentials.protect.alerts")) {
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.chat.processing.ChatHandler;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -24,7 +25,7 @@ public class EssentialsChat extends JavaPlugin {
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
ess = (IEssentials) pluginManager.getPlugin("Essentials");
|
||||
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()) {
|
||||
this.setEnabled(false);
|
||||
|
@ -3,6 +3,7 @@ package net.essentialsx.discord;
|
||||
import com.earth2me.essentials.IConf;
|
||||
import com.earth2me.essentials.config.ConfigurateUtil;
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
@ -457,7 +458,7 @@ public class DiscordSettings implements IConf {
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
if (plugin.isInvalidStartup()) {
|
||||
plugin.getLogger().warning(tlLiteral("discordReloadInvalid"));
|
||||
plugin.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordReloadInvalid")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.IEssentialsModule;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.essentialsx.discord.interactions.InteractionControllerImpl;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -35,7 +36,7 @@ public class EssentialsDiscord extends JavaPlugin implements IEssentialsModule {
|
||||
return;
|
||||
}
|
||||
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
|
||||
@ -62,7 +63,7 @@ public class EssentialsDiscord extends JavaPlugin implements IEssentialsModule {
|
||||
jda.startup();
|
||||
ess.scheduleSyncDelayedTask(() -> ((InteractionControllerImpl) jda.getInteractionController()).processBatchRegistration());
|
||||
} 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()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package net.essentialsx.discordlink;
|
||||
import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.essentialsx.api.v2.services.discord.DiscordService;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionException;
|
||||
@ -44,7 +45,7 @@ public class EssentialsDiscordLink extends JavaPlugin {
|
||||
return;
|
||||
}
|
||||
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);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.essentialsx.discordlink.rolesync;
|
||||
|
||||
import com.earth2me.essentials.UUIDPlayer;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.google.common.collect.BiMap;
|
||||
import net.essentialsx.api.v2.events.discordlink.DiscordLinkStatusChangeEvent;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionMember;
|
||||
@ -145,21 +146,21 @@ public class RoleSyncManager implements Listener {
|
||||
final String group = entry.getKey();
|
||||
final InteractionRole role = ess.getApi().getRole(entry.getValue());
|
||||
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;
|
||||
}
|
||||
if (role == null) {
|
||||
ess.getLogger().warning(tlLiteral("discordLinkInvalidRole", entry.getValue(), group));
|
||||
ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRole", entry.getValue(), group)));
|
||||
continue;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (!role.canInteract()) {
|
||||
ess.getLogger().warning(tlLiteral("discordLinkInvalidRoleInteract", role.getName(), role.getId()));
|
||||
ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRoleInteract", role.getName(), role.getId())));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -174,11 +175,11 @@ public class RoleSyncManager implements Listener {
|
||||
final InteractionRole role = ess.getApi().getRole(entry.getKey());
|
||||
final String group = entry.getValue();
|
||||
if (role == null) {
|
||||
ess.getLogger().warning(tlLiteral("discordLinkInvalidRole", entry.getKey(), group));
|
||||
ess.getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("discordLinkInvalidRole", entry.getKey(), group)));
|
||||
continue;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.geoip;
|
||||
|
||||
import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -21,7 +22,7 @@ public class EssentialsGeoIP extends JavaPlugin {
|
||||
final PluginManager pm = getServer().getPluginManager();
|
||||
final IEssentials ess = (IEssentials) pm.getPlugin("Essentials");
|
||||
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()) {
|
||||
this.setEnabled(false);
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.geoip;
|
||||
import com.earth2me.essentials.IConf;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.CommonPlaceholders;
|
||||
import com.ice.tar.TarEntry;
|
||||
import com.ice.tar.TarInputStream;
|
||||
@ -68,7 +69,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (mmreader == null) {
|
||||
essGeo.getLogger().log(Level.WARNING, tlLiteral("geoIpErrorOnJoin", u.getName()));
|
||||
essGeo.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("geoIpErrorOnJoin", u.getName())));
|
||||
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.
|
||||
// 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) {
|
||||
// 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)) {
|
||||
u.setGeoLocation(sb.toString());
|
||||
@ -155,7 +156,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||
if (config.getBoolean("database.download-if-missing", true)) {
|
||||
downloadDatabase();
|
||||
} else {
|
||||
essGeo.getLogger().log(Level.SEVERE, tlLiteral("cantFindGeoIpDB"));
|
||||
essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("cantFindGeoIpDB")));
|
||||
return;
|
||||
}
|
||||
} else if (config.getBoolean("database.update.enable", true)) {
|
||||
@ -179,7 +180,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||
mmreader = new DatabaseReader.Builder(databaseFile).build();
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
if (url == null || url.isEmpty()) {
|
||||
essGeo.getLogger().log(Level.SEVERE, tlLiteral("geoIpUrlEmpty"));
|
||||
essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("geoIpUrlEmpty")));
|
||||
return;
|
||||
}
|
||||
final String licenseKey = config.getString("database.license-key", "");
|
||||
if (licenseKey == null || licenseKey.isEmpty()) {
|
||||
essGeo.getLogger().log(Level.SEVERE, tlLiteral("geoIpLicenseMissing"));
|
||||
essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("geoIpLicenseMissing")));
|
||||
return;
|
||||
}
|
||||
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 URLConnection conn = downloadUrl.openConnection();
|
||||
conn.setConnectTimeout(10000);
|
||||
@ -235,9 +236,9 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf {
|
||||
output.close();
|
||||
input.close();
|
||||
} 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) {
|
||||
essGeo.getLogger().log(Level.SEVERE, tlLiteral("connectionFailed"), ex);
|
||||
essGeo.getLogger().log(Level.SEVERE, AdventureUtil.miniToLegacy(tlLiteral("connectionFailed")), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.protect;
|
||||
|
||||
import com.earth2me.essentials.IConf;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -14,7 +15,7 @@ class EssentialsConnect {
|
||||
|
||||
EssentialsConnect(final Plugin essPlugin, final Plugin essProtect) {
|
||||
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;
|
||||
protect = (IProtect) essProtect;
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.spawn;
|
||||
|
||||
import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
@ -28,7 +29,7 @@ public class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn {
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
ess = (IEssentials) pluginManager.getPlugin("Essentials");
|
||||
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()) {
|
||||
this.setEnabled(false);
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp;
|
||||
import com.earth2me.essentials.EssentialsLogger;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.metrics.MetricsWrapper;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import net.ess3.api.IUser;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.command.Command;
|
||||
@ -41,7 +42,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP {
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
ess = (IEssentials) pluginManager.getPlugin("Essentials");
|
||||
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()) {
|
||||
this.setEnabled(false);
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp;
|
||||
import com.earth2me.essentials.Console;
|
||||
import com.earth2me.essentials.IConf;
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.ess3.api.IUser;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -158,7 +159,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
|
||||
|
||||
final void updatePresence() {
|
||||
if (connection == null) {
|
||||
parent.getEss().getLogger().warning(tlLiteral("xmppNotConfigured"));
|
||||
parent.getEss().getLogger().warning(AdventureUtil.miniToLegacy(tlLiteral("xmppNotConfigured")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user