Skip to content

Commit 6d22adf

Browse files
committed
Fix ServerLevel not using custom seeds
1 parent d0d9ea2 commit 6d22adf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/level/ServerLevelMixin.java

+8
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ public ResourceKey<LevelStem> getTypeKey() {
124124
return this.typeKey;
125125
}
126126

127+
// Multiworld support: per-world seed storage
128+
@Inject(method = "getSeed", at = @At("HEAD"), cancellable = true)
129+
private void arclight$getSeed(CallbackInfoReturnable<Long> cir) {
130+
if (K != null) {
131+
cir.setReturnValue(K.worldGenOptions().seed());
132+
}
133+
}
134+
127135
@ShadowConstructor
128136
public void arclight$constructor(MinecraftServer minecraftServer, Executor backgroundExecutor, LevelStorageSource.LevelStorageAccess levelSave, ServerLevelData worldInfo, ResourceKey<Level> dimension, LevelStem levelStem, ChunkProgressListener statusListener, boolean isDebug, long seed, List<CustomSpawner> specialSpawners, boolean shouldBeTicking, RandomSequences seq) {
129137
throw new RuntimeException();

0 commit comments

Comments
 (0)