Removed bad localization system

This commit is contained in:
Auxilor
2021-07-16 18:40:52 +02:00
committed by Auxilor
parent d73c665d20
commit 255bb4b38e
8 changed files with 4 additions and 114 deletions

View File

@@ -13,7 +13,6 @@ import com.willfp.eco.core.integrations.placeholder.PlaceholderIntegration;
import com.willfp.eco.core.proxy.Cleaner;
import com.willfp.eco.core.proxy.ProxyFactory;
import com.willfp.eco.core.scheduling.Scheduler;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -135,14 +134,6 @@ public interface Handler {
*/
Cleaner getCleaner();
/**
* Get a localized string.
*
* @param key The key.
* @return The string.
*/
String getLocalizedString(@NotNull NamespacedKey key);
/**
* Add new plugin.
*

View File

@@ -5,7 +5,6 @@ import com.willfp.eco.core.PluginDependent;
import com.willfp.eco.core.command.CommandBase;
import com.willfp.eco.core.command.CommandHandler;
import com.willfp.eco.core.command.TabCompleteHandler;
import com.willfp.eco.util.StringUtils;
import lombok.AccessLevel;
import lombok.Getter;
import org.bukkit.command.CommandSender;
@@ -169,7 +168,7 @@ abstract class HandledCommand extends PluginDependent<EcoPlugin> implements Comm
@NotNull final CommandBase command,
@NotNull final EcoPlugin plugin) {
if (command.isPlayersOnly() && !(sender instanceof Player)) {
sender.sendMessage(StringUtils.getLocalizedString(plugin.getNamespacedKeyFactory().create("not-player")));
sender.sendMessage(plugin.getLangYml().getMessage("not-player"));
return false;
}

View File

@@ -1,8 +1,7 @@
package com.willfp.eco.core.recipe.parts;
import com.willfp.eco.core.Eco;
import com.willfp.eco.core.items.TestableItem;
import com.willfp.eco.util.NamespacedKeyUtils;
import com.willfp.eco.util.StringUtils;
import lombok.Getter;
import org.apache.commons.lang.Validate;
import org.bukkit.inventory.ItemStack;
@@ -59,7 +58,7 @@ public class TestableStack implements TestableItem {
List<String> lore = meta.hasLore() ? meta.getLore() : new ArrayList<>();
assert lore != null;
lore.add("");
String add = StringUtils.getLocalizedString(NamespacedKeyUtils.createEcoKey("multiple-in-craft"));
String add = Eco.getHandler().getEcoPlugin().getLangYml().getString("multiple-in-craft");
add = add.replace("%amount%", String.valueOf(amount));
lore.add(add);
meta.setLore(lore);

View File

@@ -1,16 +1,14 @@
package com.willfp.eco.util;
import com.google.common.collect.ImmutableList;
import com.willfp.eco.core.Eco;
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
import lombok.experimental.UtilityClass;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.Color;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -253,14 +251,4 @@ public class StringUtils {
}
return string;
}
/**
* Get a localized string.
*
* @param key The key.
* @return The string.
*/
public String getLocalizedString(@NotNull final NamespacedKey key) {
return Eco.getHandler().getLocalizedString(key);
}
}