mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-22 08:07:42 +00:00
Merged off-thread dimension restore
- Saved dimensions prepare in parallel during world load - Server start only creates levels and publishes engines
This commit is contained in:
commit
a0cf3d79bf
13 files changed
+1118
-223
No files matched your search
+6
-3
@@ -30,9 +30,12 @@ record PreparedHydrologyCacheIdentity(String fingerprint) {
|
||||
if (context.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
String content = GenerationPackFingerprint.compute(
|
||||
target.getData().getDataFolder().toPath(), GenerationPackFingerprint.CURRENT_VERSION);
|
||||
String dependencies = target.getData().hasGenerationRegistryContract() ? "closed"
|
||||
boolean immutable = target.getData().hasGenerationRegistryContract();
|
||||
String content = immutable
|
||||
? target.getData().generationPackFingerprint()
|
||||
: GenerationPackFingerprint.compute(
|
||||
target.getData().getDataFolder().toPath(), GenerationPackFingerprint.CURRENT_VERSION);
|
||||
String dependencies = immutable ? "closed"
|
||||
: dependencyFingerprint(IrisPlatforms.get().packsFolderNoCreate());
|
||||
if (dependencies.isBlank()) {
|
||||
return null;
|
||||
|
||||
+21
@@ -1,6 +1,7 @@
|
||||
package art.arcane.iris.generation.runtime;
|
||||
|
||||
import art.arcane.iris.world.history.GenerationKernelRegistry;
|
||||
import art.arcane.iris.world.history.GenerationPackFingerprint;
|
||||
import art.arcane.iris.world.history.TransitionGenerationPlan;
|
||||
import org.junit.Test;
|
||||
import org.junit.Rule;
|
||||
@@ -21,6 +22,7 @@ import static org.mockito.Mockito.mockStatic;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -121,6 +123,8 @@ public class PreparedHydrologyCacheIdentityTest {
|
||||
IrisData data = mock(IrisData.class);
|
||||
when(data.getDataFolder()).thenReturn(path.toFile());
|
||||
when(data.hasGenerationRegistryContract()).thenReturn(true);
|
||||
when(data.generationPackFingerprint()).thenAnswer(invocation ->
|
||||
GenerationPackFingerprint.compute(path, GenerationPackFingerprint.CURRENT_VERSION));
|
||||
IrisWorld world = mock(IrisWorld.class);
|
||||
when(world.minHeight()).thenReturn(-64);
|
||||
when(world.maxHeight()).thenReturn(320);
|
||||
@@ -133,6 +137,23 @@ public class PreparedHydrologyCacheIdentityTest {
|
||||
return target;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void immutableGenerationPackUsesTheDataFingerprintWithoutRereadingThePack() throws Exception {
|
||||
Path missing = folder.getRoot().toPath().resolve("immutable-epoch-pack");
|
||||
EngineTarget target = target(missing);
|
||||
IrisData data = target.getData();
|
||||
doReturn("verified-epoch").when(data).generationPackFingerprint();
|
||||
GenerationKernelRegistry.RuntimeKernel kernel = kernel("implementation");
|
||||
try (MockedStatic<PackValidationCache> validation = mockStatic(PackValidationCache.class)) {
|
||||
validation.when(PackValidationCache::contextFingerprint).thenReturn("platform");
|
||||
|
||||
PreparedHydrologyCacheIdentity captured = PreparedHydrologyCacheIdentity.capture(target, kernel, null, false);
|
||||
|
||||
assertEquals(PreparedHydrologyCacheIdentity.fromInputs(
|
||||
"verified-epoch", "closed", "platform", kernel, null, -64, 320, 0), captured);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void identicalInputsShareRegardlessOfWorldLocation() {
|
||||
GenerationKernelRegistry.RuntimeKernel kernel = kernel("implementation");
|
||||
|
||||
Reference in new issue
Block a user