mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 16:25:36 +00:00
Rename the studio opt-in to keepPackVersions
This commit is contained in:
1 parent
f501e4b941
commit
bccfbae35c
4 files changed
+16
-15
No files matched your search
@@ -400,7 +400,7 @@ public class IrisSettings {
|
||||
@Data
|
||||
public static class IrisSettingsStudio {
|
||||
public boolean openVSCode = true;
|
||||
public boolean blendChanges = false;
|
||||
public boolean keepPackVersions = false;
|
||||
public boolean disableTimeAndWeather = true;
|
||||
public boolean entitySpawning = true;
|
||||
public boolean autoStartDefaultStudio = false;
|
||||
|
||||
@@ -256,9 +256,7 @@ final class EngineHotloader {
|
||||
throw new IllegalStateException("Studio engine changed while its generation cutover was draining.");
|
||||
}
|
||||
engine.prepareRuntimeHotload();
|
||||
IrisSettings settings = IrisSettings.get();
|
||||
int transitionWidth = settings.getStudio().isBlendChanges()
|
||||
? settings.getGenerator().getGenerationTransitionWidthBlocks() : 0;
|
||||
int transitionWidth = IrisSettings.get().getGenerator().getGenerationTransitionWidthBlocks();
|
||||
history.stageUpdateReplacingStalePending(update.source(), update.fingerprint(),
|
||||
update.dimensionContract(), update.registryContract(), transitionWidth);
|
||||
}
|
||||
|
||||
@@ -139,12 +139,8 @@ public class IrisCreator {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Studio worlds generate straight from the authoring pack unless blendChanges asks to keep every hotload as a
|
||||
* versioned activation.
|
||||
*/
|
||||
private boolean usesSinglePackStudio() {
|
||||
return studio && !IrisSettings.get().getStudio().isBlendChanges();
|
||||
return studio && !IrisSettings.get().getStudio().isKeepPackVersions();
|
||||
}
|
||||
|
||||
public static int removeTransientStudioWorldsFromBukkitYml() throws IOException {
|
||||
|
||||
@@ -72,18 +72,25 @@ public class IrisSettingsDefaultsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void studioBlendingIsOptInAndAcceptsEnabledHotload() {
|
||||
public void studioPackVersionsAreOptInAndAcceptEnabledHotload() {
|
||||
IrisSettings defaults = new IrisSettings();
|
||||
assertFalse(defaults.getStudio().isBlendChanges());
|
||||
assertFalse(new Gson().fromJson("{\"studio\":{}}", IrisSettings.class).getStudio().isBlendChanges());
|
||||
assertTrue(new Gson().toJson(defaults).contains("\"blendChanges\":false"));
|
||||
assertFalse(defaults.getStudio().isKeepPackVersions());
|
||||
assertFalse(new Gson().fromJson("{\"studio\":{}}", IrisSettings.class).getStudio().isKeepPackVersions());
|
||||
assertTrue(new Gson().toJson(defaults).contains("\"keepPackVersions\":false"));
|
||||
|
||||
IrisSettings changed = IrisSettings.parseHotloadSnapshot("{\"studio\":{\"blendChanges\":true}}");
|
||||
IrisSettings changed = IrisSettings.parseHotloadSnapshot("{\"studio\":{\"keepPackVersions\":true}}");
|
||||
|
||||
assertTrue(changed.getStudio().isBlendChanges());
|
||||
assertTrue(changed.getStudio().isKeepPackVersions());
|
||||
assertEquals(256, changed.getGenerator().getGenerationTransitionWidthBlocks());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void settingsSavedBeforePackVersionsBecameOptInStaySinglePack() {
|
||||
IrisSettings saved = IrisSettings.parseHotloadSnapshot("{\"studio\":{\"blendChanges\":true}}");
|
||||
|
||||
assertFalse(saved.getStudio().isKeepPackVersions());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hotloadSnapshotIsValidatedBeforeReplacingLiveSettings() {
|
||||
IrisSettings previous = IrisSettings.settings;
|
||||
|
||||
Reference in new issue
Block a user