Changed: MC Mod

Changed: MC Mod

156k Downloads

Crashes on the 0.14 version due to goo types going crazy

alexbomb6666 opened this issue ยท 2 comments

commented

After creating a normal world and being in it for some time, the world closes and spits out this error:

[21:24:15] [Server thread/ERROR] [minecraft/MinecraftServer]: Exception stopping the server
java.util.concurrent.CompletionException: net.minecraft.ReportedException: Feature placement
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {re:mixin}
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {re:mixin}
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?] {}
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] {}
	at net.minecraft.server.level.ChunkTaskPriorityQueueSorter.m_143188_(ChunkTaskPriorityQueueSorter.java:62) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading}
	at net.minecraft.util.thread.ProcessorMailbox.m_18759_(ProcessorMailbox.java:91) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading}
	at net.minecraft.util.thread.ProcessorMailbox.m_18747_(ProcessorMailbox.java:146) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading}
	at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:102) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading}
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395) ~[?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:mixin,re:computing_frames}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:mixin,re:computing_frames}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {re:mixin}
Caused by: net.minecraft.ReportedException: Feature placement
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$22(ChunkMap.java:604) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:bugfix.paper_chunk_patches.ChunkMapMixin,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ChunkMapLoadMixin,pl:mixin:APP:flytre_lib.mixins.json:base.ThreadedAnvilChunkStorageAccessor,pl:mixin:APP:securitycraft.mixins.json:camera.ChunkMapMixin,pl:mixin:A}
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.1.27.jar%2323!/:?] {}
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$24(ChunkMap.java:587) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:bugfix.paper_chunk_patches.ChunkMapMixin,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ChunkMapLoadMixin,pl:mixin:APP:flytre_lib.mixins.json:base.ThreadedAnvilChunkStorageAccessor,pl:mixin:APP:securitycraft.mixins.json:camera.ChunkMapMixin,pl:mixin:A}
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?] {}
	... 11 more
Caused by: java.lang.IllegalArgumentException: No enum constant net.ltxprogrammer.changed.entity.GooType.WHITE_LATEX
	at java.lang.Enum.valueOf(Enum.java:273) ~[?:?] {re:mixin}
	at net.ltxprogrammer.changed.entity.GooType.valueOf(GooType.java:23) ~[Changed-m1.18.2-v0.14.jar%2374!/:v0.14] {re:mixin,pl:runtime_enum_extender:A,re:classloading,pl:runtime_enum_extender:A}
	at net.ltxprogrammer.changed.block.entity.LatexContainerBlockEntity.m_142466_(LatexContainerBlockEntity.java:35) ~[Changed-m1.18.2-v0.14.jar%2374!/:v0.14] {re:classloading}
	at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.m_74536_(StructureTemplate.java:250) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading,pl:accesstransformer:B}
	at net.ltxprogrammer.changed.world.features.structures.facility.FacilitySinglePiece$StructureInstance.m_183269_(FacilitySinglePiece.java:96) ~[Changed-m1.18.2-v0.14.jar%2374!/:v0.14] {re:classloading}
	at net.minecraft.world.level.levelgen.structure.StructureStart.m_7129_(StructureStart.java:53) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.chunk.ChunkGenerator.m_211641_(ChunkGenerator.java:438) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:computing_frames,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.cache_strongholds.ChunkGeneratorMixin,pl:mixin:A}
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422) ~[guava-31.0.1-jre.jar%2318!/:?] {re:mixin}
	at net.minecraft.world.level.chunk.ChunkGenerator.m_183372_(ChunkGenerator.java:437) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:computing_frames,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.cache_strongholds.ChunkGeneratorMixin,pl:mixin:A}
	at net.minecraft.world.level.chunk.ChunkStatus.m_187807_(ChunkStatus.java:135) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.level.chunk.ChunkStatus.m_187788_(ChunkStatus.java:262) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$22(ChunkMap.java:589) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:bugfix.paper_chunk_patches.ChunkMapMixin,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ChunkMapLoadMixin,pl:mixin:APP:flytre_lib.mixins.json:base.ThreadedAnvilChunkStorageAccessor,pl:mixin:APP:securitycraft.mixins.json:camera.ChunkMapMixin,pl:mixin:A}
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.1.27.jar%2323!/:?] {}
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$24(ChunkMap.java:587) ~[client-1.18.2-20220404.173914-srg.jar%23177!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:bugfix.paper_chunk_patches.ChunkMapMixin,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ChunkMapLoadMixin,pl:mixin:APP:flytre_lib.mixins.json:base.ThreadedAnvilChunkStorageAccessor,pl:mixin:APP:securitycraft.mixins.json:camera.ChunkMapMixin,pl:mixin:A}
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?] {}
	... 11 more

The error occurs in the LatexContainerBlockEntity.java class on line 35. Specifically, the error is happening when trying to convert a string to an enum constant and failing to find the enum constant for GooType.WHITE_LATEX.
The function gets WHITE_LATEX as a goo type while it should do PURE_WHITE_GOO. When updating the variables for the goo type, a dev forgot to replace everything else with it as well!
Due to me not fully understanding code, ive made a placeholder that fixes the problem by simply converting every goo type to black latex

The placeholder (the old function is commented):

//    @Override
//    public void load(CompoundTag tag) {
//        super.load(tag);
//        if (tag.contains("LatexType")) currentType = GooType.valueOf(tag.getString("LatexType"));
//        if (tag.contains("FillLevel")) fillLevel = tag.getByte("FillLevel");
//    }
    @Override
    public void load(CompoundTag tag) {
        super.load(tag);
        if (tag.contains("LatexType")) {
            String latexType = tag.getString("LatexType").toUpperCase();
            try {
                currentType = GooType.valueOf(latexType);
            } catch (IllegalArgumentException e) {
                // Handle the case when the enum constant is not found
                // You can set a default type or handle this situation based on your requirements
                // For example, setting a default type:
                currentType = GooType.BLACK_GOO;
            }
        }
        if (tag.contains("FillLevel")) fillLevel = tag.getByte("FillLevel");
    }
commented

I've also tried to reach out to you using discord to report other less significant bugs, but you haven't replied to me, hence i made this issue on github
Discord_lhA410nTnl
image

commented

Added this to DataFixer 30887bb