diff options
author | Sphyix <masifede2@gmail.com> | 2021-11-21 12:58:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 12:58:56 +0100 |
commit | abeecd2da02c7d38cb1c5b6e2fd5517c6f8a994b (patch) | |
tree | 64c5960fc9a0e9c7a4bb368adfb6fa6e9b5aa071 /src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | |
parent | 01c243ee9f58c3f64fc883f931ad9a81813f894f (diff) | |
parent | 81f0b4801dfb0bd2d2a863e7a60f27af0daba463 (diff) | |
download | GT5-Unofficial-abeecd2da02c7d38cb1c5b6e2fd5517c6f8a994b.tar.gz GT5-Unofficial-abeecd2da02c7d38cb1c5b6e2fd5517c6f8a994b.tar.bz2 GT5-Unofficial-abeecd2da02c7d38cb1c5b6e2fd5517c6f8a994b.zip |
Merge branch 'GTNewHorizons:experimental' into experimental
Diffstat (limited to 'src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java')
-rw-r--r-- | src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index e1ec4c6459..6aa8d50b98 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -9,7 +9,6 @@ import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; @@ -36,7 +35,7 @@ import java.util.List; import static gregtech.api.util.GT_Utility.trans; -public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { +public class GT_NEI_AssLineHandler extends RecipeMapHandler { public static final int sOffsetX = 5; public static final int sOffsetY = 11; @@ -45,16 +44,9 @@ public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { GuiContainerManager.addTooltipHandler(new GT_RectHandler()); } - protected final GT_Recipe.GT_Recipe_Map mRecipeMap; - public GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {//this is called when recipes should be shown - this.mRecipeMap = aRecipeMap; + super(aRecipeMap); this.transferRects.add(new RecipeTransferRect(new Rectangle(138, 18, 18, 18), getOverlayIdentifier())); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } } public List<GT_Recipe> getSortedRecipes() { @@ -235,33 +227,39 @@ public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, 73, trans("152","Total: ") + GT_Utility.formatNumbers((long)tDuration * tEUt) + " EU", -16777216); - drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); + drawText(10, 73, trans("152","Total: ") + GT_Utility.formatNumbers((long) tDuration * tEUt) + " EU", 0xFF000000); + drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", 0xFF000000); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); + int voltage = tEUt / this.mRecipeMap.mAmperage; + byte tier = GT_Utility.getTier(voltage); + if (tier < 0 || tier >= 16) { + drawText(10, 93, trans("154", "Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU", 0xFFFF0000); + } else { + drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU (" + GT_Values.VN[tier] + ")", 0xFF000000); + } + drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), 0xFF000000); } else { - drawText(10, 93, trans("156","Voltage: unspecified"), -16777216); - drawText(10, 103, trans("157","Amperage: unspecified"), -16777216); + drawText(10, 93, trans("156","Voltage: unspecified"), 0xFF000000); + drawText(10, 103, trans("157","Amperage: unspecified"), 0xFF000000); } } if (tDuration > 0) { - drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), -16777216); + drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), 0xFF000000); } int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, 123, trans("159","Needs Low Gravity"), -16777216); + drawText(10, 123, trans("159","Needs Low Gravity"), 0xFF000000); } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, 123, trans("160","Needs Cleanroom"), -16777216); + drawText(10, 123, trans("160","Needs Cleanroom"), 0xFF000000); } else if (tSpecial == -201) { - drawText(10, 123, trans("206","Scan for Assembly Line"), -16777216); + drawText(10, 123, trans("206","Scan for Assembly Line"), 0xFF000000); } else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, 0xFF000000); } } else { int i = 0; for (String descLine : recipeDesc) { - drawText(10, 73 + 10 * i, descLine, -16777216); + drawText(10, 73 + 10 * i, descLine, 0xFF000000); i++; } } |