Repository navigation
fix(26.2): open the editor on modded chest grids of any width - #13
Open
JosueM1109 wants to merge 1 commit into
Open
JosueM1109 wants to merge 1 commit into
JosueM1109 wants to merge 1 commit into
Conversation
Modded chests that use their own screen (Iron Chests and similar) never got the editor, and the grid math assumed every chest is 9 slots wide. - Detect modded chest screens by shape: one grid of 27 or more slots from a container that can store whitelists. Vanilla screens are matched as before. - Read the grid width from the open chest (9, 12, 14, ...) instead of a fixed 9 in ChestConfigManager and the editor. - Start player inventory keys at 1008 instead of 117 so a 126 slot chest does not overlap them (in memory only, no saved data changes). - Keep presets for non 9 wide chests in their own files. - Tall chests: move the toolbar into a column left of the GUI when it does not fit above. Wide chests: shrink the left panel to the space beside the GUI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Modded chests that open their own screen class never showed the editor, because it only attaches to vanilla chest screens. Bigger modded chests also broke the grid math, which assumed 9 columns everywhere. I ran into this with Iron Chests on a Fabric 26.2 server, where the larger tiers are 12 and 14 slots wide (up to 126 slots).
Changes (multiloader-26.2 only)
ContainerScreenhandling is unchanged.ChestConfigManagergetsgridColumns,gridRowandgridCol, and the editor, drag and preview code use them in place of the hardcoded 9.PLAYER_KEY_OFFSETgoes from 117 to 1008. With a 126 slot chest, slots 117 to 125 were read as player inventory keys. These keys only live in memory, so nothing saved changes.chest_preset_108x12_N.json), so a 12 wide preset never loads into a 9 wide chest.Testing
:common:testpasses (37 tests), including a newGridColumnsTestfor the 9, 12 and 14 wide math.Happy to split this up or change the approach if you'd rather handle modded screens another way.