diff --git a/src/dev/w1zzrd/spigot/wizcompat/serialization/PersistentData.java b/src/dev/w1zzrd/spigot/wizcompat/serialization/PersistentData.java index 5d9047f..0197305 100644 --- a/src/dev/w1zzrd/spigot/wizcompat/serialization/PersistentData.java +++ b/src/dev/w1zzrd/spigot/wizcompat/serialization/PersistentData.java @@ -43,8 +43,14 @@ public class PersistentData { * @return Data at the given path, if available, else the default value */ public T loadData(final String path, final DefaultGetter defaultValue) { - final T value = (T) config.get(path); - return value == null ? defaultValue.get() : value; + T value = (T) config.get(path); + + if (value == null) { + value = defaultValue.get(); + config.set(path, value); + } + + return value; } /**