Renamed StringUtils.translate to StringUtils.format
This commit is contained in:
@@ -286,7 +286,7 @@ public class EcoJSONConfigWrapper implements JSONConfig {
|
||||
public String getString(@NotNull final String path,
|
||||
final boolean format) {
|
||||
String string = Objects.requireNonNullElse(getOfKnownType(path, String.class), "");
|
||||
return format ? StringUtils.translate(string) : string;
|
||||
return format ? StringUtils.format(string) : string;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -322,7 +322,7 @@ public class EcoJSONConfigWrapper implements JSONConfig {
|
||||
final boolean format) {
|
||||
List<String> strings = (List<String>) Objects.requireNonNullElse(getOfKnownType(path, Object.class), new ArrayList<>());
|
||||
|
||||
return format ? StringUtils.translateList(strings) : strings;
|
||||
return format ? StringUtils.formatList(strings) : strings;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -202,7 +202,7 @@ public class EcoYamlConfigWrapper<T extends ConfigurationSection> implements Con
|
||||
if (cache.containsKey(path)) {
|
||||
return (String) cache.get(path);
|
||||
} else {
|
||||
cache.put(path, StringUtils.translate(Objects.requireNonNull(handle.getString(path, ""))));
|
||||
cache.put(path, StringUtils.format(Objects.requireNonNull(handle.getString(path, ""))));
|
||||
return getString(path);
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public class EcoYamlConfigWrapper<T extends ConfigurationSection> implements Con
|
||||
return (String) cache.get(path);
|
||||
} else {
|
||||
String string = Objects.requireNonNull(handle.getString(path, ""));
|
||||
cache.put(path, format ? StringUtils.translate(string) : string);
|
||||
cache.put(path, format ? StringUtils.format(string) : string);
|
||||
return getString(path);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class EcoYamlConfigWrapper<T extends ConfigurationSection> implements Con
|
||||
public List<String> getStrings(@NotNull final String path,
|
||||
final boolean format) {
|
||||
if (cache.containsKey(path)) {
|
||||
return format ? StringUtils.translateList((List<String>) cache.get(path)) : (List<String>) cache.get(path);
|
||||
return format ? StringUtils.formatList((List<String>) cache.get(path)) : (List<String>) cache.get(path);
|
||||
} else {
|
||||
cache.put(path, has(path) ? new ArrayList<>(handle.getStringList(path)) : new ArrayList<>());
|
||||
return getStrings(path);
|
||||
|
||||
@@ -4,10 +4,8 @@ import com.willfp.eco.core.gui.menu.Menu;
|
||||
import com.willfp.eco.core.gui.slot.FillerSlot;
|
||||
import com.willfp.eco.core.gui.slot.Slot;
|
||||
import com.willfp.eco.internal.gui.slot.EcoFillerSlot;
|
||||
import com.willfp.eco.internal.gui.slot.EcoSlot;
|
||||
import com.willfp.eco.util.StringUtils;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
@@ -90,7 +88,7 @@ public class EcoMenu implements Menu {
|
||||
if (meta != null) {
|
||||
List<String> lore = meta.getLore();
|
||||
if (lore != null) {
|
||||
lore.replaceAll(s -> StringUtils.translate(s, player));
|
||||
lore.replaceAll(s -> StringUtils.format(s, player));
|
||||
meta.setLore(lore);
|
||||
}
|
||||
slotItem.setItemMeta(meta);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class EcoMenuBuilder implements MenuBuilder {
|
||||
|
||||
@Override
|
||||
public MenuBuilder setTitle(@NotNull final String title) {
|
||||
this.title = StringUtils.translate(title);
|
||||
this.title = StringUtils.format(title);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,16 +17,16 @@ public class EcoLogger extends Logger {
|
||||
|
||||
@Override
|
||||
public void info(@NotNull final String msg) {
|
||||
super.info(StringUtils.translate(msg));
|
||||
super.info(StringUtils.format(msg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warning(@NotNull final String msg) {
|
||||
super.warning(StringUtils.translate(msg));
|
||||
super.warning(StringUtils.format(msg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void severe(@NotNull final String msg) {
|
||||
super.severe(StringUtils.translate(msg));
|
||||
super.severe(StringUtils.format(msg));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user