Updated to 6.3.2
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user