Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CraftingTweaks compatibility #5277

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

paypur
Copy link
Contributor

@paypur paypur commented Nov 17, 2024

#5004

quick demo

untitled.mp4


@Override
public boolean handles(AbstractContainerMenu menu) {
return menu instanceof CraftingStationContainerMenu;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't menu have a getType() method we can use instead of doing an instanceof check? Feels more appropriate to do so, and it would be faster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out, crafting tweaks crashes if you use getType in this context on certain screens, guess not every menu supports that function (blame dumb mojang design). So guess the old code is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which scenarios did it crash?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening the inventory, might have been creative inventory specific

@KnightMiner KnightMiner added Mod interaction Issue only happens when another mod is loaded Technical Pull requests making changes to workspace or targeted versions 1.19 Issue affects 1.19 labels Nov 27, 2024
@KnightMiner
Copy link
Member

Tested and it works fine, though apparently my earlier suggestion is wrong due to how crafting tweaks works so will need to be reverted to what you had before. After that this should be ready to merge.

@KnightMiner KnightMiner merged commit 4c3d379 into SlimeKnights:1.19.2 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.19 Issue affects 1.19 Mod interaction Issue only happens when another mod is loaded Technical Pull requests making changes to workspace or targeted versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants