Skip to content

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.

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