diff --git a/src/main/java/com/terraforged/mod/chunk/settings/SettingsHelper.java b/src/main/java/com/terraforged/mod/chunk/settings/SettingsHelper.java index cb5477d..0e98163 100644 --- a/src/main/java/com/terraforged/mod/chunk/settings/SettingsHelper.java +++ b/src/main/java/com/terraforged/mod/chunk/settings/SettingsHelper.java @@ -43,12 +43,8 @@ public class SettingsHelper { public static CompoundNBT applyDefaults(CompoundNBT options, TerraSettings dest) { if (options.isEmpty()) { - try (Reader reader = new BufferedReader(new FileReader(DEFAULTS_FILE))) { - JsonElement json = new JsonParser().parse(reader); - options = NBTHelper.fromJson(json); - } catch (IOException ignored) { - - } + TerraSettings defaults = readDefaults(); + options = NBTHelper.serialize(defaults); } NBTHelper.deserialize(options, dest); return options; diff --git a/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java b/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java index 251ecd6..bd6d9c2 100644 --- a/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java +++ b/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java @@ -34,6 +34,7 @@ import com.terraforged.mod.client.gui.page.SimplePage; import com.terraforged.mod.client.gui.page.SimplePreviewPage; import com.terraforged.mod.client.gui.page.WorldPage; import com.terraforged.mod.client.gui.preview.PreviewPage; +import com.terraforged.mod.util.nbt.NBTHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.IGuiEventListener; import net.minecraft.client.gui.screen.CreateWorldScreen; @@ -111,7 +112,7 @@ public class SettingsScreen extends OverlayScreen { for (Page page : pages) { page.save(); } -// parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(settings); + parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(instance.settings); SettingsScreen.setSeed(parent, preview.getSeed()); onClose(); }));