|
@@ -166,7 +166,11 @@ public class Entry<T> implements DataPart, Identifiable, Translatable, TooltipSu
|
|
@Override
|
|
@Override
|
|
public void apply(CommentedConfigurationNode node) {
|
|
public void apply(CommentedConfigurationNode node) {
|
|
try {
|
|
try {
|
|
- setValue((T) node.get(getType()));
|
|
|
|
|
|
+ T value = (T) node.get(getType());
|
|
|
|
+ if (value == null) {
|
|
|
|
+ throw new SerializationException(node, getType(), "Unable to deserialize value of this type");
|
|
|
|
+ }
|
|
|
|
+ setValue(value);
|
|
} catch (SerializationException e) {
|
|
} catch (SerializationException e) {
|
|
logger.error("Failed to apply value to entry", e);
|
|
logger.error("Failed to apply value to entry", e);
|
|
}
|
|
}
|
|
@@ -184,6 +188,11 @@ public class Entry<T> implements DataPart, Identifiable, Translatable, TooltipSu
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public String toString() {
|
|
|
|
+ return origin.getField().toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
@FunctionalInterface
|
|
@FunctionalInterface
|
|
private interface Setter<T> {
|
|
private interface Setter<T> {
|
|
|
|
|