aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/nei
diff options
context:
space:
mode:
authoriouter <62897714+iouter@users.noreply.github.com>2022-01-07 12:36:06 +0800
committerGitHub <noreply@github.com>2022-01-07 12:36:06 +0800
commit0834d4b8b45a881f36ed5b295ac0fb38df49fa9a (patch)
tree6fb4a45cf17dd22748148417bc7bb0efb850cea3 /src/Java/gtPlusPlus/nei
parentea1439a4195c8f77c45625ea2593a232bf19984e (diff)
parent9b2e050151ad93170e84321d067d1e9d4ded4ba5 (diff)
downloadGT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.gz
GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.bz2
GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.zip
Merge branch 'GTNewHorizons:master' into master
Diffstat (limited to 'src/Java/gtPlusPlus/nei')
-rw-r--r--src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java264
-rw-r--r--src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java822
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java462
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java507
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java472
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java515
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java482
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java554
-rw-r--r--src/Java/gtPlusPlus/nei/NEI_GT_Config.java100
-rw-r--r--src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java44
-rw-r--r--src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java164
11 files changed, 0 insertions, 4386 deletions
diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
deleted file mode 100644
index ce2062d12c..0000000000
--- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package gtPlusPlus.nei;
-
-import java.awt.Rectangle;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import codechicken.lib.gui.GuiDraw;
-import codechicken.nei.PositionedStack;
-import codechicken.nei.recipe.TemplateRecipeHandler;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.gui.machine.GUI_DecayablesChest;
-import gtPlusPlus.core.handler.Recipes.DecayableRecipe;
-import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique;
-import gtPlusPlus.core.item.materials.DustDecayable;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.VanillaColours;
-import gtPlusPlus.nei.handlers.NeiTextureHandler;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-
-public class DecayableRecipeHandler extends TemplateRecipeHandler {
-
- public static final String mNEIName = "Decayables";
-
- public String getRecipeName() {
- return StatCollector.translateToLocal("GTPP.container.decaychest.name");
- }
-
- public String getGuiTexture() {
- return CORE.MODID + ":textures/gui/nei/decayables.png";
- }
-
- public Class<? extends GuiContainer> getGuiClass() {
- return GUI_DecayablesChest.class;
- }
-
- public String getOverlayIdentifier() {
- return "GTPP_Decayables";
- }
-
- public int recipiesPerPage() {
- return 1;
- }
-
- public void loadTransferRects() {
- this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), "GTPP_Decayables", new Object[0]));
- }
-
- public void loadCraftingRecipes(ItemStack result) {
- if (result == null || (!DustDecayable.class.isInstance(result.getItem())
- && !BaseItemDustUnique.class.isInstance(result.getItem()))) {
- return;
- }
- if (result != null) {
- //Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result));
- }
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- if (!GT_Utility.areStacksEqual(result, output, true)) {
- continue;
- }
- //Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result));
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- this.arecipes.add(rec);
- sort();
- }
- }
- }
-
- public void loadCraftingRecipes(String outputId, Object... results) {
- if (outputId.equals(getOverlayIdentifier()) && this.getClass() == DecayableRecipeHandler.class) {
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- this.arecipes.add(rec);
- sort();
- }
- }
- } else {
- super.loadCraftingRecipes(outputId, results);
- }
- }
-
- public void loadUsageRecipes(ItemStack ingredient) {
- final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes;
- if (ingredient != null) {
- //Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient));
- }
- for (final DecayableRecipe recipe : recipes) {
- if (recipe.isValid()) {
- final ItemStack input = recipe.mInput.copy();
- final ItemStack output = recipe.mOutput.copy();
- if (!GT_Utility.areStacksEqual(ingredient, input, true)) {
- continue;
- }
- //Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient));
- final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime);
- //rec.setIngredientPermutation((Collection) rec.input, ingredient);
- this.arecipes.add(rec);
- sort();
- }
- }
- }
-
- private final void sort() {
- List<DecayableRecipeNEI> g = new ArrayList<DecayableRecipeNEI>();
- for (CachedRecipe u : arecipes) {
- g.add((DecayableRecipeNEI) u);
- }
- if (g != null && !g.isEmpty()) {
- Collections.sort(g);
- }
- }
-
- public void drawExtras(int recipeIndex) {
- DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex);
-
- //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false);
-
- int cost = recipe.time;
- if (cost > 0) {
-
- // NEI Strings
- String s = I18n.format("GTPP.nei.info", new Object[] { cost });
- String s0 = I18n.format("GTPP.nei.timetaken", new Object[] { cost });
-
- // Time Strings
- String s1 = I18n.format("GTPP.time.ticks", new Object[] { cost });
- String s2 = I18n.format("GTPP.time.seconds", new Object[] { cost });
- String s3 = I18n.format("GTPP.time.minutes", new Object[] { cost });
- String s4 = I18n.format("GTPP.time.hours", new Object[] { cost });
- String s5 = I18n.format("GTPP.time.days", new Object[] { cost });
- String s6 = I18n.format("GTPP.time.months", new Object[] { cost });
- int y = 20;
-
- int secs = cost / 20;
- int mins = secs / 60;
- int hours = mins / 60;
- int days = hours / 24;
- int months = days / 30;
-
- String suffix;
- int formattedTime;
- if (cost <= 20) {
- suffix = s1;
- formattedTime = cost;
- } else if (cost <= (20 * 60)) {
- suffix = s2;
- formattedTime = secs;
- } else if (cost <= (20 * 60 * 60)) {
- suffix = s3;
- formattedTime = mins;
- } else if (cost <= (20 * 60 * 60 * 24)) {
- suffix = s4;
- formattedTime = hours;
- } else if (cost < (20 * 60 * 60 * 24 * 30)) {
- suffix = s5;
- formattedTime = days;
- } else if (cost <= (20 * 60 * 60 * 24 * 30)) {
- suffix = s6;
- formattedTime = months;
- } else {
- suffix = s1;
- formattedTime = cost;
- }
-
- int x = 5;
- GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false);
- GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false);
-
- GuiDraw.drawString(suffix, x + 16, y + 30, VanillaColours.DYE_BLACK.getAsInt(), false);
-
- //Values
- GuiDraw.drawString(("" + formattedTime), x, y + 30, VanillaColours.DYE_GREEN.getAsInt(), false);
-
- if (hours > 1) {
- int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60)));
- if (aLeftoverMinutes > 0) {
- int secs2 = aLeftoverMinutes / 20;
- int mins2 = secs2 / 60;
- GuiDraw.drawString(s3, x + 16, y + 42, VanillaColours.DYE_BLACK.getAsInt(), false);
- GuiDraw.drawString(("" + mins2), x, y + 42, VanillaColours.DYE_GREEN.getAsInt(), false);
-
- }
-
- }
-
- }
-
- NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true);
- }
-
- public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> {
- private PositionedStack input;
- private PositionedStack output;
- public int time;
-
- @Override
- public PositionedStack getIngredient() {
- return this.input;
- }
-
- public PositionedStack getResult() {
- return this.output;
- }
-
- public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) {
- super();
- this.input = new PositionedStack(input, 93, 24);
- this.output = new PositionedStack(result, 142, 42);
- this.time = time;
- }
-
- @Override
- public int compareTo(CachedRecipe o) {
- boolean b = DecayableRecipeNEI.class.isInstance(o);
- if (b) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) o;
- if (p.time > this.time) {
- return 1;
- } else if (p.time == this.time) {
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj != null) {
- if (DecayableRecipeNEI.class.isInstance(obj)) {
- DecayableRecipeNEI p = (DecayableRecipeNEI) obj;
- if (p != null) {
- // Time check first to keep it simple and not unbox the Recipes.
- if (p.time == this.time) {
- ItemStack aInput = p.input.item;
- ItemStack aOutput = p.output.item;
- if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) {
- if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) {
- return true;
- }
- }
- }
- }
-
- }
- }
- return false;
- }
-
-
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
deleted file mode 100644
index 2c00010a1a..0000000000
--- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java
+++ /dev/null
@@ -1,822 +0,0 @@
-package gtPlusPlus.nei;
-
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.util.*;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.common.event.FMLInterModComms;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import codechicken.lib.gui.GuiDraw;
-import codechicken.nei.PositionedStack;
-import codechicken.nei.guihook.GuiContainerManager;
-import codechicken.nei.guihook.IContainerInputHandler;
-import codechicken.nei.guihook.IContainerTooltipHandler;
-import codechicken.nei.recipe.*;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GTPP_NEI_DefaultHandler
-extends TemplateRecipeHandler {
- public static final int sOffsetX = 5;
- public static final int sOffsetY = 11;
-
- static {
- GuiContainerManager.addInputHandler(new GT_RectHandler());
- GuiContainerManager.addTooltipHandler(new GT_RectHandler());
- }
-
- protected final GT_Recipe_Map mRecipeMap;
-
- public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) {
- this.mRecipeMap = tMap;
- this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0]));
- 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 static void drawText(final int aX, final int aY, final String aString, final int aColor) {
- Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor);
- }
-
- @Override
- public TemplateRecipeHandler newInstance() {
- return new GTPP_NEI_DefaultHandler(this.mRecipeMap);
- }
-
-
- public List<GT_Recipe> getSortedRecipes() {
- List<GT_Recipe> result = new ArrayList<>(this.mRecipeMap.mRecipeList);
- Collections.sort(result);
- return result;
- }
-
- public void loadCraftingRecipes(String outputId, Object... results) {
- if (outputId.equals(getOverlayIdentifier())) {
- for (GT_Recipe tRecipe : getSortedRecipes()) {
- if (!tRecipe.mHidden) {
- this.arecipes.add(new CachedDefaultRecipe(tRecipe));
- }
- }
- } else {
- super.loadCraftingRecipes(outputId, results);
- }
- }
-
- public void loadCraftingRecipes(ItemStack aResult) {
- ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
-
- ArrayList<ItemStack> tResults = new ArrayList<ItemStack>();
- tResults.add(aResult);
- tResults.add(GT_OreDictUnificator.get(true, aResult));
- if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
- for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
- tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
- }
- }
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true);
- if (tFluid != null) {
- tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if (tData.fluid.isFluidEqual(tFluid)) {
- tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
- }
- }
- }
- for (GT_Recipe tRecipe : getSortedRecipes()) {
- if (!tRecipe.mHidden) {
- CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
- for (ItemStack tStack : tResults) {
- if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) {
- this.arecipes.add(tNEIRecipe);
- break;
- }
- }
- }
- }
- }
-
- public void loadUsageRecipes(ItemStack aInput) {
- ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
- ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>();
- tInputs.add(aInput);
- tInputs.add(GT_OreDictUnificator.get(false, aInput));
- if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
- for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
- tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
- }
- }
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
- if (tFluid != null) {
- tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if (tData.fluid.isFluidEqual(tFluid)) {
- tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
- }
- }
- }
- for (GT_Recipe tRecipe : getSortedRecipes()) {
- if (!tRecipe.mHidden) {
- CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
- for (ItemStack tStack : tInputs) {
- if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) {
- this.arecipes.add(tNEIRecipe);
- break;
- }
- }
- }
- }
- }
-
- @Override
- public String getOverlayIdentifier() {
- return this.mRecipeMap.mNEIName;
- }
-
- @Override
- public void drawBackground(final int recipe) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GuiDraw.changeTexture(this.getGuiTexture());
- GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78);
- }
-
- @Override
- public int recipiesPerPage() {
- return 1;
- }
-
- @Override
- public String getRecipeName() {
- return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName);
- }
-
- @Override
- public String getGuiTexture() {
- // return "gregtech:textures/gui/" + this.mRecipeMap.mUnlocalizedName + ".png";
- return this.mRecipeMap.mNEIGUIPath;
- }
-
- @Override
- public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
- final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
- if ((tObject instanceof CachedDefaultRecipe)) {
- final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
- for (final PositionedStack tStack : tRecipe.mOutputs) {
- if (aStack == tStack.item) {
- if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
- break;
- }
- currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
- break;
- }
- }
- for (final PositionedStack tStack : tRecipe.mInputs) {
- if (aStack == tStack.item) {
- if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) ||
- (tStack.item.stackSize != 0)) {
- break;
- }
- currenttip.add("Does not get consumed in the process");
- break;
- }
- }
- }
- return currenttip;
- }
-
- @Override
- public void drawExtras(final int aRecipeIndex) {
- final int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
- final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- if (tEUt != 0) {
- drawText(10, 73, "Total: " + (tDuration * tEUt) + " EU", -16777216);
- drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216);
- if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216);
- drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216);
- } else {
- drawText(10, 93, "Voltage: unspecified", -16777216);
- drawText(10, 103, "Amperage: unspecified", -16777216);
- }
- }
- if (tDuration > 0) {
- drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
- }
- if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
- drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216);
- }
- }
-
- public static class GT_RectHandler
- implements IContainerInputHandler, IContainerTooltipHandler {
- @Override
- public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
- if (this.canHandle(gui)) {
- if (button == 0) {
- return this.transferRect(gui, false);
- }
- if (button == 1) {
- return this.transferRect(gui, true);
- }
- }
- return false;
- }
-
- @Override
- public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
- return false;
- }
-
- public boolean canHandle(final GuiContainer gui) {
- return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/);
- }
-
- @Override
- public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) {
- if ((this.canHandle(gui)) && (currenttip.isEmpty())) {
- if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
- currenttip.add("Recipes");
- } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
- currenttip.add("Recipes");
- }*/
-
- }
- return currenttip;
- }
-
- private boolean transferRect(final GuiContainer gui, final boolean usage) {
- if (gui instanceof GT_GUIContainer_BasicMachine) {
- return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]));
- } /*else if (gui instanceof GT_GUIContainer_FusionReactor) {
- return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]));
- }*/
- return false;
- }
-
- @Override
- public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) {
- return currenttip;
- }
-
- @Override
- public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) {
- return currenttip;
- }
-
- @Override
- public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
- return false;
- }
-
- @Override
- public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) {
- }
-
- @Override
- public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
- }
-
- @Override
- public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) {
- }
-
- @Override
- public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
- return false;
- }
-
- @Override
- public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
- }
-
- @Override
- public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) {
- }
- }
-
- public class FixedPositionedStack
- extends PositionedStack {
- public final int mChance;
- public boolean permutated = false;
-
- public FixedPositionedStack(final Object object, final int x, final int y) {
- this(object, x, y, 0);
- }
-
- public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) {
- super(object, x, y, true);
- this.mChance = aChance;
- }
-
- @Override
- public void generatePermutations() {
- if (this.permutated) {
- return;
- }
- final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>();
- for (final ItemStack tStack : this.items) {
- if (GT_Utility.isStackValid(tStack)) {
- if (tStack.getItemDamage() == 32767) {
- final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
- if (!permutations.isEmpty()) {
- ItemStack stack;
- for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) {
- stack = i$.next();
- }
- } else {
- final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
- base.stackTagCompound = tStack.stackTagCompound;
- tDisplayStacks.add(base);
- }
- } else {
- tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack}));
- }
- }
- }
- this.items = (tDisplayStacks.toArray(new ItemStack[0]));
- if (this.items.length == 0) {
- this.items = new ItemStack[]{new ItemStack(Blocks.fire)};
- }
- this.permutated = true;
- this.setPermutationToRender(0);
- }
- }
-
- public class CachedDefaultRecipe
- extends TemplateRecipeHandler.CachedRecipe {
- public final GT_Recipe mRecipe;
- public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>();
- public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>();
-
- public CachedDefaultRecipe(final GT_Recipe aRecipe) {
- super();
- this.mRecipe = aRecipe;
-
- int tStartIndex = 0;
- switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount) {
- case 0:
- break;
- case 1:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- break;
- case 2:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- break;
- case 3:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- break;
- case 4:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
- }
- tStartIndex++;
- break;
- case 5:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
- }
- tStartIndex++;
- break;
- case 6:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
- }
- tStartIndex++;
- break;
- case 7:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
- }
- tStartIndex++;
- break;
- case 8:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32));
- }
- tStartIndex++;
- break;
- default:
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
- }
- tStartIndex++;
- if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
- this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32));
- }
- tStartIndex++;
- if