Fix creative mode item list filtering #223
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when container items are filtered in creative mode, the code responsible for filtering the contents of container items while in creative will unintentionally delete vanilla items from the container. This can be reproduced by going into survival, filling up a bundle with 1 vanilla item and 1 nova item, then going into creative and checking the item while in creative.
This is caused by the following code:
If
fromCreative
is set andisFakeItem
is false (i.e. the item is a vanilla item), nothing will be saved to the compound tag, and the item will be written as{}
. This causes the vanilla items to disappear.This pull request solves it by collapsing the if statement into
The comment states that collapsing the if statement will cause an isNovaItem call, but having the nova packet item be sent to a creative client will not cause the item on the server to be written as the client-side item due to the creative set-slot packet having its item changed to the real server-side item.