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

Eliminate complicated redundancy in renderTickEvent #54

Merged
merged 3 commits into from
Mar 3, 2018

Conversation

elifoster
Copy link
Contributor

Move the Gui checking to its own method, as it is used twice. This will make it easier to support additional Gui types (thinking about #38), and if necessary fix issues in the future with it because it will require one change rather than two identical changes.
Move the copying code to its own method, because it is a very long string of method calls. copyString is a much more readable way of thinking about it if you do not care about how the string is copied.
Switch the isCtrlKeyDown check to be non-inversed, since it is easier to think about that else clause that way.

elifoster and others added 2 commits March 1, 2018 12:54
Move the Gui checking to its own method, as it is used twice. This will make it easier to support additional Gui types (thinking about xbony2#38), and if necessary fix issues in the future with it because it will require one change rather than two identical changes.
Move the copying code to its own method, because it is a very long string of method calls. copyString is a much more readable way of thinking about it if you do not care about *how* the string is copied.
Switch the isCtrlKeyDown check to be non-inversed, since it is easier to think about that else clause that way.
trying really hard to not change everything into groovy syntax
* empty ItemStack.
*/
@Nonnull
private ItemStack getHoveredItemStack(){
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, I think these would be better in the Utils class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I thought about it but wasn't totally sure.

@xbony2 xbony2 merged commit 6831b49 into xbony2:master Mar 3, 2018
@elifoster elifoster deleted the cleanup-renderTickEvent branch March 4, 2018 02:43
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