rosebudmods / bodacious-berries

berries for all!
MIT License
8 stars 7 forks source link

[bug] java.lang.ClassNotFoundException: net.minecraft.entity.vehicle.VehicleInventory on bodacious_berries versions 2.0.4 and 2.0.5 on quilt #58

Closed lospejos closed 2 years ago

lospejos commented 2 years ago

describe the bug Error starting qfapi server qfapi-4.0.0-beta.12_qsl-3.0.0-beta.16_fapi-0.61.0_mc-1.19.2 with bodacious_berries-2.0.5+mc1.19.2 or bodacious_berries-2.0.4+mc1.19.2:

[15:36:45] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.class_148: Ticking block entity
    at Not Enough Crashes deobfuscated stack trace.(1.19.2+build.9) ~[?:?]
    at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:879) ~[server-intermediary.jar:?]
    at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:289) ~[?:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer:819) ~[server-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:665) ~[server-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:257) ~[server-intermediary.jar:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/entity/vehicle/VehicleInventory
    at me.jellysquid.mods.lithium.api.inventory.LithiumInventory.generateLootLithium(LithiumInventory.java:57) ~[bodacious_berries-2.0.4+mc1.19.2.jar:?]
    at me.jellysquid.mods.lithium.common.hopper.InventoryHelper.upgradeToLithiumStackList(InventoryHelper.java:20) ~[lithium-fabric-mc1.19.2-0.8.3.jar:?]
    at me.jellysquid.mods.lithium.common.hopper.InventoryHelper.getLithiumStackList(InventoryHelper.java:13) ~[lithium-fabric-mc1.19.2-0.8.3.jar:?]
    at net.minecraft.block.entity.HopperBlockEntity.redirect$cdo000$lithiumHopperIsEmpty(HopperBlockEntity:778) ~[?:?]
    at net.minecraft.block.entity.HopperBlockEntity.insertAndExtract(HopperBlockEntity:114) ~[?:?]
    at net.minecraft.block.entity.HopperBlockEntity.serverTick(HopperBlockEntity:102) ~[?:?]
    at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:660) ~[?:?]
    at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:714) ~[?:?]
    at net.minecraft.world.World.tickBlockEntities(World:456) ~[?:?]
    at net.minecraft.server.world.ServerWorld.tick(ServerWorld:376) ~[?:?]
    at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:875) ~[server-intermediary.jar:?]
    ... 5 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.entity.vehicle.VehicleInventory
    at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
    at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
    at org.quiltmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:159) ~[quilt-loader-0.17.5-beta.2.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
    at me.jellysquid.mods.lithium.api.inventory.LithiumInventory.generateLootLithium(LithiumInventory.java:57) ~[bodacious_berries-2.0.4+mc1.19.2.jar:?]
    at me.jellysquid.mods.lithium.common.hopper.InventoryHelper.upgradeToLithiumStackList(InventoryHelper.java:20) ~[lithium-fabric-mc1.19.2-0.8.3.jar:?]
    at me.jellysquid.mods.lithium.common.hopper.InventoryHelper.getLithiumStackList(InventoryHelper.java:13) ~[lithium-fabric-mc1.19.2-0.8.3.jar:?]
    at net.minecraft.block.entity.HopperBlockEntity.redirect$cdo000$lithiumHopperIsEmpty(HopperBlockEntity:778) ~[?:?]
    at net.minecraft.block.entity.HopperBlockEntity.insertAndExtract(HopperBlockEntity:114) ~[?:?]
    at net.minecraft.block.entity.HopperBlockEntity.serverTick(HopperBlockEntity:102) ~[?:?]
    at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:660) ~[?:?]
    at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:714) ~[?:?]
    at net.minecraft.world.World.tickBlockEntities(World:456) ~[?:?]
    at net.minecraft.server.world.ServerWorld.tick(ServerWorld:376) ~[?:?]
    at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:875) ~[server-intermediary.jar:?]
    ... 5 more

reproduction

  1. Start server with qfapi-4.0.0-beta.12_qsl-3.0.0-beta.16_fapi-0.61.0_mc-1.19.2 and bodacious_berries-2.0.5+mc1.19.2 or bodacious_berries-2.0.4+mc1.19.2
  2. See error

affected versions bodacious_berries-2.0.5+mc1.19.2, bodacious_berries-2.0.4+mc1.19.2

note On qfapi-4.0.0-beta.12_qsl-3.0.0-beta.16_fapi-0.61.0_mc-1.19.2 with bodacious_berries-2.0.2+mc1.19.2 everything works fine. This error may be related to changes made in QFAPI in recent versions. But I kindly ask to make appropriate changes in your mod to make this mod compatible with QFAPI. AFAIK some mod makers made such changes and their mods became compatible with recent QFAPI versions.

Thanks!

ix0rai commented 2 years ago

this seems to be caused by me including the mapped version of lithium's API, meaning that I end up shipping code that assumes one of minecraft's classes is named one thing, when in your environment it's named something different. thank you for reporting, I should be able to have this fixed later today!

edit: this is entirely wrong, still working on finding the cause

ix0rai commented 2 years ago

@lospejos I'm currently unable to recreate the crash could you: a. provide more detailed reproduction information b. provide a full crash log without Not Enough Crashes

(I tested starting a production server, connecting from a production client, running the juicer and berry harvester with hoppers, planting and picking berries, etc without encountering the crash)

I'll keep investigating, but I'm not sure I'll be able to solve this without more information. Next on the list is to check the changelist between 2.0.2 and 2.0.4

ix0rai commented 2 years ago

this is for sure an issue with my implmentation of lithium's api, but I can't figure out what's wrong with it. I've decompiled the production jar to ensure that it's all mapped to intermediary when built, yet there are still classes that cannot be found.

lospejos commented 2 years ago

I've tested such mod combinations on server (just those mods, no other mods!): 1) QFAPI + Bodacious Berries qfapi-4.0.0-beta.12_qsl-3.0.0-beta.16_fapi-0.61.0_mc-1.19.2 bodacious_berries-2.0.5+mc1.19.2 Works fine

2) QFAPI + Lithium + Bodacious Berries qfapi-4.0.0-beta.12_qsl-3.0.0-beta.16_fapi-0.61.0_mc-1.19.2 lithium-fabric-mc1.19.2-0.8.3 bodacious_berries-2.0.5+mc1.19.2 Works fine.

Probably there is some mod conflict or incompatibility between Bodacious Berries and some other mod. Will try to find out.

lospejos commented 2 years ago

What I've done:

1) Removed notenoughcrashes-4.1.8+1.19.2-fabric from mods 2) Replaced working bodacious_berries-2.0.2+mc1.19.2 with bodacious_berries-2.0.5+mc1.19.2 in mods 3) Started server

Startup failed.

crash-2022-09-17_16.32.08-server.txt is here: https://gist.github.com/lospejos/43db3149d2f6d0f0ba7d014fa6e52c93 latest.log is here: https://gist.github.com/lospejos/4817b2bae8ffc21625cf93bc0970d84d

I hope this may help to find the cause. As you probably could see from latest.log I have plenty of mods installed along with bodacious_berries-2.0.5+mc1.19.2.

ix0rai commented 2 years ago

thank you! since that's a lot of mods for me to download if I want to reproduce this myself, I would really appreciate it if you could narrow it down to the smallest possible combination.

lospejos commented 2 years ago

I you want, I prepared my pack of mods (the working variant with bodacious_berries-2.0.2+mc1.19.2) here: https://gofile.io/d/4DPNJK

ix0rai commented 2 years ago

that'll be helpful thank you if you don't have time to search for the specific conflicting mod(s) I can do that later today

lospejos commented 2 years ago

Another notice, that may help: I have non server (local) game with plenty of mods and bodacious_berries-2.0.5+mc1.19.2 among them. Game starts ok, I played a couple of hours, but suddenly started to get this error (just like I posted before): java.lang.NoClassDefFoundError: net/minecraft/entity/vehicle/VehicleInventory

BTW Minecraft creates crash-2022-09-18_18.48.21-server.txt (not client, but server crashdump). For me is looks like a connection to server lost error.

Addition: after replacing bodacious_berries-2.0.5+mc1.19.2 on bodacious_berries-2.0.2+mc1.19.2 error gone, everything works fine on local game.

ix0rai commented 2 years ago

sooooooooooooooooooo the first thing I checked was whether this was a conflict with lithium, and it turned out to be, indeed, a conflict with lithium. which like. what. implementing their api should not mean that the mod borks itself. I'm pretty sure that this is an issue with lithium, so I'm going to go over and open an issue there. In the meantime, using bodacious berries 2.0.2 is a good workaround.

ix0rai commented 2 years ago

this actually doesn't occur with only bodacious berries and lithium. will do more investigation.

ix0rai commented 2 years ago

having issues reproducing, again. this seems to be related to loading specific world data, as I had a crashing world that I deleted, and after regenerating the issue was gone.

ix0rai commented 2 years ago

so -- I've tried a couple more times and still haven't been able to reproduce this locally. But, I know how it could be fixed, and the fix would just decrease performance by a tiny bit. My current plan is to implement a config option to disable lithium's inventory optimisations (specifically with my blocks), therefore not loading any lithium code and not encountering this error.

ix0rai commented 2 years ago

@lospejos could you test with this version? it removes lithium block entity optimisations crash-fix-testing-version.zip

lospejos commented 2 years ago

@lospejos could you test with this version? it removes lithium block entity optimisations crash-fix-testing-version.zip

Tested server with this new mod version - the error still the same:

net.minecraft.class_148: Ticking block entity
...
Caused by: java.lang.NoClassDefFoundError: net/minecraft/entity/vehicle/VehicleInventory
...
Caused by: java.lang.ClassNotFoundException: net.minecraft.entity.vehicle.VehicleInventory
ix0rai commented 2 years ago

ok, then there's one final test that I need you to run can you try this version? bodacious-berries-lithium-removed.zip

lospejos commented 2 years ago

ok, then there's one final test that I need you to run can you try this version? bodacious-berries-lithium-removed.zip

This mod version is working just fine both on server and client. Thanks!

ix0rai commented 2 years ago

excellent! I'll look into getting a fix into a more official version soon.

ix0rai commented 2 years ago

@lospejos sorry this has taken so long, but I have another version for you to test if this one works I can make a new release with identical code bodacious-berries-reimplemented-lithium.zip

TalEdd commented 2 years ago

I'm playing on Fabric, 1.19.2. I tried out both the versions. The no lithium version works perfectly fine, while the reimplemented lithium version crashes after running around the world for a while, or crashes when creating a new world.

Crash Reports: crash-2022-09-30_22.29.58-server.txt crash-2022-09-30_22.24.13-server.txt crash-2022-09-30_23.00.54-server.txt

ix0rai commented 2 years ago

thank you! this most likely means it's an issue with lithium, or the way I package its API. I'll report this to them, and hopefully we can find a fix.

ix0rai commented 2 years ago

I believe I've finally found a fix (at least, this fixed the issue in my server) one final testing version for you all @lospejos @TalEdd bodacious-berries-lithium-api-working-i-think.zip

lospejos commented 2 years ago

I believe I've finally found a fix (at least, this fixed the issue in my server) one final testing version for you all @lospejos @TalEdd bodacious-berries-lithium-api-working-i-think.zip

Tested and worked just fine both on server and client.

ix0rai commented 2 years ago

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS thank you!!

ix0rai commented 2 years ago

so sorry this fix took so long

ix0rai commented 2 years ago

released in 2.0.6!