aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-08-19 12:39:39 +0200
committerTechnus <daniel112092@gmail.com>2017-08-19 12:39:39 +0200
commit9691334849b663924fa69a76c1c9ce2f1a2de330 (patch)
treef0347bf7872484e593d8eb117cd3b725aa1cf124 /src
parentb7ccb8ea92698415cf24965e2d77e8609a92391e (diff)
downloadGT5-Unofficial-9691334849b663924fa69a76c1c9ce2f1a2de330.tar.gz
GT5-Unofficial-9691334849b663924fa69a76c1c9ce2f1a2de330.tar.bz2
GT5-Unofficial-9691334849b663924fa69a76c1c9ce2f1a2de330.zip
Reciper adder works
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java5
-rw-r--r--src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java7
-rw-r--r--src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java6
-rw-r--r--src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java817
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/TT_recipe.java28
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java18
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java48
7 files changed, 907 insertions, 22 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java
index 8445e38f69..5b8dd80602 100644
--- a/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/DreamCraftRecipeLoader.java
@@ -1,11 +1,14 @@
package com.github.technus.tectech.loader;
+import com.github.technus.tectech.elementalMatter.definitions.cPrimitiveDefinition;
+import com.github.technus.tectech.recipe.TT_recipeAdder;
import com.github.technus.tectech.thing.CustomItemList;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
+import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -92,5 +95,7 @@ public class DreamCraftRecipeLoader implements Runnable {
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1000)
}, CustomItemList.holder_Hatch.get(1), 1200, 100000);
//endregion
+
+ TT_recipeAdder.addScannableEMcrafterRecipe(cPrimitiveDefinition.space__,100,100,3000,2,null,null,null, new ItemStack(Blocks.bedrock),30,30,3);
}
}
diff --git a/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java
index b488e29ee7..05f5018fdc 100644
--- a/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java
+++ b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java
@@ -7,11 +7,14 @@ import cpw.mods.fml.common.FMLCommonHandler;
public class NEI_TT_Config implements IConfigureNEI {//must be NEI*Config
public static boolean sIsAdded = true;
public static TT_NEI_ResearchHandler TT_RH;
+ public static TT_NEI_ScannerHandler TT_SH;
public void loadConfig() {
sIsAdded = false;
- if(FMLCommonHandler.instance().getEffectiveSide().isClient())
- TT_RH =new TT_NEI_ResearchHandler(TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes);
+ if(FMLCommonHandler.instance().getEffectiveSide().isClient()) {
+ TT_RH = new TT_NEI_ResearchHandler(TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes);
+ TT_SH = new TT_NEI_ScannerHandler(TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes);
+ }
sIsAdded = true;
}
diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
index f4a8ca8e7e..38a127900b 100644
--- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
+++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
@@ -86,7 +86,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(ItemStack aResult) {
ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
- ArrayList<ItemStack> tResults = new ArrayList();
+ ArrayList<ItemStack> tResults = new ArrayList<>();
tResults.add(aResult);
tResults.add(GT_OreDictUnificator.get(true, aResult));
if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
@@ -120,7 +120,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler {
public void loadUsageRecipes(ItemStack aInput) {
ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
- ArrayList<ItemStack> tInputs = new ArrayList();
+ ArrayList<ItemStack> tInputs = new ArrayList<>();
tInputs.add(aInput);
tInputs.add(GT_OreDictUnificator.get(false, aInput));
if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
@@ -322,7 +322,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler {
if (this.permutated) {
return;
}
- ArrayList<ItemStack> tDisplayStacks = new ArrayList();
+ ArrayList<ItemStack> tDisplayStacks = new ArrayList<>();
for (ItemStack tStack : this.items) {
if (GT_Utility.isStackValid(tStack)) {
if (tStack.getItemDamage() == 32767) {
diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java
new file mode 100644
index 0000000000..5ec6e18874
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java
@@ -0,0 +1,817 @@
+package com.github.technus.tectech.nei;
+
+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.GuiCraftingRecipe;
+import codechicken.nei.recipe.GuiRecipe;
+import codechicken.nei.recipe.GuiUsageRecipe;
+import codechicken.nei.recipe.TemplateRecipeHandler;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.auxiliary.Reference;
+import com.github.technus.tectech.recipe.TT_recipe;
+import cpw.mods.fml.common.event.FMLInterModComms;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.gui.GT_GUIContainer_FusionReactor;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+public class TT_NEI_ScannerHandler 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 TT_recipe.GT_Recipe_MapTT mRecipeMap;
+
+ public TT_NEI_ScannerHandler(TT_recipe.GT_Recipe_MapTT aRecipeMap) {
+ this.mRecipeMap = aRecipeMap;
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier()));
+ if (!NEI_TT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+"@" + getRecipeName() + "@" + getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
+
+ public List<GT_Recipe> getSortedRecipes() {
+ List<GT_Recipe> result = new ArrayList<>(this.mRecipeMap.mRecipeList);
+ Collections.sort(result);
+ return result;
+ }
+
+ public static void drawText(int aX, int aY, String aString, int aColor) {
+ Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor);
+ }
+
+ public TemplateRecipeHandler newInstance() {
+ NEI_TT_Config.TT_SH=new TT_NEI_ScannerHandler(mRecipeMap);
+ return NEI_TT_Config.TT_SH;
+ }
+
+ 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<>();
+ 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(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;
+ }
+ }
+ }
+ }
+ CachedDefaultRecipe tNEIRecipe;
+ }
+
+ public void loadUsageRecipes(ItemStack aInput) {
+ ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
+
+ ArrayList<ItemStack> tInputs = new ArrayList<>();
+ 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(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;
+ }
+ }
+ }
+ }
+ CachedDefaultRecipe tNEIRecipe;
+ }
+
+ public String getOverlayIdentifier() {
+ return this.mRecipeMap.mNEIName;
+ }
+
+ public void drawBackground(int recipe) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.changeTexture(getGuiTexture());
+ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78);
+ }
+
+ public int recipiesPerPage() {
+ return 1;
+ }
+
+ public String getRecipeName() {
+ return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName);
+ }
+
+ public String getGuiTexture() {
+// return "gregtech:textures/gui/" + this.mRecipeMap.mUnlocalizedName + ".png";
+ return this.mRecipeMap.mNEIGUIPath;
+ }
+
+ public List<String> handleItemTooltip(GuiRecipe gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) {
+ CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if ((tObject instanceof CachedDefaultRecipe)) {
+ CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (PositionedStack tStack : tRecipe.mOutputs) {
+ if (aStack == tStack.item) {
+ if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
+ break;
+ }
+ currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + "." + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
+ break;
+ }
+ }
+ for (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(trans("151","Does not get consumed in the process"));
+ break;
+ }
+ }
+ }
+ return currenttip;
+ }
+
+ public void drawExtras(int aRecipeIndex) {
+ int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
+ int computation = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc();
+ if (recipeDesc == null) {
+ int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
+ short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16);
+ if (tEUt != 0) {
+ drawText(10, 73, trans("152","Max Total: ") + ((1+((computation-minComputationPerSec)/minComputationPerSec)) * (long)tEUt * ampere * 20) + " EU", -16777216);
+ drawText(10, 83, trans("153","Usage: ") + ((long)tEUt*ampere) + " EU/t", -16777216);
+ if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
+ drawText(10, 93, trans("154","Voltage: ") + tEUt + " EU", -16777216);
+ drawText(10, 103, trans("155","Amperage: ") + ampere, -16777216);
+ } else {
+ drawText(10, 93, trans("156","Voltage: unspecified"), -16777216);
+ drawText(10, 103, trans("157","Amperage: unspecified"), -16777216);
+ }
+ }
+ drawText(10, 113, "Computation: "+computation, -16777216);
+ drawText(10, 123, "Min Computation: "+minComputationPerSec + " /s", -16777216);
+ } else {
+ int i = 0;
+ for (String descLine : recipeDesc) {
+ drawText(10, 73 + 10 * i, descLine, -16777216);
+ i++;
+ }
+ }
+ }
+
+ public static class GT_RectHandler
+ implements IContainerInputHandler, IContainerTooltipHandler {
+ public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
+ if (canHandle(gui)) {
+ if (button == 0) {
+ return transferRect(gui, false);
+ }
+ if (button == 1) {
+ return transferRect(gui, true);
+ }
+ }
+ return false;
+ }
+
+ public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
+ return false;
+ }
+
+ public boolean canHandle(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)));
+ }
+
+ public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
+ if ((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(GuiContainer gui, boolean usage) {
+ if (gui instanceof GT_GUIContainer_BasicMachine) {
+ return (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) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI));
+ } 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) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI));
+ }
+ return false;
+ }
+
+ public List<String> handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List<String> currenttip) {
+ return currenttip;
+ }
+
+ public List<String> handleItemTooltip(GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List<String> currenttip) {
+ return currenttip;
+ }
+
+ public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) {
+ return false;
+ }
+
+ public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {
+ }
+
+ public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
+ }
+
+ public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {
+ }
+
+ public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {
+ return false;
+ }
+
+ public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {
+ }
+
+ public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {
+ }
+ }
+
+ public static class FixedPositionedStack extends PositionedStack {
+ public final int mChance;
+ public boolean permutated = false;
+
+ public FixedPositionedStack(Object object, int x, int y) {
+ this(object, x, y, 0);
+ }
+
+ public FixedPositionedStack(Object object, int x, int y, int aChance) {
+ super(object, x, y, true);
+ this.mChance = aChance;
+ }
+
+ public void generatePermutations() {
+ if (this.permutated) {
+ return;
+ }
+ ArrayList<ItemStack> tDisplayStacks = new ArrayList<>();
+ for (ItemStack tStack : this.items) {
+ if (GT_Utility.isStackValid(tStack)) {
+ if (tStack.getItemDamage() == 32767) {
+ List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
+ if (!permutations.isEmpty()) {
+ ItemStack stack;
+ for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) {
+ stack = (ItemStack) i$.next();
+ }
+ } else {
+ ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
+ base.stackTagCompound = tStack.stackTagCompound;
+ tDisplayStacks.add(base);
+ }
+ } else {
+ tDisplayStacks.add(GT_Utility.copy(tStack));
+ }
+ }
+ }
+ this.items = tDisplayStacks.toArray(new ItemStack[0]);
+ if (this.items.length == 0) {
+ this.items = new ItemStack[]{new ItemStack(Blocks.fire)};
+ }
+ this.permutated = true;
+ setPermutationToRender(0);
+ }
+ }
+
+ public class CachedDefaultRecipe
+ extends CachedRecipe {
+ public final GT_Recipe mRecipe;
+ public final List<PositionedStack> mOutputs;
+ public final List<PositionedStack> mInputs;
+
+ public CachedDefaultRecipe(GT_Recipe aRecipe) {
+ super();
+ this.mRecipe = aRecipe;
+
+ mOutputs = new ArrayList<>();
+ mInputs = new ArrayList<>();
+
+ int tStartIndex = 0;
+ //switch (mRecipeMap.mUsualInputCount) {
+ //case 0:
+ // break;
+ //case 1:
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14+9));
+ }
+ //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 (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32));
+ // }
+ // tStartIndex++;
+ //}
+ if (aRecipe.mSpecialItems != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52));
+ }
+ //tStartIndex = 0;
+ //switch (mRecipeMap.mUsualOutputCount) {
+ //case 0:
+ // break;
+ //case 1:
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14+9, aRecipe.getOutputChance(tStartIndex)));
+ }
+ //tStartIndex++;
+ //break;
+ //case 2:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 3:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 4:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 5:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 6:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 7:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //case 8:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // break;
+ //default:
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ // if (aRecipe.getOutput(tStartIndex) != null) {
+ // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex)));
+ // }
+ // tStartIndex++;
+ //}
+ //if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) {
+ // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52));
+ // if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) {
+ // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52));
+ // }
+ //}
+ //if (aRecipe.mFluidOutputs.length > 1) {
+ // if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5));
+ // }
+ // if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5));
+ // }
+ // if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23));
+ // }
+ // if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23));
+ // }
+ // if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23));
+ // }
+ //} else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) {
+ // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52));
+ //}
+ }
+
+ public List<PositionedStack> getIngredients() {
+ return getCycledIngredients(cycleticks / 10, this.mInputs);
+ }
+
+ public PositionedStack getResult() {
+ return null;
+ }
+
+ public List<PositionedStack> getOtherStacks() {
+ return this.mOutputs;
+ }
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
index 5b18af2bb0..614d1d7220 100644
--- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
+++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
@@ -1,9 +1,10 @@
package com.github.technus.tectech.recipe;
import com.github.technus.tectech.auxiliary.TecTechConfig;
-import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack;
+import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition;
import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStackMap;
import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap;
+import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_Recipe;
import net.minecraft.item.ItemStack;
@@ -147,7 +148,8 @@ public class TT_recipe extends GT_Recipe {
}
public static class GT_Recipe_MapTT extends GT_Recipe.GT_Recipe_Map {
- public static GT_Recipe_MapTT sResearchableFakeRecipes =new GT_Recipe_MapTT(new HashSet(30), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1, 1, 0, 1, "", 1, "", true, false);//nei to false - using custom handler
+ public static GT_Recipe_MapTT sResearchableFakeRecipes =new GT_Recipe_MapTT(new HashSet<GT_Recipe>(32), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1,1,0,1,"", 1, "", true, false);//nei to false - using custom handler
+ public static GT_Recipe_MapTT sScannableFakeRecipes = new GT_Recipe_MapTT(new HashSet<GT_Recipe>(32),"gt.recipe.em_scanner","EM Scanner Research",(String)null,"gregtech:textures/gui/multimachines/ResearchFake",1,1,1,0,1,"",1,"",true,false);
public GT_Recipe_MapTT(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
@@ -174,9 +176,9 @@ public class TT_recipe extends GT_Recipe {
}
public static class TT_EMRecipe extends TT_recipe{
- public final cElementalDefinitionStack mResearchEM;
+ public final iElementalDefinition mResearchEM;
- public TT_EMRecipe(boolean aOptimize, cElementalDefinitionStack researchEM,
+ public TT_EMRecipe(boolean aOptimize, iElementalDefinition researchEM,
ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems,
FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue,
cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, AdditionalCheck check) {
@@ -184,7 +186,7 @@ public class TT_recipe extends GT_Recipe {
mResearchEM=researchEM;
}
- public TT_EMRecipe(boolean aOptimize, cElementalDefinitionStack researchEM,
+ public TT_EMRecipe(boolean aOptimize, iElementalDefinition researchEM,
ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems,
FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue,
cElementalDefinitionStackMap[] in) {
@@ -193,23 +195,27 @@ public class TT_recipe extends GT_Recipe {
}
public static class TT_Recipe_Map_EM<T extends TT_EMRecipe> {
- public static TT_Recipe_Map_EM<TT_EMRecipe> sCrafterRecipesEM = new TT_Recipe_Map_EM<>();
- public static TT_Recipe_Map_EM<TT_EMRecipe> sMachineRecipesEM = new TT_Recipe_Map_EM<>();
+ public static TT_Recipe_Map_EM<TT_EMRecipe> sCrafterRecipesEM = new TT_Recipe_Map_EM<>("EM Crafter Recipes","gt.recipe.em_crafter",null);
+ public static TT_Recipe_Map_EM<TT_EMRecipe> sMachineRecipesEM = new TT_Recipe_Map_EM<>("EM Machinert Recipe","gt.recipe.em_machinery",null);
- private final HashMap<cElementalDefinitionStack,T> mRecipeMap;
+ private final HashMap<iElementalDefinition,T> mRecipeMap;
+ public final String mNEIName,mUnlocalizedName,mNEIGUIPath;
- public TT_Recipe_Map_EM(){
+ public TT_Recipe_Map_EM(String mNEIName,String mUnlocalizedName,String mNEIGUIPath){
mRecipeMap =new HashMap<>(16);
+ this.mNEIName=mNEIName;
+ this.mUnlocalizedName=mUnlocalizedName;
+ this.mNEIGUIPath=mNEIGUIPath;
}
- public T findRecipe(cElementalDefinitionStack stack){
+ public T findRecipe(iElementalDefinition stack){
return mRecipeMap.get(stack);
}
public T findRecipe(ItemStack dataHandler){
if(dataHandler==null || dataHandler.stackTagCompound==null) return null;
try {
- return mRecipeMap.get(cElementalDefinitionStack.fromNBT(dataHandler.stackTagCompound.getCompoundTag(E_RECIPE_ID)));
+ return mRecipeMap.get(cElementalDefinition.fromNBT(dataHandler.stackTagCompound.getCompoundTag(E_RECIPE_ID)));
}catch (Exception e){
if (TecTechConfig.DEBUG_MODE) e.printStackTrace();
return null;
diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
index 57d5390af6..57f1b6c17e 100644
--- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
+++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
@@ -3,6 +3,8 @@ package com.github.technus.tectech.recipe;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack;
import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStackMap;
+import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition;
+import com.github.technus.tectech.thing.item.DefinitionContainer_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafter;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_machine;
import gregtech.api.enums.ItemList;
@@ -54,7 +56,7 @@ public class TT_recipeAdder extends GT_RecipeAdder {
}
for(ItemStack tItem : aInputs){
if(tItem==null){
- TecTech.Logger.error("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
+ TecTech.Logger.error("addEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
}
}
if(researchAmperage<=0) researchAmperage=1;
@@ -85,7 +87,7 @@ public class TT_recipeAdder extends GT_RecipeAdder {
}
public static boolean addScannableEMmachineRecipe(
- cElementalDefinitionStack aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage,
+ iElementalDefinition aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage,
ItemStack[] aInputs, FluidStack[] aFluidInputs, cElementalDefinitionStackMap[] eInputs,
ItemStack aOutput, int machineDuration, int machineEUt, int machineAmperage) {
if(aInputs==null)aInputs=nullItem;
@@ -95,21 +97,23 @@ public class TT_recipeAdder extends GT_RecipeAdder {
}
for(ItemStack tItem : aInputs){
if(tItem==null){
- TecTech.Logger.error("addAssemblingLineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
+ TecTech.Logger.error("addEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
}
}
if(researchAmperage<=0) researchAmperage=1;
else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE;
if(computationRequiredPerSec<=0) computationRequiredPerSec=1;
else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE;
- //todo replace //TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchEM}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_research.machine)}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16));
+ ItemStack placeholder=new ItemStack(DefinitionContainer_EM.INSTANCE);
+ DefinitionContainer_EM.setContent(placeholder,new cElementalDefinitionStackMap(new cElementalDefinitionStack(aResearchEM,1)));
+ TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes.addFakeRecipe(false, new ItemStack[]{placeholder}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_machine.machine)}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16));
TT_recipe.TT_Recipe_Map_EM.sMachineRecipesEM.add(new TT_recipe.TT_EMRecipe(false,aResearchEM,aInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Reads Research result")},
aFluidInputs,machineDuration,machineEUt,machineAmperage,eInputs));
return true;
}
public static boolean addScannableEMcrafterRecipe(
- cElementalDefinitionStack aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage,
+ iElementalDefinition aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage,
cElementalDefinitionStackMap[] eInputs, cElementalDefinitionStackMap[] catalyst, TT_recipe.AdditionalCheck check,
ItemStack aOutput, int crafterDuration, int crafterEUt, int crafterAmperage) {
if ((aResearchEM==null)||(totalComputationRequired<=0)||(aOutput == null)) {
@@ -119,7 +123,9 @@ public class TT_recipeAdder extends GT_RecipeAdder {
else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE;
if(computationRequiredPerSec<=0) computationRequiredPerSec=1;
else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE;
- //todo replace //TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchEM}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+GT_MetaTileEntity_EM_research.crafter)}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16));
+ ItemStack placeholder=new ItemStack(DefinitionContainer_EM.INSTANCE);
+ DefinitionContainer_EM.setContent(placeholder,new cElementalDefinitionStackMap(new cElementalDefinitionStack(aResearchEM,1)));
+ TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes.addFakeRecipe(false, new ItemStack[]{placeholder}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+GT_MetaTileEntity_EM_crafter.crafter)}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16));
TT_recipe.TT_Recipe_Map_EM.sCrafterRecipesEM.add(new TT_recipe.TT_EMRecipe(false,aResearchEM,null,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Reads Research result")},
null,crafterDuration,crafterEUt,crafterAmperage,eInputs,null,catalyst,check));
return true;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
index c1435de900..d0d41bdef0 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
@@ -1,8 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack;
+import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap;
+import com.github.technus.tectech.recipe.TT_recipe;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
@@ -18,6 +22,9 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc
* Created by danie_000 on 17.12.2016.
*/
public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
+ TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe;
+ private String machineType;
+ private long computationRemaining,computationRequired;
//region structure
private static final String[][] shape = new String[][]{
@@ -96,4 +103,45 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir);
}
}
+
+ @Override
+ public boolean EM_checkRecipe(ItemStack itemStack) {
+ eRecipe=null;
+ if(!eInputHatches.isEmpty() && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) {
+ cElementalInstanceStackMap researchEM = eInputHatches.get(0).getContainerHandler();
+ if(ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)) {
+ for(cElementalInstanceStack stackEM:researchEM.values()){
+ eRecipe = TT_recipe.TT_Recipe_Map_EM.sMachineRecipesEM.findRecipe(stackEM.definition);
+ if(eRecipe!=null) {
+ machineType=GT_MetaTileEntity_EM_machine.machine;
+ break;
+ }
+ eRecipe = TT_recipe.TT_Recipe_Map_EM.sCrafterRecipesEM.findRecipe(stackEM.definition);
+ if(eRecipe!=null) {
+ machineType=GT_MetaTileEntity_EM_crafter.crafter;
+ break;
+ }
+ }
+ if(eRecipe!=null){
+ computationRequired = computationRemaining = eRecipe.mDuration * 20L;
+ mMaxProgresstime = 20;
+ mEfficiencyIncrease = 10000;
+ eRequiredData = (short) (eRecipe.mSpecialValue >>> 16);
+ eAmpereFlow = (short) (eRecipe.mSpecialValue & 0xFFFF);
+ mEUt = eRecipe.mEUt;
+ eOutputHatches.get(0).getBaseMetaTileEntity().setActive(true);
+ return true;
+ }
+ }
+ }
+ computationRequired=computationRemaining=0;
+ mMaxProgresstime=0;
+ mEfficiencyIncrease = 0;
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
}