aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-29 16:04:28 +0200
committerGitHub <noreply@github.com>2022-08-29 16:04:28 +0200
commit7d1f51a8937e0a86486267437d444696e81e8aa0 (patch)
treea5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
parent5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff)
downloadGT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2
GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip
Buildscript + Spotless (#318)
* Convert AES.java to readable class * Buildscript * Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java')
-rw-r--r--src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java86
1 files changed, 45 insertions, 41 deletions
diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
index 27dce789ae..f080a0bf44 100644
--- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
+++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
@@ -1,57 +1,61 @@
package gtPlusPlus.nei;
-import java.util.*;
-
-import gregtech.nei.GT_NEI_DefaultHandler;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.*;
import cpw.mods.fml.common.event.FMLInterModComms;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.*;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.nei.GT_NEI_DefaultHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import java.util.*;
import net.minecraft.item.ItemStack;
public class GTPP_NEI_DefaultHandler extends GT_NEI_DefaultHandler {
- public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) {
- super(tMap);
- if (!NEI_GT_Config.sIsAdded) {
- FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
- GuiCraftingRecipe.craftinghandlers.add(this);
- GuiUsageRecipe.usagehandlers.add(this);
- }
- }
+ public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) {
+ super(tMap);
+ if (!NEI_GT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(
+ GT_Values.GT,
+ "NEIPlugins",
+ "register-crafting-handler",
+ "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GTPP_NEI_DefaultHandler(this.mRecipeMap);
- }
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GTPP_NEI_DefaultHandler(this.mRecipeMap);
+ }
- @Override
- public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) {
- super.handleItemTooltip(gui, aStack, currenttip, aRecipeIndex);
- CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
- if (tObject instanceof CachedDefaultRecipe) {
- CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
- for (PositionedStack tStack : tRecipe.mOutputs) {
- // no-op
- }
- for (PositionedStack tStack : tRecipe.mInputs) {
- if (aStack == tStack.item) {
- if (ItemUtils.isMillingBall(aStack)) {
- currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
- currenttip.add("Does not always get consumed in the process");
- }
- if (ItemUtils.isCatalyst(aStack)) {
- currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
- currenttip.add("Does not always get consumed in the process");
- currenttip.add("Higher tier pipe casings allow this item to last longer");
- }
- }
- }
- }
+ @Override
+ public List<String> handleItemTooltip(
+ GuiRecipe<?> gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) {
+ super.handleItemTooltip(gui, aStack, currenttip, aRecipeIndex);
+ CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if (tObject instanceof CachedDefaultRecipe) {
+ CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (PositionedStack tStack : tRecipe.mOutputs) {
+ // no-op
+ }
+ for (PositionedStack tStack : tRecipe.mInputs) {
+ if (aStack == tStack.item) {
+ if (ItemUtils.isMillingBall(aStack)) {
+ currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
+ currenttip.add("Does not always get consumed in the process");
+ }
+ if (ItemUtils.isCatalyst(aStack)) {
+ currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process"));
+ currenttip.add("Does not always get consumed in the process");
+ currenttip.add("Higher tier pipe casings allow this item to last longer");
+ }
+ }
+ }
+ }
- return currenttip;
- }
+ return currenttip;
+ }
}