-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add JEI text-button to see JEI Recipes ran at higher tiers #2468
Open
vrejhead
wants to merge
24
commits into
GregTechCEu:master
Choose a base branch
from
vrejhead:jei-overclocks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+329
−16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # src/main/java/gregtech/api/recipes/RecipeMapBuilder.java # src/main/java/gregtech/api/recipes/RecipeMaps.java # src/main/java/gregtech/integration/jei/recipe/GTRecipeWrapper.java
Make it work after merging in main
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Adds an interactable overclock text in JEI to see recipe EU/t and speed at different voltage tiers, clicking on the text changes the overclock tier.
Left clicking on the text increases the OC tier, while right clicking decreases it.
Both wrap around as necessary, with the max tier being specified below and min tier being the lowest tier the recipe will run at.
This PR also adds voltage colors to the JEI EU/t display.
Implementation Details
Adds a
JeiInteractableText
to handle the interactable text. RecipeMaps can disable this overclock button(such as research recipemaps or generator recipemaps) with the.disableJeiOverclockButton()
method on bothRecipeMapBuilder
andRecipeMap
.This PR currently only assumes 4xEUt/2xSpeed overclocking, with the exception of:
Currently this button only goes up to UIV if
highTier
is disabled, and MAX if it is enabled(maybe like "MAX+1" if MAX+ OC was implemented?)An exception is if
highTier
is disabled, but there is a recipe which is incorrectly registered as UXV or above, then for that recipe only the max overclocking button tier is the tier of the recipe(so you cannot change the overclocking tier at all, since min tier equals max tier in this case)Outcome
There is now a JEI button to "calculate" overclocks.
Currently the tooltip builder in
JeiInteractableButton
renders the tooltip below the ingredients, I currently don't know of any way to fix this. This should be fine for this PR since the button is at the bottom right, so no ingredients should overlay.These screenshots are with highTier enabled, without it, the max tier would be UIV
The position of the text is very sus because during click handling you aren't given the recipe height and width, which makes it impossible to align with respect to the south border(afaik
recipeWidth
is always 176, whilerecipeHeight
is variable), since differentRecipeMaps
have differentrecipeHeight
s. The spot avoids all recipes, while being far enough away from the south border than it is inside the border for allRecipeMaps
(top left has conflicts with assembly line, top right has conflicts with arc furnace)The base recipe
The recipe now only takes one tick
Because the UXV recipe took one tick, this is yellow since you are not gaining speed from the overclock(s)
After another click reaching MAX tier, the next left click will wrap around to LuV tier.
Potential Compatibility Issues
This has conflicts with #2432 . Don't think it would be too bad, just changing some ints to longs for this PR, only questionable one is
GTRecipeWrapper
though. Also likelyNonParallelSubtickOC
will be the default, instead of just yellow text.