final changes

This commit is contained in:
EternalHuman 2023-10-31 12:15:52 +03:00
parent 4994578ad1
commit e7c912fb77

@ -2,6 +2,9 @@ package lol.pyr.znpcsplus.entity.serializers;
import lol.pyr.znpcsplus.entity.PropertySerializer;
import lol.pyr.znpcsplus.util.GlowColor;
import net.kyori.adventure.text.format.NamedTextColor;
import java.util.Objects;
public class GlowColorPropertySerializer implements PropertySerializer<GlowColor> {
@Override
@ -11,7 +14,9 @@ public class GlowColorPropertySerializer implements PropertySerializer<GlowColor
@Override
public GlowColor deserialize(String property) {
return GlowColor.namedColor(Integer.parseInt(property));
NamedTextColor namedTextColor = NamedTextColor.namedColor(Integer.parseInt(property));
if (namedTextColor == null) return null;
return GlowColor.valueOf(namedTextColor.toString().toUpperCase());
}
@Override