diff options
Diffstat (limited to 'src/main/java/gtPlusPlus')
16 files changed, 88 insertions, 1644 deletions
diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index d714e9ba53..27dce789ae 100644 --- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -1,65 +1,21 @@ package gtPlusPlus.nei; -import java.awt.Rectangle; -import java.lang.ref.SoftReference; import java.util.*; -import java.util.stream.Collectors; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; +import gregtech.nei.GT_NEI_DefaultHandler; +import gtPlusPlus.core.util.minecraft.ItemUtils; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; import codechicken.nei.recipe.*; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.util.math.MathUtils; -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.FluidStack; - -public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { - - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - private SoftReference<List<CachedDefaultRecipe>> mCachedRecipes = null; - - private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - int[] aSlotX = new int[] {12, 30, 48}; - int[] aSlotY = new int[] {5, 23, 41, 64}; - // Input slots - int aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mInputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - // Output slots - aSlotX = new int[] {102, 120, 138}; - aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mOutputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - } - protected final GT_Recipe_Map mRecipeMap; +public class GTPP_NEI_DefaultHandler extends GT_NEI_DefaultHandler { 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])); + 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); @@ -67,855 +23,35 @@ public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { } } - 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 List<CachedDefaultRecipe> getCache() { - List<CachedDefaultRecipe> cache; - if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) { - cache = mRecipeMap.mRecipeList.stream() // do not use parallel stream. This is already parallelized by NEI - .filter(r -> !r.mHidden) - .sorted() - .map(temp -> {return createCachedRecipe(temp);}) - .collect(Collectors.toList()); - // while the NEI parallelize handlers, for each individual handler it still uses sequential execution model - // so we do not need any synchronization here - mCachedRecipes = new SoftReference<>(cache); - } - return cache; - } - - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new CachedDefaultRecipe(aRecipe); - } - - public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals(getOverlayIdentifier())) { - arecipes.addAll(getCache()); - } 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); - FluidStack tFluidStack; - if (tFluid != null) { - tFluidStack = tFluid; - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - } - else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult); - if (tFluidStack != null) { - tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); - } - for (CachedDefaultRecipe recipe : getCache()) { - if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) - arecipes.add(recipe); - } - } - - 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); - FluidStack tFluidStack; - if (tFluid != null) { - tFluidStack = tFluid; - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - } - else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput); - if (tFluidStack != null) { - tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); - } - for (CachedDefaultRecipe recipe : getCache()) { - if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) - arecipes.add(recipe); - } - } - - @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 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; - } + 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 (final PositionedStack tStack : tRecipe.mInputs) { + 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; + 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"); } - currenttip.add("Does not get consumed in the process"); - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final long tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, "Voltage: " + MathUtils.formatNumbers(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" : MathUtils.formatNumbers(0.05d * tDuration)) + " 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); - } - } - - @Deprecated - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return false; - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - 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, true); - } - - public FixedPositionedStack(final Object object, final int x, final int y, boolean aUnificate) { - this(object, x, y, 0, aUnificate); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - this(object, x, y, aChance, true); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance, boolean aUnificate) { - super(aUnificate ? GT_OreDictUnificator.getNonUnifiedStacks(object) : 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})); + 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"); } } } - 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; - handleSlots(); - } - - public void handleSlots() { - int tStartIndex = 0; - switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount) { - case 0: - break; - case 1: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 2: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 3: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 4: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 5: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 6: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 7: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - break; - case 8: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - break; - default: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 32)); - } - tStartIndex++; - } - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount) { - case 0: - break; - case 1: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 2: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 3: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 4: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 5: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 6: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 7: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 8: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - default: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - } - - - if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52)); - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52)); - } - } - if (mRecipe.mFluidOutputs.length > 1) { - if (mRecipe.mFluidOutputs[0] != null && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 120, 5, tUnificate)); - } - if (mRecipe.mFluidOutputs[1] != null && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 5, tUnificate)); - } - if (mRecipe.mFluidOutputs.length > 2 && mRecipe.mFluidOutputs[2] != null && (mRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 102, 23, tUnificate)); - } - if (mRecipe.mFluidOutputs.length > 3 && mRecipe.mFluidOutputs[3] != null && (mRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 120, 23, tUnificate)); - } - if (mRecipe.mFluidOutputs.length > 4 && mRecipe.mFluidOutputs[4] != null && (mRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 138, 23, tUnificate)); - } - } else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52, tUnificate)); - } - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GTPP_NEI_DefaultHandler.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } - } - - public class NoCellMultiDefaultRecipe extends CachedDefaultRecipe { - - public NoCellMultiDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - - } - - @Override - public void handleSlots() { - - int aInputItemsCount = this.mRecipe.mInputs.length; - int aInputFluidsCount = this.mRecipe.mFluidInputs.length; - int aOutputItemsCount = this.mRecipe.mOutputs.length; - int aOutputFluidsCount = this.mRecipe.mFluidOutputs.length; - int aInputSlotsUsed = 0; - int aOutputSlotsUsed = 0; - int aSlotToCheck = 0; - - // Special Slot - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - - /* - * Items - */ - - // Upto 9 Inputs Slots - if (aInputItemsCount > 0) { - if (aInputItemsCount > 9) { - aInputItemsCount = 9; - } - for (int i=0;i<aInputItemsCount;i++) { - int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); - int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getRepresentativeInput(aSlotToCheck++); - if (aRepStack != null) { - this.mInputs.add(new FixedPositionedStack(aRepStack, x, y)); - aInputSlotsUsed++; - } - } - } - aSlotToCheck = 0; - // Upto 9 Output Slots - if (aOutputItemsCount > 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - for (int i=0;i<aOutputItemsCount;i++) { - int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); - int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getOutput(aSlotToCheck); - if (aRepStack != null) { - this.mOutputs.add(new FixedPositionedStack(aRepStack, x, y, mRecipe.getOutputChance(aSlotToCheck), mRecipeMap.mNEIUnificateOutput)); - aOutputSlotsUsed++; - } - aSlotToCheck++; - } - } - - /* - * Fluids - */ - - // Upto 9 Fluid Inputs Slots - aSlotToCheck = aInputSlotsUsed; - if (aInputFluidsCount > 0) { - for (int i=0;i<aInputFluidsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[i], true), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - // Upto 9 Fluid Outputs Slots - aSlotToCheck = aOutputSlotsUsed; - if (aOutputFluidsCount > 0) { - for (int i=0;i<aOutputFluidsCount;i++) { - int x = mOutputSlotMap.get(aSlotToCheck).getKey(); - int y = mOutputSlotMap.get(aSlotToCheck).getValue(); - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[i], true), x, y, mRecipeMap.mNEIUnificateOutput)); - aSlotToCheck++; - aOutputSlotsUsed++; - } - } - } + return currenttip; } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java deleted file mode 100644 index 0578a96a97..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java +++ /dev/null @@ -1,101 +0,0 @@ -package gtPlusPlus.nei; - -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; - -public class GT_NEI_FlotationCell extends GTPP_NEI_DefaultHandler { - - public GT_NEI_FlotationCell() { - super(GTPP_Recipe_Map.sFlotationCellRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_FlotationCell(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new FlotationCellDefaultRecipe(aRecipe); - } - - public class FlotationCellDefaultRecipe extends CachedDefaultRecipe { - - public FlotationCellDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - - if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 30, 52)); - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 48, 52)); - } - } - - if (mRecipe.mFluidOutputs.length > 0) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52, tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 52, tUnificate)); - } - } - } - - } -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 29d28a9213..2ea0121ed9 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -1,16 +1,7 @@ package gtPlusPlus.nei; -import java.util.List; - -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { @@ -24,173 +15,32 @@ public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new ChemPlantDefaultRecipe(aRecipe); - } - - @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 ChemPlantDefaultRecipe)) { - final ChemPlantDefaultRecipe tRecipe = (ChemPlantDefaultRecipe) 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 (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isCatalyst(aStack)) { - currenttip.add("Does not always get consumed in the process"); - currenttip.add("Higher tier pipe casings allow this item to last longer"); - } - else if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } + protected String getSpecialInfo(int specialValue) { + String aTierMaterial = " - "; + if (specialValue <= 0) { + aTierMaterial += "Bronze"; } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + MathUtils.formatNumbers((tEUt / this.mRecipeMap.mAmperage)) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } + else if (specialValue == 1) { + aTierMaterial += "Steel"; } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); + else if (specialValue == 2) { + aTierMaterial += "Aluminium"; } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - int aTier = (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); - String aTierMaterial = " - "; - if (aTier <= 0) { - aTierMaterial += "Bronze"; - } - else if (aTier == 1) { - aTierMaterial += "Steel"; - } - else if (aTier == 2) { - aTierMaterial += "Aluminium"; - } - else if (aTier == 3) { - aTierMaterial += "Stainless Steel"; - } - else if (aTier == 4) { - aTierMaterial += "Titanium"; - } - else if (aTier == 5) { - aTierMaterial += "Tungsten Steel"; - } - else if (aTier == 6) { - aTierMaterial += "Laurenium"; - } - else if (aTier == 7) { - aTierMaterial += "Botmium"; - } - - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); + else if (specialValue == 3) { + aTierMaterial += "Stainless Steel"; } - } - - public class ChemPlantDefaultRecipe extends CachedDefaultRecipe { - - public ChemPlantDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); + else if (specialValue == 4) { + aTierMaterial += "Titanium"; } - - @Override - public void handleSlots() { - int tStartIndex = 0; - - // Four Input Slots - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 3, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 21, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 39, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 57, -4)); - } - tStartIndex++; - - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - - - //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (mRecipe.mFluidInputs.length >= 1) { - if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); - } - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); - } - if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); - } - if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); - } - } - - if (mRecipe.mFluidOutputs.length > 0) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5, tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23, tUnificate)); - } - } - + else if (specialValue == 5) { + aTierMaterial += "Tungsten Steel"; + } + else if (specialValue == 6) { + aTierMaterial += "Laurenium"; + } + else if (specialValue == 7) { + aTierMaterial += "Botmium"; } + return this.mRecipeMap.mNEISpecialValuePre + (specialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial; } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java index 02db84664d..82f6299bbb 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -1,15 +1,10 @@ package gtPlusPlus.nei; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; -public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { +public class GT_NEI_LFTR extends GT_NEI_MultiNoCell { public GT_NEI_LFTR() { super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes); @@ -21,18 +16,6 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new LFTRDefaultRecipe(aRecipe); - } - - @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, 89); - } - - @Override public void drawExtras(final int aRecipeIndex) { final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; @@ -41,79 +24,4 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216); } - - public class LFTRDefaultRecipe extends CachedDefaultRecipe { - - public LFTRDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - if (mRecipe.mFluidInputs.length > 0) { - if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5)); - } - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5)); - } - if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5)); - } - if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23)); - } - if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23)); - } - if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23)); - } - if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41)); - } - if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41)); - } - if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41)); - } - } - - tStartIndex = 0; - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.mFluidOutputs.length > 0) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41, mRecipe.getOutputChance(tStartIndex++), tUnificate)); - } - } - - } - - } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java deleted file mode 100644 index febca9e77f..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.nei; - -import java.util.List; - -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; - -public class GT_NEI_MillingMachine extends GTPP_NEI_DefaultHandler { - - public GT_NEI_MillingMachine() { - super(GTPP_Recipe_Map.sOreMillRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_MillingMachine(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new MillingDefaultRecipe(aRecipe); - } - - @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 (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isMillingBall(aStack)) { - currenttip.add("Does not always get consumed in the process"); - } - else if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - public class MillingDefaultRecipe extends CachedDefaultRecipe { - - public MillingDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - - - //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (mRecipe.mFluidInputs.length >= 1) { - if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); - } - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); - } - if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); - } - if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); - } - } - - if (mRecipe.mFluidOutputs.length > 0) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5, tUnificate)); - } - if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23, tUnificate)); - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java deleted file mode 100644 index 65e4c651c1..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java +++ /dev/null @@ -1,33 +0,0 @@ -package gtPlusPlus.nei; - -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gtPlusPlus.core.util.math.MathUtils; - -public class GT_NEI_MolecularTransformer extends GTPP_NEI_DefaultHandler { - - public GT_NEI_MolecularTransformer() { - super(GTPP_Recipe_Map.sMolecularTransformerRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_MolecularTransformer(); - } - - @Override - public void drawExtras(final int aRecipeIndex) { - GT_Recipe aRecipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; - final long tEUt = aRecipe.mEUt; - final long tDuration = aRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - drawText(10, 83, "Voltage: " + MathUtils.formatNumbers(tEUt) + " EU", -16777216); - } - if (tDuration > 0) { - drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); - } - } - -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java index 5fd6cc5b64..26d11e1803 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java @@ -1,16 +1,14 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - import org.lwjgl.opengl.GL11; import codechicken.lib.gui.GuiDraw; import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.math.MathUtils; +/** + * Used for larger GUI ("basicmachines/FissionFuel") + */ public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { public GT_NEI_MultiNoCell(GT_Recipe_Map aMap) { @@ -23,36 +21,14 @@ public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new NoCellMultiDefaultRecipe(aRecipe); - } - - @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, 89); } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; - } @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 90, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - drawText(10, 100, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); - } - if (tDuration > 0) { - drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 120, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } + protected int getDescriptionYOffset() { + return 85; } - } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java index fd611cbabe..8ea1dec802 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java @@ -1,7 +1,5 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.util.math.MathUtils; @@ -16,11 +14,6 @@ public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { public TemplateRecipeHandler newInstance() { return new GT_NEI_MultiSolarTower(mRecipeMap); } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; - } @Override public void drawExtras(final int aRecipeIndex) { @@ -30,7 +23,7 @@ public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { } drawText(5, 100, "Solar Heater rings boost tier", -16777216); drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216); - drawText(5, 120, "Input Amount = 1000 x T", -16777216); + drawText(5, 120, "Input Amount = 1000 x T", -16777216); } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java index 81755a1714..ea175f4ddb 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java @@ -1,47 +1,15 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import java.util.HashMap; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.item.ModItems; import net.minecraft.item.ItemStack; -public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { - - private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - int[] aSlotX = new int[] {12, 30, 48}; - int[] aSlotY = new int[] {5, 23, 41, 64}; - // Input slots - int aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mInputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - // Output slots - aSlotX = new int[] {102, 120, 138}; - aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mOutputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - } +public class GT_NEI_MultiTreeGrowthSimulator extends GT_NEI_MultiNoCell { public GT_NEI_MultiTreeGrowthSimulator() { super(GTPP_Recipe_Map.sTreeSimFakeRecipes); @@ -50,23 +18,6 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { @Override public TemplateRecipeHandler newInstance() { return new GT_NEI_MultiTreeGrowthSimulator(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new TreeSimDefaultRecipe(aRecipe); - } - - @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, 89); - } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; } @Override @@ -81,7 +32,7 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { @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)) { + if (tObject instanceof CachedDefaultRecipe) { final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; for (final PositionedStack tStack : tRecipe.mOutputs) { if (aStack == tStack.item) { @@ -89,7 +40,7 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { break; } if (ModItems.fluidFertBasic != null) { - currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided."); + currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided."); } break; } @@ -97,82 +48,4 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { } return currenttip; } - - public class TreeSimDefaultRecipe extends CachedDefaultRecipe { - - public TreeSimDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - - } - - @Override - public void handleSlots() { - - int aInputItemsCount = this.mRecipe.mInputs.length; - int aInputFluidsCount = this.mRecipe.mFluidInputs.length; - int aOutputItemsCount = this.mRecipe.mOutputs.length; - int aInputSlotsUsed = 0; - int aOutputSlotsUsed = 0; - int aSlotToCheck = 0; - - // Special Slot - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - - /* - * Items - */ - - // Upto 9 Inputs Slots - if (aInputItemsCount > 0) { - if (aInputItemsCount > 9) { - aInputItemsCount = 9; - } - for (int i=0;i<aInputItemsCount;i++) { - int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); - int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getRepresentativeInput(aSlotToCheck++); - if (aRepStack != null) { - this.mInputs.add(new FixedPositionedStack(aRepStack, x, y)); - aInputSlotsUsed++; - } - } - } - aSlotToCheck = 0; - // Upto 9 Output Slots - if (aOutputItemsCount > 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - for (int i=0;i<aOutputItemsCount;i++) { - int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); - int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getOutput(aSlotToCheck); - if (aRepStack != null) { - this.mOutputs.add(new FixedPositionedStack(aRepStack, x, y, mRecipe.getOutputChance(aSlotToCheck), tUnificate)); - aOutputSlotsUsed++; - } - aSlotToCheck++; - } - } - - /* - * Fluids - */ - aInputSlotsUsed = 9; - aSlotToCheck = aInputSlotsUsed; - if (aInputFluidsCount > 0) { - for (int i=0;i<aInputFluidsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[i], true), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - } - } - } diff --git a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java index e7f769b0b3..053eec139b 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java @@ -24,10 +24,7 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sOreMillRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMolecularTransformerRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); @@ -44,7 +41,7 @@ implements IConfigureNEI { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName); - new GTPP_NEI_DefaultHandler(tMap); + new GTPP_NEI_DefaultHandler(tMap); } else { Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); @@ -57,12 +54,6 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); new GT_NEI_FluidReactor(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMolecularTransformerRecipes.mNEIName); - new GT_NEI_MolecularTransformer(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sOreMillRecipes.mNEIName); - new GT_NEI_MillingMachine(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); - new GT_NEI_FlotationCell(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mNEIName); new GT_NEI_LFTR(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName); @@ -89,7 +80,7 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName); API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); - + Logger.INFO("NEI Registration: Registering NEI handler for "+GT_NEI_LFTR_Sparging.mNEIName); new GT_NEI_LFTR_Sparging(); diff --git a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java index 4e5c3e53ce..80589c6811 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -28,6 +28,8 @@ public class NEI_IMC_Sender { sendHandler("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835", 1); sendHandler("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751", 1); sendHandler("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); + sendHandler("gtpp.recipe.oremill", "gregtech:gt.blockmachines:31027", 1); + sendHandler("gtpp.recipe.flotationcell", "gregtech:gt.blockmachines:31028", 1); sendCatalyst("GTPP_Decayables", "miscutils:blockDecayablesChest"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index 57ee99ee2e..283d520a54 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -486,7 +486,9 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size(); Logger.INFO("Adding Tree Growth Simulation for " + aSapling.getDisplayName() + " -> " + (aLog == null ? "NULL" : aLog.getDisplayName())); ItemStack[] aOutput = new ItemStack[]{aLog, aSapling}; - GT_Recipe aRecipe = new GT_Recipe( + String aOutputs = ItemUtils.getArrayStackNames(aOutput); + Logger.INFO("" + aOutputs); + GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe( false, new ItemStack[]{aSapling.copy()}, aOutput, @@ -497,10 +499,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< 1, sRecipeID++, 0); - aRecipe.mOutputs = aOutput; - String aOutputs = ItemUtils.getArrayStackNames(aRecipe.mOutputs); - Logger.INFO("" + aOutputs); - GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe(false, aRecipe); return GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size() > aRecipes; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index a76322e4f4..1b6e623e91 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -12,6 +12,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + public class RecipeGen_MultisUsingFluidInsteadOfCells { @@ -158,7 +160,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { } // Add Recipe to map - GT_Recipe aNewRecipe = new GTPP_Recipe( + GT_Recipe aNewRecipe = new GTPP_Recipe.GTPP_Recipe_Map_MultiNoCell.GTPP_Recipe_MultiNoCell( false, aNewItemInputs, aNewItemOutputs, @@ -168,7 +170,8 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { aNewFluidOutputs, x.mDuration, x.mEUt, - x.mSpecialValue); + x.mSpecialValue); + aNewRecipe.owners = new ArrayList<>(x.owners); aOutputs.add(aNewRecipe); aRecipesHandled++; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index a09cbcce0d..de4f7fa49a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -56,7 +56,7 @@ public class RecipeLoader_LFTR { FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(200); //LiFBeF2ThF4UF4 - T3 - GT_Recipe LFTR1 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -77,7 +77,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4UF4 - T2 - GT_Recipe LFTR2 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -98,7 +98,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4U235 - T1 - GT_Recipe LFTR3 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -163,10 +163,6 @@ public class RecipeLoader_LFTR { new int[] { 1000, 1000, 1000, 1000, 1000 }); - - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR1); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR2); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR3); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 75e48a0c00..9574dbb42e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -518,8 +518,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { ArrayUtils.removeNulls(aInput); if (aInput.length <= 1) { return false; - } - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + } + + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe( true, aInput, aOutputStack, @@ -528,12 +531,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { new FluidStack[] { aInputFluid }, new FluidStack[] { aOutput }, Math.max(1, aDuration), - Math.max(1, aEUt), - aSpecialValue); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.add(aSpecialRecipe); + Math.max(1, aEUt), + aSpecialValue); aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); @@ -588,7 +587,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 }; final FluidStack outputs[] = { aOutput1, aOutput2 }; - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.addRecipe( aOptimise, new ItemStack[] {}, new ItemStack[] {}, @@ -597,12 +598,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { inputs, outputs, Math.max(1, aDuration), - Math.max(1, aEUt), - 0); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.add(aSpecialRecipe); + Math.max(1, aEUt), + 0); aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); if (aSize > aSize2) { @@ -1438,7 +1435,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel) { if (aInputs != null && aOutputs != null) { - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe( false, aInputs, aOutputs, @@ -1448,11 +1447,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aFluidOutputs, aDuration, aEUt, - aLevel); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(aSpecialRecipe); + aLevel); aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); return aSize > aSize2; } else { @@ -1506,8 +1501,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { CORE.crash(); } - - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe( false, aInputs, aOutputs, @@ -1517,11 +1513,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aFluidOutputs, time, (int) eu, - aTier); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.add(aSpecialRecipe); + aTier); aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); return aSize > aSize2; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java index b4cdf581ae..aeb937e78b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java @@ -31,7 +31,7 @@ public class GregtechSolarTower { 0).getStackForm(1L)); // NEI recipe - GTPP_Recipe aRecipe = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.addRecipe( false, null, null, @@ -42,8 +42,5 @@ public class GregtechSolarTower { 0, 0, 0); - GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.add(aRecipe); - - } } |
