Skip to content

Fixed swapping stacks of the same item if the end stack is at max stack size#64

Open
CorranEveryone wants to merge 3 commits intoyannis300307:mainfrom
CorranEveryone:main
Open

Fixed swapping stacks of the same item if the end stack is at max stack size#64
CorranEveryone wants to merge 3 commits intoyannis300307:mainfrom
CorranEveryone:main

Conversation

@CorranEveryone
Copy link

All I added is an if statement to the item swapping code, preventing it from swapping if the end stack is already at max.
I tested this on my N0120 and it works fine (I did encounter trial and error but I got it working in the end).

Also yes, I did make sure to include this fix in both the in same inventory item swapping and different inventory item swapping.

@yannis300307
Copy link
Owner

Thank you for your contribution! I can't test the code this week but I will look into your PR as soon as I am available.

@CorranEveryone
Copy link
Author

Sounds good

@yannis300307
Copy link
Owner

Hello, I reviewed your PR. The issue I have with this change is that swapping a slot with a maxed other can be voluntary when the player sorts its inventory. Also, this PR breaks the swapping of 2 maxed stacks with different types. Tell me back if you really think that this feature must be added and in which case the previous behavior can be a problem.

@CorranEveryone
Copy link
Author

I didn't catch that bug. This is how it works in the original version of the game.

@yannis300307
Copy link
Owner

I personally think that this behavior should remain the same. My goal is not to reproduce Minecraft at 1:1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants