Lithium (Fabric)

Lithium (Fabric)

22M Downloads

Cannot disable Hopper patches in Lithium 0.10

jellysquid3 opened this issue ยท 1 comments

commented

Version Information

lithium-fabric-mc1.19.2-0.10.1

Expected Behavior

Disabling mixin.block.hopper in the mixin configuration file should not cause crashes.

Actual Behavior

mixin/util/inventory_change_listening/StackListReplacementTracking.java depends on the mixin.block.hopper configuration being enabled, and it cannot be disabled. This causes the following error and prevents chest inventories from being loaded.

Server error log
[18:26:04] [Server thread/WARN]: Skipping BlockEntity with id minecraft:chest
[18:26:04] [Server thread/ERROR]: Failed to load data for block entity minecraft:chest
java.lang.ClassCastException: class net.minecraft.class_2595 cannot be cast to class me.jellysquid.mods.lithium.api.inventory.LithiumInventory (net.minecraft.class_2595 and me.jellysquid.mods.lithium.api.inventory.LithiumInventory are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @4e04a765)
	at net.minecraft.block.entity.LockableContainerBlockEntity.invalidateChangeListening(LockableContainerBlockEntity.java:1570) ~[server-intermediary.jar:?]
	at net.minecraft.block.entity.LockableContainerBlockEntity.emitStackListReplaced(LockableContainerBlockEntity.java:1545) ~[server-intermediary.jar:?]
	at net.minecraft.block.entity.LockableContainerBlockEntity.handler$ddh000$readNbtStackListReplacement(LockableContainerBlockEntity.java:2030) ~[server-intermediary.jar:?]
	at net.minecraft.block.entity.LockableContainerBlockEntity.readNbt(LockableContainerBlockEntity.java:37) ~[server-intermediary.jar:?]
	at net.minecraft.block.entity.ChestBlockEntity.readNbt(ChestBlockEntity.java:78) ~[server-intermediary.jar:?]
	at net.minecraft.block.entity.BlockEntity.method_17897(BlockEntity.java:132) ~[server-intermediary.jar:?]
	at java.util.Optional.map(Optional.java:260) ~[?:?]
	at net.minecraft.block.entity.BlockEntity.createFromNbt(BlockEntity.java:130) ~[server-intermediary.jar:?]
	at net.minecraft.world.ChunkSerializer.method_39797(ChunkSerializer.java:428) ~[server-intermediary.jar:?]
	at net.minecraft.world.chunk.WorldChunk.loadEntities(WorldChunk.java:434) ~[server-intermediary.jar:?]
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17227(ThreadedAnvilChunkStorage.java:745) ~[server-intermediary.jar:?]
	at com.mojang.datafixers.util.Either.lambda$mapLeft$0(Either.java:162) ~[datafixerupper-5.0.28.jar:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-5.0.28.jar:?]
	at com.mojang.datafixers.util.Either.mapLeft(Either.java:162) ~[datafixerupper-5.0.28.jar:?]
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_20460(ThreadedAnvilChunkStorage.java:733) ~[server-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.util.thread.ThreadExecutor.redirect$zfg000$redirectExecuteTask(ThreadExecutor.java:521) ~[server-intermediary.jar:?]
	at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:131) ~[server-intermediary.jar:?]
	at net.minecraft.server.world.ServerChunkManager$MainThreadExecutor.runTask(class_3215.java:566) ~[server-intermediary.jar:?]
	at net.minecraft.server.world.ServerChunkManager.executeQueuedTasks(ServerChunkManager.java:279) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.runOneTask(MinecraftServer.java:15283) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.runTask(MinecraftServer.java:[752](https://mclo.gs/IgVf0PW#L752)) ~[server-intermediary.jar:?]
	at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:140) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.runTasksTillTickEnd(MinecraftServer.java:737) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.handler$zhn000$modifiedRunLoop(MinecraftServer.java:3894) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:644) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[server-intermediary.jar:?]
	at java.lang.Thread.run(Thread.java:1589) [?:?]

Reproduction Steps

With the default configuration, place a chest entity in the world and put some items into it. Close the game, modify Lithium's configuration to disable mixin.block.hopper, and reload into the world. The chest will be empty and the error above will appear in the log file.

Other Information

Reported by MarijnIsN00B#5548 on the Discord server.

commented

This issue is the result of a misunderstanding. Actual issue report: #410