State sorting in gui is wrong
Nightenom opened this issue ยท 8 comments
Prerequisites
- I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
- I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
- I made sure that this issue is not a duplicate of any existing issue.
Context
- Minecraft Version: 1.16.5
- MineColonies Version: latest
- Structurize Version: irrelevant
- Related Mods and their Versions:
Expected behavior
Result of #6692 is wrong, they are sorted at the end
Actual behavior
On should be at the top
Steps to reproduce the issue
- lumberjack wood type list
Logs
- latest.log:
- crashlog:
Notes
Viewers
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.
After writing the fix and reviewing the result I would like to argue that this is intentional behavior. For instance on the third page of the cook, all food items are enabled and I would like to quickly view the few that I've disabled.
I agree that for the lumberjack this isn't the desired behavior. But that would require a new variation where initially all items are checked but it does sort like an non-inverted list
We have exclusion and allowed filter afaik, so you need to distinguish between them, probably @Raycoms or someone else can say more
There is, and in the proposed fix I do use that.
if(!o1Allowed && o2Allowed){
if (isInverted)
return -1;
return 1;
}else if(o1Allowed && !o2Allowed){
if (isInverted)
return 1;
return -1;
}else{
return 0;
}
But in the following three screenshots you can see the cases I'm talking about. In my opinion the lumberjack and cook fuel are correct in the screenshots but the cook food is wrong.
I think this is fine, a perfect solution doesn't exist yet. Try to do a isInverted ? 1 : -1 btw, inline looks nicer in this case