Fix invalid unlimited items preventing userdata to load

Invalid material names would previously return a null value
when deserializing. This raises an exception from within
Configurate because they use an EnumSet internally during
deserialization which doesn't support null elements.
This commit is contained in:
Josh Roy 2023-07-22 16:46:15 -04:00 committed by MD
parent f84a311c2b
commit f26e1b2e29
1 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,9 @@ public class MaterialTypeSerializer extends ScalarSerializer<Material> {
if (obj instanceof String) {
return Material.matchMaterial((String) obj);
}
return null;
// Configurate will use an EnumSet to deserialize, which doesn't support null types. Default to air.
return Material.AIR;
}
@Override