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

reduce number of if-statements in clientTick() #66

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

AdvancedWipe
Copy link
Contributor

  • reduce number of if-statements by refactoring statements in their own methods

* reduce number of if-statements by refactoring statements in their own methods
@what-the-diff
Copy link

what-the-diff bot commented Dec 6, 2022

  • The method openScreen() was renamed to openSquareSwitchScreen().
  • A new method called accept(boolean accepted) was added in ItemSwapperSharedMod class, which is used for the Confirm Screen when enabling shulkers.
  • In clientTick(), a new variable overlay of type Overlay and an if statement were added to check whether or not the keybind has been pressed down before calling onPress(overlay). If it hasn't, then we call closeScreen(xtOverlay), where xtOverlay is casted from overlay (which must be instanceof XTOverlya at this point). This closes any screen that's currently opened by setting Minecraft's current overlay as null using setter methods provided by Minecraft itself: getInstance().setOverLay();

@tr7zw tr7zw merged commit 67d0f3f into tr7zw:1.19 Dec 17, 2022
@AdvancedWipe AdvancedWipe deleted the cleanUp_clientTick branch January 6, 2023 19:23
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