diff --git a/c2me-base/src/main/resources/c2me-base.accesswidener b/c2me-base/src/main/resources/c2me-base.accesswidener index 4e31829c6..5117acfd2 100644 --- a/c2me-base/src/main/resources/c2me-base.accesswidener +++ b/c2me-base/src/main/resources/c2me-base.accesswidener @@ -27,7 +27,7 @@ accessible method net/minecraft/util/collection/WeightedList accessible method net/minecraft/nbt/NbtCompound (Ljava/util/Map;)V accessible method net/minecraft/nbt/NbtList (Ljava/util/List;B)V accessible method net/minecraft/world/gen/surfacebuilder/MaterialRules$SequenceBlockStateRule (Ljava/util/List;)V -accessible method net/minecraft/world/storage/RegionBasedStorage (Ljava/nio/file/Path;Z)V +accessible method net/minecraft/world/storage/RegionBasedStorage (Lnet/minecraft/class_9240;Ljava/nio/file/Path;Z)V accessible field net/minecraft/world/storage/StorageIoWorker$Result nbt Lnet/minecraft/nbt/NbtCompound; accessible field net/minecraft/world/storage/StorageIoWorker$Result future Ljava/util/concurrent/CompletableFuture; diff --git a/c2me-rewrites-chunk-serializer/src/main/java/com/ishland/c2me/rewrites/chunk_serializer/mixin/MixinThreadedAnvilChunkStorage.java b/c2me-rewrites-chunk-serializer/src/main/java/com/ishland/c2me/rewrites/chunk_serializer/mixin/MixinThreadedAnvilChunkStorage.java index 6f7dce2e1..00bebf9cd 100644 --- a/c2me-rewrites-chunk-serializer/src/main/java/com/ishland/c2me/rewrites/chunk_serializer/mixin/MixinThreadedAnvilChunkStorage.java +++ b/c2me-rewrites-chunk-serializer/src/main/java/com/ishland/c2me/rewrites/chunk_serializer/mixin/MixinThreadedAnvilChunkStorage.java @@ -5,6 +5,7 @@ import com.ishland.c2me.rewrites.chunk_serializer.common.ChunkDataSerializer; import com.ishland.c2me.rewrites.chunk_serializer.common.NbtWriter; import com.mojang.datafixers.DataFixer; +import net.minecraft.class_9240; import net.minecraft.nbt.NbtElement; import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ThreadedAnvilChunkStorage; @@ -36,15 +37,17 @@ public abstract class MixinThreadedAnvilChunkStorage extends VersionedChunkStora @Shadow ServerWorld world; + public MixinThreadedAnvilChunkStorage(class_9240 arg, Path path, DataFixer dataFixer, boolean bl) { + super(arg, path, dataFixer, bl); + } + @Shadow private native boolean isLevelChunk(ChunkPos chunkPos); @Shadow private native byte mark(ChunkPos chunkPos, ChunkStatus.ChunkType chunkType); - public MixinThreadedAnvilChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) { - super(directory, dataFixer, dsync); - } + /** * @author Kroppeb diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageThread.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageThread.java index 4eadf9f42..720e52ad5 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageThread.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageThread.java @@ -8,6 +8,7 @@ import com.ishland.c2me.base.mixin.access.IRegionFile; import it.unimi.dsi.fastutil.longs.Long2ReferenceLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArraySet; +import net.minecraft.class_9240; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtIo; import net.minecraft.nbt.NbtSizeTracker; @@ -62,8 +63,8 @@ public class C2MEStorageThread extends Thread { }; private final ObjectArraySet> writeFutures = new ObjectArraySet<>(); - public C2MEStorageThread(Path directory, boolean dsync, String name) { - this.storage = new RegionBasedStorage(directory, dsync); + public C2MEStorageThread(class_9240 arg, Path path, boolean dsync) { + this.storage = new RegionBasedStorage(arg, path, dsync); this.setName("C2ME Storage #%d".formatted(SERIAL.incrementAndGet())); this.setDaemon(true); this.setUncaughtExceptionHandler((t, e) -> LOGGER.error("Thread %s died".formatted(t), e)); diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageVanillaInterface.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageVanillaInterface.java index b25e1d899..614feee7a 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageVanillaInterface.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/common/C2MEStorageVanillaInterface.java @@ -2,6 +2,7 @@ import com.google.common.base.Preconditions; import com.ishland.c2me.base.common.theinterface.IDirectStorage; +import net.minecraft.class_9240; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.scanner.NbtScanner; import net.minecraft.util.math.ChunkPos; @@ -16,9 +17,9 @@ public class C2MEStorageVanillaInterface extends StorageIoWorker implements IDir private final C2MEStorageThread backend; - public C2MEStorageVanillaInterface(Path directory, boolean dsync, String name) { - super(null, dsync, name); - this.backend = new C2MEStorageThread(directory, dsync, name); + public C2MEStorageVanillaInterface(class_9240 arg, Path path, boolean dsync) { + super(arg, path, dsync); + this.backend = new C2MEStorageThread(arg, path, dsync); } @Override diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinChunkPosKeyedStorage.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinChunkPosKeyedStorage.java index a596a7cd7..1764f83b9 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinChunkPosKeyedStorage.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinChunkPosKeyedStorage.java @@ -1,6 +1,7 @@ package com.ishland.c2me.rewrites.chunkio.mixin; import com.ishland.c2me.rewrites.chunkio.common.C2MEStorageVanillaInterface; +import net.minecraft.class_9240; import net.minecraft.world.storage.ChunkPosKeyedStorage; import net.minecraft.world.storage.StorageIoWorker; import org.spongepowered.asm.mixin.Mixin; @@ -12,9 +13,9 @@ @Mixin(ChunkPosKeyedStorage.class) public class MixinChunkPosKeyedStorage { - @Redirect(method = "", at = @At(value = "NEW", target = "(Ljava/nio/file/Path;ZLjava/lang/String;)Lnet/minecraft/world/storage/StorageIoWorker;")) - private StorageIoWorker redirectStorageIoWorker(Path directory, boolean dsync, String name) { - return new C2MEStorageVanillaInterface(directory, dsync, name); + @Redirect(method = "", at = @At(value = "NEW", target = "(Lnet/minecraft/class_9240;Ljava/nio/file/Path;Z)Lnet/minecraft/world/storage/StorageIoWorker;")) + private StorageIoWorker redirectStorageIoWorker(class_9240 arg, Path path, boolean bl) { + return new C2MEStorageVanillaInterface(arg, path, bl); } } diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreatedChunkStorage.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreatedChunkStorage.java index a098beb38..648ceedc9 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreatedChunkStorage.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreatedChunkStorage.java @@ -1,6 +1,7 @@ package com.ishland.c2me.rewrites.chunkio.mixin; import com.ishland.c2me.rewrites.chunkio.common.C2MEStorageVanillaInterface; +import net.minecraft.class_9240; import net.minecraft.world.storage.RecreatedChunkStorage; import net.minecraft.world.storage.StorageIoWorker; import org.spongepowered.asm.mixin.Mixin; @@ -12,9 +13,9 @@ @Mixin(RecreatedChunkStorage.class) public class MixinRecreatedChunkStorage { - @Redirect(method = "", at = @At(value = "NEW", target = "(Ljava/nio/file/Path;ZLjava/lang/String;)Lnet/minecraft/world/storage/StorageIoWorker;")) - private StorageIoWorker redirectStorageIoWorker(Path directory, boolean dsync, String name) { - return new C2MEStorageVanillaInterface(directory, dsync, name); + @Redirect(method = "", at = @At(value = "NEW", target = "(Lnet/minecraft/class_9240;Ljava/nio/file/Path;Z)Lnet/minecraft/world/storage/StorageIoWorker;")) + private StorageIoWorker redirectStorageIoWorker(class_9240 arg, Path path, boolean bl) { + return new C2MEStorageVanillaInterface(arg, path, bl); } } diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreationStorage.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreationStorage.java index ab5d09293..7d97fec68 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreationStorage.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinRecreationStorage.java @@ -1,6 +1,7 @@ package com.ishland.c2me.rewrites.chunkio.mixin; import com.ishland.c2me.rewrites.chunkio.common.C2MEStorageVanillaInterface; +import net.minecraft.class_9240; import net.minecraft.world.storage.RecreationStorage; import net.minecraft.world.storage.StorageIoWorker; import org.spongepowered.asm.mixin.Mixin; @@ -12,9 +13,9 @@ @Mixin(RecreationStorage.class) public class MixinRecreationStorage { - @Redirect(method = "", at = @At(value = "NEW", target = "(Ljava/nio/file/Path;ZLjava/lang/String;)Lnet/minecraft/world/storage/StorageIoWorker;")) - private StorageIoWorker redirectStorageIoWorker(Path directory, boolean dsync, String name) { - return new C2MEStorageVanillaInterface(directory, dsync, name); + @Redirect(method = "", at = @At(value = "NEW", target = "(Lnet/minecraft/class_9240;Ljava/nio/file/Path;Z)Lnet/minecraft/world/storage/StorageIoWorker;")) + private StorageIoWorker redirectStorageIoWorker(class_9240 arg, Path path, boolean bl) { + return new C2MEStorageVanillaInterface(arg, path, bl); } } diff --git a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinVersionedChunkStorage.java b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinVersionedChunkStorage.java index f091ed3e0..cfa4714bf 100644 --- a/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinVersionedChunkStorage.java +++ b/c2me-rewrites-chunkio/src/main/java/com/ishland/c2me/rewrites/chunkio/mixin/MixinVersionedChunkStorage.java @@ -1,6 +1,7 @@ package com.ishland.c2me.rewrites.chunkio.mixin; import com.ishland.c2me.rewrites.chunkio.common.C2MEStorageVanillaInterface; +import net.minecraft.class_9240; import net.minecraft.world.storage.StorageIoWorker; import net.minecraft.world.storage.VersionedChunkStorage; import org.spongepowered.asm.mixin.Mixin; @@ -12,9 +13,9 @@ @Mixin(VersionedChunkStorage.class) public class MixinVersionedChunkStorage { - @Redirect(method = "", at = @At(value = "NEW", target = "(Ljava/nio/file/Path;ZLjava/lang/String;)Lnet/minecraft/world/storage/StorageIoWorker;")) - private StorageIoWorker redirectStorageIoWorker(Path directory, boolean dsync, String name) { - return new C2MEStorageVanillaInterface(directory, dsync, name); + @Redirect(method = "", at = @At(value = "NEW", target = "(Lnet/minecraft/class_9240;Ljava/nio/file/Path;Z)Lnet/minecraft/world/storage/StorageIoWorker;")) + private StorageIoWorker redirectStorageIoWorker(class_9240 arg, Path path, boolean bl) { + return new C2MEStorageVanillaInterface(arg, path, bl); } } diff --git a/c2me-threading-chunkio/src/main/java/com/ishland/c2me/threading/chunkio/mixin/MixinThreadedAnvilChunkStorage.java b/c2me-threading-chunkio/src/main/java/com/ishland/c2me/threading/chunkio/mixin/MixinThreadedAnvilChunkStorage.java index 25c81fa40..94292061a 100644 --- a/c2me-threading-chunkio/src/main/java/com/ishland/c2me/threading/chunkio/mixin/MixinThreadedAnvilChunkStorage.java +++ b/c2me-threading-chunkio/src/main/java/com/ishland/c2me/threading/chunkio/mixin/MixinThreadedAnvilChunkStorage.java @@ -20,6 +20,7 @@ import it.unimi.dsi.fastutil.longs.Long2ByteMaps; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; import net.minecraft.SharedConstants; +import net.minecraft.class_9240; import net.minecraft.nbt.NbtCompound; import net.minecraft.server.world.ChunkHolder; import net.minecraft.server.world.ServerWorld; @@ -64,8 +65,8 @@ @Mixin(ThreadedAnvilChunkStorage.class) public abstract class MixinThreadedAnvilChunkStorage extends VersionedChunkStorage implements ChunkHolder.PlayersWatchingChunkProvider { - public MixinThreadedAnvilChunkStorage(Path path, DataFixer dataFixer, boolean bl) { - super(path, dataFixer, bl); + public MixinThreadedAnvilChunkStorage(class_9240 arg, Path path, DataFixer dataFixer, boolean bl) { + super(arg, path, dataFixer, bl); } @Shadow @@ -272,7 +273,7 @@ private CompletableFuture> getUpdatedChunkNbtAtAsync(Chunk * @reason skip datafixer if possible */ @Overwrite - public CompletableFuture> getUpdatedChunkNbt(ChunkPos chunkPos) { + private CompletableFuture> getUpdatedChunkNbt(ChunkPos chunkPos) { // return this.getNbt(chunkPos).thenApplyAsync(nbt -> nbt.map(this::updateChunkNbt), Util.getMainWorkerExecutor()); return this.getNbt(chunkPos).thenCompose(nbt -> { if (nbt.isPresent()) { diff --git a/gradle.properties b/gradle.properties index d1586412d..082769150 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true # Fabric Properties # check these on https://fabricmc.net/versions.html -minecraft_version=24w05b -yarn_mappings=24w05b+build.2 +minecraft_version=24w06a +yarn_mappings=24w06a+build.4 loader_version=0.15.6 # Mod Properties mod_version=0.2.0+alpha.11 diff --git a/tests/world-diff/src/main/java/com/ishland/c2me/tests/worlddiff/ComparisonSession.java b/tests/world-diff/src/main/java/com/ishland/c2me/tests/worlddiff/ComparisonSession.java index d9287ebf2..7b1279a8a 100644 --- a/tests/world-diff/src/main/java/com/ishland/c2me/tests/worlddiff/ComparisonSession.java +++ b/tests/world-diff/src/main/java/com/ishland/c2me/tests/worlddiff/ComparisonSession.java @@ -8,6 +8,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.class_9240; import net.minecraft.datafixer.Schemas; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtList; @@ -316,9 +317,9 @@ private static WorldHandle getWorldHandle(File worldFolder, String description) final HashMap, StorageIoWorker> regionIoWorkers = new HashMap<>(); final HashMap, StorageIoWorker> poiIoWorkers = new HashMap<>(); for (RegistryKey world : worldKeys) { - regionIoWorkers.put(world, new StorageIoWorker(session.getWorldDirectory(world).resolve("region"), true, "chunk") { + regionIoWorkers.put(world, new StorageIoWorker(new class_9240(session.getDirectoryName(), world, "entities"), session.getWorldDirectory(world).resolve("region"), true) { }); - poiIoWorkers.put(world, new StorageIoWorker(session.getWorldDirectory(world).resolve("poi"), true, "poi") { + poiIoWorkers.put(world, new StorageIoWorker(new class_9240(session.getDirectoryName(), world, "entities"), session.getWorldDirectory(world).resolve("poi"), true) { }); } return new WorldHandle(