Crash when placing coins in modded storages
MaxisMustang opened this issue · 9 comments
Hello, as the title said, stacks over 99 coins tend to crash the game, as it can't handle high quantities inside storages, some just lower the stack number, others (like traveler's backpack) outright forces the game to crash, i will add the crash log for you to check, as this mod has a lot of potential and i'd like to keep using it on later versions
Thank you for reporting the issue!
You can temporarily try lowering the number for the stacks in the config.
To accomplish changing the stack size, and allowing the modified values in containers, this mod uses Mixins. This is usually compatible with other mods if they use the vanilla methods to get the max stack size for a container that they're extending.
Traveler's backpack sets the max stack size using an explicit value instead of getting the max value from the SimpleContainer class.
I might create an issue with Traveler's backpack to make them aware of this but I'll make some efforts to add additional checks to prevent the crashes.
Reference to Traveler's Backpack's source for MC 1.21 Fabric:
@MaxisMustang If you try changing the config value, Please let me know if changing the config value for the coin stack size is a valid workaround. If that's the case, setting the stack size config value to 64 by default might be the way to go for easier compatibility.
Found an additional touch point to change the max stack size. I'll test it with Traveler's backpack when I can.
Another potential workaround, if you don't want to change coin stack size, is to just store the coins in a bundle or shulker box.
After looking through the code, it's looking more like I'll have to create a ticket with Traveler's backpack as it's more of an issue with their mod not supporting stack sizes greater than 99.
I tested Villager Coin with another backpack mod and it didn't have any issues.
At this time, it does seem to be an issue with Traveler's Backpack handling of stack sizes.
Added some code that should resolve any current and future issues with modded containers and stack sizes. Checks on ranged integers now sets the max value to the Integer.MAX_VALUE if provided max value is greater than or equal to 99 (the previous max value).
These changes will be included in the next update.
@MaxisMustang Thank you again for reporting this issue and helping make VC better for everyone!