Lightman's Currency

Lightman's Currency

331k Downloads

BUG: {Duplicating Glitch}

ZeusXenios opened this issue ยท 5 comments

commented

Minecraft Version:
Forge Version:
Lightman's Currency Version:
Other Relevant Mods & Version (LC Tech, etc.):
Connection Type (Single-player, server/client, LAN world):

Describe the bug
Running a sever with this mod and Inventory Profiles Next / https://www.curseforge.com/minecraft/mc-mods/inventory-profiles-next

They have found a glitch in the wallet. Where they can replicate the coins over and over and duplicate them using the auto sort feature with this system.

To Reproduce
Steps to reproduce the behavior:

  1. Open wallet menu place coins in 3rd slot of diamond wallet
  2. Click on sort in top right
  3. Pops coins in hand to place in inventory while keeping.
  4. Need option to disable wallets would help resolve this quickly

Expected behavior
Push coins to the left and not duplicate

Screenshots/Logs/Crash Reports
Shut server down as soon as this was brought to my attention. No screen shots available.

Additional context
If an option could be put in for wallet disable would be great.

commented

Thank you for being thorough with your report, but you missed some important information that I need, namely the Lightman's Currency & Minecraft versions as, while visually the same, the 1.16 & 1.18 versions of the wallet screen function very differently internally due to some internal changes to how menus are handled in 1.18.

For now I'm going to work on the assumption that it's the 1.18 version (although I'll probably test it on both just to make sure it's not present on both), and I already have a theory as to why it's happening, as on 1.18 I'm not able to re-initialize the coin menu's slots to remove the un-needed coin slots the exact instant the wallet is removed from the slot, so if the sorter removes the wallet, and then the coins, then puts them all back, the fact that the coins were removed will not be saved to the wallet's NBT data, and thus the coins will remain there despite the fact that they were also moved elsewhere causing the duplication. I'll experiment and see if I can find some way of locking the coin slots contents when the wallets been removed while it waits for a safe time to re-initialize the coin slots, and hope that the sorter works in the logical method of from slot index 0 and upwards, cause if it moves things around in a random-ish order, there's truly not much I can do about it.

Also, I have one final question, but as a stop-gap is there some method in the inventory profiles config that allows you to disable it for certain menus, cause if so you should probably go ahead and disable it for the wallet menu anyways as it has it's own sort function with the coin conversion button (unless you only have a lowly copper wallet, but that's easy enough to upgrade into an iron wallet anyways).

commented

Good news, I managed to fix the duplication bug by locking the coin slots once the wallet is moved.

Bad news is that the inventory profiles mod now decides to just move your wallet into your hand and just stop, despite the fact that it has a perfectly good wallet slot to put it in, and then it lets the vanilla click interaction happen, causing it to now throw your wallet onto the ground as where the sort button used to be is now off the screen.

It appears to be throwing an error complaining about trying to access slot index 73 (the 74th slot for those not in the programming know), despite the fact that the wallets always have exactly 73 slots and no more (there are a lot of off-screen locked slots when no wallet is equipped, simply to keep the slot indexes & count constant for safety reasons), so it appears as though I'll probably have to use their API to disable it entirely for the wallet screen, as trying to figure out what they're doing and work my way around it is going to be more trouble than it's worth, especially on a screen that already has it's own built-in sorting via the coin conversion button.

Edit: Also, while the coin duplication doesn't happen in 1.16, it does still do the weird wallet toss issue, so I'm going to have to disable it on both versions.

commented

Fixed in v1.0.3.2. Have a good day ๐Ÿ˜„

commented

Man you work fast!! I just now was reading all your replies. Great work on these mods man! This stuff is amazing work.

commented

Apologies on the gap of information on the version and it is 1.18. I was in a rush and being my first bug report was sure how to fill one out in the first place. Thanks again