final changes
This commit is contained in:
parent
4994578ad1
commit
e7c912fb77
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue