mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 01:34:04 +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
|
@Data
|
||||||
public static class IrisSettingsStudio {
|
public static class IrisSettingsStudio {
|
||||||
public boolean openVSCode = true;
|
public boolean openVSCode = true;
|
||||||
public boolean blendChanges = false;
|
public boolean keepPackVersions = false;
|
||||||
public boolean disableTimeAndWeather = true;
|
public boolean disableTimeAndWeather = true;
|
||||||
public boolean entitySpawning = true;
|
public boolean entitySpawning = true;
|
||||||
public boolean autoStartDefaultStudio = false;
|
public boolean autoStartDefaultStudio = false;
|
||||||
|
|||||||
@@ -256,9 +256,7 @@ final class EngineHotloader {
|
|||||||
throw new IllegalStateException("Studio engine changed while its generation cutover was draining.");
|
throw new IllegalStateException("Studio engine changed while its generation cutover was draining.");
|
||||||
}
|
}
|
||||||
engine.prepareRuntimeHotload();
|
engine.prepareRuntimeHotload();
|
||||||
IrisSettings settings = IrisSettings.get();
|
int transitionWidth = IrisSettings.get().getGenerator().getGenerationTransitionWidthBlocks();
|
||||||
int transitionWidth = settings.getStudio().isBlendChanges()
|
|
||||||
? settings.getGenerator().getGenerationTransitionWidthBlocks() : 0;
|
|
||||||
history.stageUpdateReplacingStalePending(update.source(), update.fingerprint(),
|
history.stageUpdateReplacingStalePending(update.source(), update.fingerprint(),
|
||||||
update.dimensionContract(), update.registryContract(), transitionWidth);
|
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() {
|
private boolean usesSinglePackStudio() {
|
||||||
return studio && !IrisSettings.get().getStudio().isBlendChanges();
|
return studio && !IrisSettings.get().getStudio().isKeepPackVersions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int removeTransientStudioWorldsFromBukkitYml() throws IOException {
|
public static int removeTransientStudioWorldsFromBukkitYml() throws IOException {
|
||||||
|
|||||||
@@ -72,18 +72,25 @@ public class IrisSettingsDefaultsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void studioBlendingIsOptInAndAcceptsEnabledHotload() {
|
public void studioPackVersionsAreOptInAndAcceptEnabledHotload() {
|
||||||
IrisSettings defaults = new IrisSettings();
|
IrisSettings defaults = new IrisSettings();
|
||||||
assertFalse(defaults.getStudio().isBlendChanges());
|
assertFalse(defaults.getStudio().isKeepPackVersions());
|
||||||
assertFalse(new Gson().fromJson("{\"studio\":{}}", IrisSettings.class).getStudio().isBlendChanges());
|
assertFalse(new Gson().fromJson("{\"studio\":{}}", IrisSettings.class).getStudio().isKeepPackVersions());
|
||||||
assertTrue(new Gson().toJson(defaults).contains("\"blendChanges\":false"));
|
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());
|
assertEquals(256, changed.getGenerator().getGenerationTransitionWidthBlocks());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void settingsSavedBeforePackVersionsBecameOptInStaySinglePack() {
|
||||||
|
IrisSettings saved = IrisSettings.parseHotloadSnapshot("{\"studio\":{\"blendChanges\":true}}");
|
||||||
|
|
||||||
|
assertFalse(saved.getStudio().isKeepPackVersions());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void hotloadSnapshotIsValidatedBeforeReplacingLiveSettings() {
|
public void hotloadSnapshotIsValidatedBeforeReplacingLiveSettings() {
|
||||||
IrisSettings previous = IrisSettings.settings;
|
IrisSettings previous = IrisSettings.settings;
|
||||||
|
|||||||
Reference in new issue
Block a user