diff options
Diffstat (limited to 'src')
8 files changed, 151 insertions, 5 deletions
diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java index ec7bf42a35..bcbbb93007 100644 --- a/src/Java/gregtech/api/util/GTPP_Recipe.java +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -411,6 +411,7 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multicentrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multielectro", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); public static final GTPP_Recipe_Map_Internal sChemicalPlant_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map_Internal sMultiblockMixerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multimixer", "Multiblock Mixer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 12, 9, 0, 0, 1, "", 0, "", false, true); //Semi-Fluid Fuel Map public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.semifluidgeneratorfuels", "Semifluid Generator Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index eb51c0332e..7432c1905d 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -309,7 +309,7 @@ public class GTplusplus implements ActionListener { 0, 0, 0 }; int[] mInvalidCount = new int[]{ - 0, 0, 0 + 0, 0, 0, 0 }; int[] mOriginalCount = new int[]{ 0, 0, 0 @@ -330,6 +330,9 @@ public class GTplusplus implements ActionListener { mInvalidCount[2] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( GT_Recipe.GT_Recipe_Map.sVacuumRecipes, GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT ); + mInvalidCount[3] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( + GT_Recipe.GT_Recipe_Map.sMixerRecipes, GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT + ); /* //Large Centrifuge generation diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 589e45ad90..07bd7ef46c 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -27,6 +27,7 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mUnlocalizedName); // Custom Recipe Maps /*Logger.INFO("NEI Registration: "+CustomRecipeMap.sMappings.size()+" CustomRecipeMaps"); @@ -77,8 +78,10 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName); new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mNEIName); - new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); - + new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName); + new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName); API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); diff --git a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java index fb815ca063..461678dd7a 100644 --- a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -14,6 +14,7 @@ public class NEI_IMC_Sender { setNBTInfoAndSendIt("gtpp.recipe.cokeoven", "gregtech:gt.blockmachines:791"); setNBTInfoAndSendIt("gtpp.recipe.semifluidgeneratorfuels", "gregtech:gt.blockmachines:837"); setNBTInfoAndSendIt("gtpp.recipe.fishpond", "gregtech:gt.blockmachines:829"); + setNBTInfoAndSendIt("gtpp.recipe.multimixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.advanced.mixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.cryogenicfreezer", "gregtech:gt.blockmachines:910"); setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index f9e87b07fb..a88fbc0d66 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import gregtech.api.gui.GT_GUICover; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; @@ -9,6 +10,10 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; +import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.enums.GT_Values; +import gregtech.api.net.GT_Packet_TileEntityCover; + public class GTPP_Cover_Overflow extends GT_CoverBehavior { @@ -134,4 +139,109 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } + + //GUI + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GTPP_Cover_Overflow.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private GT_GuiIntegerTextBox tBox; + private int coverVariable; + + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; + + private boolean warn = false; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 0 + 8, spaceX * 4 - 3, 12); + tBox.setText(String.valueOf(this.coverVariable)); + tBox.setMaxStringLength(10); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + tBox.setFocused(true); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.getFontRenderer().drawString(trans("010", "L"), startX + spaceX * 4, 4 + startY + spaceY * 0 + 8, 0xFF555555); + if (warn) + this.getFontRenderer().drawString(trans("011","Max")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("010", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xffff0000); + else + this.getFontRenderer().drawString(trans("011","Now")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("010", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xFF555555); + } + @Override + public void onMouseWheel(int x, int y, int delta) { + for (GT_GuiIntegerTextBox box : textBoxes){ + if (box.isFocused()) { + int step = Math.max(1, Math.abs(delta / 120)); + step = (isShiftKeyDown() ? 50 : isCtrlKeyDown() ? 5 : 1) * (delta > 0 ? step : -step); + long i; + try { + i = Long.parseLong(box.getText()); + } catch (NumberFormatException e) { + return; + } + if (i > (Long.MAX_VALUE-1000)) + break; + + i = i + step; + if (i <= 0) + i = 0; + box.setText(String.valueOf(i)); + break; + } + } + } + + @Override + public void applyTextBox(GT_GuiIntegerTextBox box) { + long i; + String s = box.getText().trim(); + try { + i = Long.parseLong(s); + } catch (NumberFormatException e) { + resetTextBox(box); + return; + } + + warn = false; + if (box.id == 2) { + if (i > (long) mMaxTransferRate) { + i = mMaxTransferRate; + warn = true; + } else if (i < 0) { + i = 0; + } + coverVariable = (int) i; + } + box.setText(String.valueOf(i)); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + + @Override + public void resetTextBox(GT_GuiIntegerTextBox box) { + if (box.id == 2) + box.setText(String.valueOf(coverVariable)); + } + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java index 71fe2be50c..99d6ec5b1c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java @@ -194,7 +194,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sMixerRecipes; + return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index b94dbfa51f..90d7aaa806 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -93,7 +93,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { if (aFoundFluid == null) { for (ItemStack aBadStack : mItemsToIgnore) { if (doesItemMatchIgnoringStackSize(aInputStack, aBadStack)) { - continue recipe; // Skip this recipe entirely if we find an item we don't like + continue recipe; // Skip this recipe entirely if we find an item we don't like } } if (!isEmptyCell(aInputStack)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 1f41bf84e3..0b4649e414 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -785,6 +785,34 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } + public boolean addMultiblockMixerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial){ + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { + return false; + } + if (!ItemUtils.checkForInvalidItems(aInputs, aOutputs)) { + Logger.INFO("[Recipe] Error generating Large Mixer recipe."); + Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs)); + Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aFluidInputs)); + Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs)); + Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs)); + return false; + } + + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.addRecipe(aRecipe); + return true; + } + public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2) { if (aInput1 instanceof String || aInput2 instanceof String) { int mCompleted = 0; |