Andrew6rant / Stacker

Minecraft mod to change the stack size of all items. Fabric 1.19, 1.18, and 1.17.
Creative Commons Zero v1.0 Universal
26 stars 17 forks source link

Compatibility with Inventory-Profiles #65

Open QZLin opened 2 years ago

QZLin commented 2 years ago

Cannot sort oversized stack with Inventory-Profiles when join multiplayer game https://github.com/blackd/Inventory-Profiles/issues/169#issuecomment-1242669423

Found something funny, I use Stacker (Andrew6rant/Stacker) and Inventory-Profiles on Minecraft fabric 1.19.1. Sort function will not work for oversized stacks if I directly join a multiplayer game. But if I leave the multiplayer game then open a local world and close it, sorting will work on both the local world and multiplayer world (for oversized stacks).

Looks like the problem is caused by Stacker because because ItemStack::getMaxCount returns 64 when connected to a server. IPN uses this value to check if the stack is oversized. image I suggest you report this to Stacker.

Wubzzz1337 commented 1 year ago

Any news on this?

Wubzzz1337 commented 1 year ago

@Andrew6rant

https://github.com/blackd/Inventory-Profiles/issues/293#issuecomment-1448526621

<3

Wubzzz1337 commented 1 year ago

Bumping because this is a quick fix and hope dev will see it :( @Andrew6rant

Andrew6rant commented 1 year ago

Stacker has a fundamental problem with the way I coded it - namely the fact that I didn't account for dedicated servers compared to integrated servers.

In earlier mod versions it wasn't too bad. I used Cloth Config as the config API (which was only built and meant for client use), so I had no protection against client-server desync if the configs did not match up. But in the switch from 1.18.1 to 1.18.2, or maybe it was 1.18.2 to 1.19, Minecraft changed the way blocks and items were registered - to be initialized on world load versus right at the start of the game. This I believe, is where the issue first popped up.

It isn't a quick fix to implement, but it is a necessary one. This was my second ever mod, and at the beginning I built it without really knowing what I was doing.

I don't have the time to dedicate to rewriting the mod at the moment, but I am planning on overhauling the whole system in the future.