NoSuchMethodError with Traveler's Backpack Capability - CGM tries to call missing getContainer()
rdouda opened this issue · 0 comments
The game crashes with an Internal Server Error when MrCrayfish's Gun Mod (CGM) attempts to check for ammo in Traveler's Backpack, even if the player does not currently have one.
Error Log:
java.lang.NoSuchMethodError: 'com.tiviacz.travelersbackpack.inventory.TravelersBackpackContainer com.tiviacz.travelersbackpack.capability.ITravelersBackpack.getContainer()'
at com.mrcrayfish.guns.compat.TravelersBackpackHelper.lambda$findAmmo$1(TravelersBackpackHelper.java:19)
...
Steps to Reproduce:
- Have both MrCrayfish's Gun Mod (CGM) and Traveler's Backpack installed.
- Join a world (no backpack needed).
- Use a gun from CGM (or possibly trigger an advancement).
- Server crashes with NoSuchMethodError.
Expected Behavior:
- If Traveler's Backpack is installed but no backpack is present, CGM should either:
- Gracefully skip backpack ammo checks.
- Properly check for the correct capability method.
Possible Causes:
API Mismatch: CGM was compiled against an older/newer version of Traveler's Backpack’s API.
Missing Null Checks: CGM does not verify if the capability exists before calling getContainer().