diff --git a/eco-api/src/main/java/com/willfp/eco/core/fast/FastItemStack.java b/eco-api/src/main/java/com/willfp/eco/core/fast/FastItemStack.java index 1fd763fc..5883b07b 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/fast/FastItemStack.java +++ b/eco-api/src/main/java/com/willfp/eco/core/fast/FastItemStack.java @@ -52,7 +52,6 @@ public interface FastItemStack { * Set the rework penalty. * * @param cost The rework penalty to set. - * @return The item, with the rework penalty applied. */ void setRepairCost(int cost); diff --git a/eco-api/src/main/java/com/willfp/eco/util/StringUtils.java b/eco-api/src/main/java/com/willfp/eco/util/StringUtils.java index 8735480f..0981b656 100644 --- a/eco-api/src/main/java/com/willfp/eco/util/StringUtils.java +++ b/eco-api/src/main/java/com/willfp/eco/util/StringUtils.java @@ -8,6 +8,7 @@ import net.kyori.adventure.text.format.TextDecoration; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.md_5.bungee.api.ChatColor; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -244,11 +245,14 @@ public class StringUtils { * @return The JSON String. */ public String legacyToJson(@NotNull final String legacy) { - return GsonComponentSerializer.gson().serialize( + String json = GsonComponentSerializer.gson().serialize( Component.empty().decoration(TextDecoration.ITALIC, false).append( LegacyComponentSerializer.legacySection().deserialize(legacy) ) ); + + Bukkit.getLogger().info(legacy + " -> " + json); + return json; } /** @@ -258,8 +262,11 @@ public class StringUtils { * @return The legacy string. */ public String jsonToLegacy(@NotNull final String json) { - return LegacyComponentSerializer.legacySection().serialize( + String legacy = LegacyComponentSerializer.legacySection().serialize( GsonComponentSerializer.gson().deserialize(json) ); + + Bukkit.getLogger().info(json + " -> " + legacy); + return legacy; } } diff --git a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/config/yaml/EcoYamlConfigWrapper.kt b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/config/yaml/EcoYamlConfigWrapper.kt index 6fab9e5a..d1fea3e7 100644 --- a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/config/yaml/EcoYamlConfigWrapper.kt +++ b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/config/yaml/EcoYamlConfigWrapper.kt @@ -207,7 +207,8 @@ open class EcoYamlConfigWrapper : Config { return if (cache.containsKey("$path\$FMT")) { cache["$path\$FMT"] as List } else { - cache["$path\$FMT"] = StringUtils.formatList(if (has(path)) ArrayList(handle.getStringList(path)) else ArrayList()) + val list = if (has(path)) handle.getStringList(path) else ArrayList() + cache["$path\$FMT"] = StringUtils.formatList(list); getStrings(path, true) } } else { diff --git a/gradle.properties b/gradle.properties index 755ea4b5..a815b760 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 6.3.1 +version = 6.3.2 plugin-name = eco \ No newline at end of file