diff options
author | miozune <miozune@gmail.com> | 2022-07-30 10:26:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-30 02:26:51 +0100 |
commit | 3c7af07285fbdbd038d0aa324ca8fa566ceb343d (patch) | |
tree | 4e84c0dc6999c4e15e65fd252e489a4afe08fbc9 /src/main/java | |
parent | f02ee6da60a1c8f009b0e9d294d25dde06437e41 (diff) | |
download | GT5-Unofficial-3c7af07285fbdbd038d0aa324ca8fa566ceb343d.tar.gz GT5-Unofficial-3c7af07285fbdbd038d0aa324ca8fa566ceb343d.tar.bz2 GT5-Unofficial-3c7af07285fbdbd038d0aa324ca8fa566ceb343d.zip |
Expose some of the NEI methods and fields to addons (#1159)
* Expose NEI description y offset so that large GUI from addons can fit in
* more protected
* more protected
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index 69ea959adc..35b0c49a2a 100644 --- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -60,7 +60,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { private static final int M = 1000000; private static final ConcurrentMap<GT_Recipe.GT_Recipe_Map, SortedRecipeListCache> CACHE = new ConcurrentHashMap<>(); - private Power mPower; + protected Power mPower; private String mRecipeName; // Name of the handler displayed on top private NEIHandlerAbsoluteTooltip mRecipeNameTooltip; private static final int RECIPE_NAME_WIDTH = 140; @@ -435,7 +435,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { } } - private String getSpecialInfo(int specialValue) { + protected String getSpecialInfo(int specialValue) { String specialInfo = null; if (specialValue == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { specialInfo = GT_Utility.trans("159", "Needs Low Gravity"); @@ -458,7 +458,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)); } - private String formatSpecialValue(int SpecialValue) { + protected String formatSpecialValue(int SpecialValue) { return this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers( (long) SpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost; @@ -487,7 +487,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { return "(MK " + tier + ")"; } - private boolean drawOptionalLine(int lineNumber, String line, String prefix) { + protected boolean drawOptionalLine(int lineNumber, String line, String prefix) { if (!(line == null || "unspecified".equals(line))) { drawLine(lineNumber, prefix + line); return true; @@ -495,7 +495,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { return false; } - private boolean drawOptionalLine(int lineNumber, String line) { + protected boolean drawOptionalLine(int lineNumber, String line) { if (!(line == null || "unspecified".equals(line))) { drawLine(lineNumber, line); return true; @@ -503,8 +503,12 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { return false; } - private void drawLine(int lineNumber, String line) { - drawText(10, 73 + lineNumber * 10, line, 0xFF000000); + protected void drawLine(int lineNumber, String line) { + drawText(10, getDescriptionYOffset() + lineNumber * 10, line, 0xFF000000); + } + + protected int getDescriptionYOffset() { + return 73; } public static class GT_RectHandler |