Updated to 6.3.2

This commit is contained in:
Auxilor
2021-08-10 16:18:49 +01:00
parent 82061ee6a3
commit 97eeea8d48
4 changed files with 12 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;
}
}