actually save the generator settings to the worldinfo
This commit is contained in:
parent
4190d40a2b
commit
54b7ad7e85
@ -43,12 +43,8 @@ public class SettingsHelper {
|
|||||||
|
|
||||||
public static CompoundNBT applyDefaults(CompoundNBT options, TerraSettings dest) {
|
public static CompoundNBT applyDefaults(CompoundNBT options, TerraSettings dest) {
|
||||||
if (options.isEmpty()) {
|
if (options.isEmpty()) {
|
||||||
try (Reader reader = new BufferedReader(new FileReader(DEFAULTS_FILE))) {
|
TerraSettings defaults = readDefaults();
|
||||||
JsonElement json = new JsonParser().parse(reader);
|
options = NBTHelper.serialize(defaults);
|
||||||
options = NBTHelper.fromJson(json);
|
|
||||||
} catch (IOException ignored) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
NBTHelper.deserialize(options, dest);
|
NBTHelper.deserialize(options, dest);
|
||||||
return options;
|
return options;
|
||||||
|
@ -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.SimplePreviewPage;
|
||||||
import com.terraforged.mod.client.gui.page.WorldPage;
|
import com.terraforged.mod.client.gui.page.WorldPage;
|
||||||
import com.terraforged.mod.client.gui.preview.PreviewPage;
|
import com.terraforged.mod.client.gui.preview.PreviewPage;
|
||||||
|
import com.terraforged.mod.util.nbt.NBTHelper;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.IGuiEventListener;
|
import net.minecraft.client.gui.IGuiEventListener;
|
||||||
import net.minecraft.client.gui.screen.CreateWorldScreen;
|
import net.minecraft.client.gui.screen.CreateWorldScreen;
|
||||||
@ -111,7 +112,7 @@ public class SettingsScreen extends OverlayScreen {
|
|||||||
for (Page page : pages) {
|
for (Page page : pages) {
|
||||||
page.save();
|
page.save();
|
||||||
}
|
}
|
||||||
// parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(settings);
|
parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(instance.settings);
|
||||||
SettingsScreen.setSeed(parent, preview.getSeed());
|
SettingsScreen.setSeed(parent, preview.getSeed());
|
||||||
onClose();
|
onClose();
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user