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

Fix JEI Compat #62

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Fix JEI Compat #62

merged 2 commits into from
Jul 25, 2024

Conversation

ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Jul 21, 2024

Fixes JEI compat. ModularScreen.getCurrent() never returns the correct screen because JEI's screen wrapper is the current screen at the time of calling transferRecipe(), so a reference to the ModularScreen is stored in the container to be retrieved and checked.

@@ -46,6 +46,7 @@ public static ModularContainer getCurrent(EntityPlayer player) {
private final List<ModularSlot> slots = new ArrayList<>();
private final List<ModularSlot> shiftClickSlots = new ArrayList<>();
private ContainerCustomizer containerCustomizer;
private ModularScreen modularScreen = null;
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it can cause a crash on server side.

Copy link
Contributor Author

@ghzdude ghzdude Jul 21, 2024

Choose a reason for hiding this comment

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

how exactly? JEI's transferRecipe() is only called on client side, and if it was called server side it would return false for the instanceof check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm i think i see what you mean

@brachy84 brachy84 merged commit c5e01c3 into CleanroomMC:master Jul 25, 2024
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