diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
5 files changed, 80 insertions, 68 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index ca9fffbeb3..d0e04fccc8 100644 --- a/src/Java/gtPlusPlus/core/handler/BookHandler.java +++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java @@ -77,8 +77,8 @@ public class BookHandler { //20/21/22 book_MultiMachineManual = writeBookTemplate( "Manual_Multi_Machine", "Multi Machine Manual", "Alkalus", - new String[] {"This Multiblock, depending upon the casings used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.", - "The Mode for the controller can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.", + new String[] {"This Multiblock, depending upon the mode used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.", + "The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.", "[Metal Work] Mode A - Allows the multiblock to function as a Compressor, a Lathe or an Electro-Magnet. To allow a hatch to run in Compressor mode, insert a No. 20 circuit. For Lathe, use No. 21 and for Electro-Magnet use No. 22.", "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Distillery or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Distillery, use No. 21 and for Extractor use No. 22.", "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, a Replicator or an Autoclave. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Replicator use No. 22.", diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 0481bd23bd..8066409baf 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.*; import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; +import gtPlusPlus.core.item.base.foil.BaseItemFoil; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.base.gears.BaseItemSmallGear; @@ -221,42 +222,42 @@ public final class ModItems { public static Fluid fluidFLiBeSalt; + + //Possibly missing base items that GT may be missing. public static Item itemSmallWroughtIronGear; public static Item itemPlateLithium; - public static BaseItemPlate itemPlateEuropium; - public static BaseItemPlateDouble itemDoublePlateEuropium; + public static Item itemPlateEuropium; + public static Item itemPlateVanadium; + public static Item itemDoublePlateEuropium; + public static Item itemFoilUranium235; - public static ItemBoilerChassis itemBoilerChassis; - public static ItemDehydratorCoilWire itemDehydratorCoilWire; - public static ItemDehydratorCoil itemDehydratorCoil; + public static Item itemBoilerChassis; + public static Item itemDehydratorCoilWire; + public static Item itemDehydratorCoil; public static Item itemLavaFilter; public static Item itemAirFilter; public static Item itemCoalCoke; - public static CoreItem itemCircuitLFTR; + public static Item itemCircuitLFTR; public static Item itemDebugAreaClear; public static Item itemGemShards; - public static Item itemHalfCompleteCasings; - public static Item itemPlateVanadium; - public static Item itemSulfuricPotion; public static Item itemHydrofluoricPotion; public static Item itemModularBauble; public static Item itemCustomBook; - + public static Item itemGrindleTablet; - public static Item itemRope; public static Item itemFiber; - public static Item itemDragonJar; + static { Logger.INFO("Items!"); @@ -657,6 +658,11 @@ public final class ModItems { itemDoublePlateClay = new BaseItemPlateDouble(MaterialUtils.generateMaterialFromGtENUM(Materials.Clay)); } + //Need this for Mutagenic Frames + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilUranium235", 1) == null){ + itemFoilUranium235 = new BaseItemFoil(ELEMENT.getInstance().URANIUM235); + } + //A small gear needed for wizardry. if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null){ itemSmallWroughtIronGear = new BaseItemSmallGear(MaterialUtils.generateMaterialFromGtENUM(Materials.WroughtIron)); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 57e5a999da..662f6433aa 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -227,6 +227,7 @@ public class BaseItemComponent extends Item{ BOLT("Bolt", " Bolt", "bolt"), ROTOR("Rotor", " Rotor", "rotor"), RING("Ring", " Ring", "ring"), + FOIL("Foil", " Foil", "foil"), PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma"), CELL("Cell", " Cell", "cell"), NUGGET("Nugget", " Nugget", "nugget"), diff --git a/src/Java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java b/src/Java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java new file mode 100644 index 0000000000..3e2816bf52 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/foil/BaseItemFoil.java @@ -0,0 +1,11 @@ +package gtPlusPlus.core.item.base.foil; + +import gtPlusPlus.core.item.base.BaseItemComponent; +import gtPlusPlus.core.material.Material; + +public class BaseItemFoil extends BaseItemComponent{ + + public BaseItemFoil(final Material material) { + super(material, BaseItemComponent.ComponentTypes.FOIL); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMultiMachine.java index 9fd0e92167..f3aba8c5d5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -221,7 +221,7 @@ extends GregtechMeta_MultiBlockBase { } private final AutoMap<ItemStack> mReplicatorOutputMap = new AutoMap<ItemStack>(); - + @Override public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, @@ -406,24 +406,20 @@ extends GregtechMeta_MultiBlockBase { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - //Get Circuit info for this recipe. - ItemStack tCircuit = getCircuit(aItemInputs); - int tCircuitID = getCircuitID(tCircuit); - if (canBufferOutputs(aItemInputs, aMaxParallelRecipes)) { - Logger.WARNING("BAD RETURN - 2"); + Logger.WARNING("BAD RETURN - 2.0"); return false; } ItemStack tDataOrb = null; ItemStack tCellStack = null; ItemStack tReplicatedItem; - FluidStack tOutputFluid; - FluidStack tInputFluid; + FluidStack tOutputFluid = null; + FluidStack tInputFluid = null; final Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); final long tMass = tMaterial.getMass(); - //Find First Data Orb with Scan Data + // Find First Data Orb with Scan Data for (ItemStack I : aItemInputs) { if (ItemList.Tool_DataOrb.isStackEqual((Object) I, false, true) && Behaviour_DataOrb.getDataTitle(I).equals("Elemental-Scan")) { tDataOrb = I.copy(); @@ -431,7 +427,7 @@ extends GregtechMeta_MultiBlockBase { } } - //Find First empty cell stack + // Find First empty cell stack for (ItemStack I : aItemInputs) { if (ItemList.Cell_Empty.isStackEqual((Object) I)) { tCellStack = I.copy(); @@ -439,7 +435,7 @@ extends GregtechMeta_MultiBlockBase { } } - //Find UUM + // Find UUM for (FluidStack F : aFluidInputs) { if (F != null && F.isFluidEqual(Materials.UUMatter.getFluid(1L))) { final FluidStack tFluid = F; @@ -449,33 +445,18 @@ extends GregtechMeta_MultiBlockBase { } } - //No Data Orb or UUM found? + // No Data Orb or UUM found? if (tDataOrb == null || tInputFluid == null) { return false; } - //Temp Values + // Temp Values int tEUt = (int) GT_Values.V[(int) this.getInputTier()]; int tMaxProgresstime = (int) (tMass * 512L / (1 << tTier - 1)); float tRecipeEUt = (tEUt * aEUPercent) / 100.0f; float tTotalEUt = 0.0f; int parallelRecipes = 0; ItemStack[] expectedInputs = {tDataOrb}; - FluidStack[] expectedFluidInputs = {Materials.UUMatter.getFluid(tMass)}; - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { - if (!isRecipeInputEqual(true, aFluidInputs, aItemInputs, expectedFluidInputs, expectedInputs)) { - Logger.WARNING("Broke at "+parallelRecipes+"."); - break; - } - Logger.WARNING("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); - tTotalEUt += tRecipeEUt; - } - - if (parallelRecipes == 0) { - Logger.WARNING("BAD RETURN - 3"); - return false; - } - + FluidStack[] expectedFluidInputs = {Materials.UUMatter.getFluid(tMass)}; /** * Magic @@ -484,46 +465,60 @@ extends GregtechMeta_MultiBlockBase { int COST_UUM = 0; int COST_CELLS = 0; - //Determine Output Item + // Determine Output Item & Cost. if ((tReplicatedItem = GT_OreDictUnificator.get(OrePrefixes.dust, (Object) tMaterial, 1L)) == null) { if ((tReplicatedItem = GT_OreDictUnificator.get(OrePrefixes.cell, (Object) tMaterial, 1L)) != null) { if ((tOutputFluid = GT_Utility.getFluidForFilledItem(tReplicatedItem, true)) == null) { - if (ItemList.Cell_Empty.isStackEqual((Object) tCellStack) && this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, parallelRecipes)) { - COST_CELLS = 1 * parallelRecipes; - COST_UUM = (int) tMass * parallelRecipes; + if (ItemList.Cell_Empty.isStackEqual((Object) tCellStack) && this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, 1)) { + COST_CELLS = 1; + COST_UUM = (int) tMass; } } else { tReplicatedItem = null; if (this.getDrainableStack() == null || (this.getDrainableStack().isFluidEqual(tOutputFluid) && this.getDrainableStack().amount < 16000)) { - COST_UUM = (int) tMass * parallelRecipes; + COST_UUM = (int) tMass; } } } - } else if (this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, parallelRecipes)) { - COST_UUM = (int) tMass * parallelRecipes; + } else if (this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, 1)) { + COST_UUM = (int) tMass; } - //Costs no UUM and no valid outputs? Let's bail gracefully before we consume inputs. + // Costs no UUM and no valid outputs? Let's bail gracefully before we consume inputs. if (COST_UUM <= 0 || (tReplicatedItem == null && tOutputFluid == null)) { return false; } - - //Requires a cell? Ok, let's use some. + + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + if (!isRecipeInputEqual(true, aFluidInputs, aItemInputs, expectedFluidInputs, expectedInputs)) { + Logger.WARNING("Broke at "+parallelRecipes+"..0"); + break; + } + Logger.WARNING("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"..0"); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + Logger.WARNING("BAD RETURN - 3.0"); + return false; + } + + // Set Vars to Parralel amount + COST_CELLS *= parallelRecipes; + + // Requires a cell? Ok, let's use some. if (COST_CELLS > 0) { this.depleteInput(ItemUtils.getEmptyCell(COST_CELLS)); } - - //Build an output map, for simplicity. + + // Build an output map, for simplicity. for (int r=0;r<parallelRecipes;r++) { this.mReplicatorOutputMap.put(ItemUtils.getSimpleStack(tReplicatedItem, 1)); } - - ItemStack[] mBuiltOutput = this.mReplicatorOutputMap; - - // -- Try not to fail after this point - inputs have already been consumed! -- - + ItemStack[] mBuiltOutput = this.mReplicatorOutputMap.toArray(); // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. @@ -556,18 +551,17 @@ extends GregtechMeta_MultiBlockBase { // Collect output item types ItemStack[] tOutputItems = new ItemStack[1]; for (int h = 0; h < 1; h++) { - if (tRecipe.getOutput(h) != null) { - tOutputItems[h] = tRecipe.getOutput(h).copy(); + if (mBuiltOutput[h] != null) { + tOutputItems[h] = mBuiltOutput[h].copy(); tOutputItems[h].stackSize = 0; } } // Set output item stack sizes (taking output chance into account) for (int f = 0; f < tOutputItems.length; f++) { - if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + if (mBuiltOutput[f] != null && tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { - if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) - tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + tOutputItems[f].stackSize += mBuiltOutput[f].stackSize; } } } @@ -600,17 +594,17 @@ extends GregtechMeta_MultiBlockBase { // Commit outputs this.mOutputItems = tOutputItems; - this.mOutputFluids = tOutputFluids; + //this.mOutputFluids = tOutputFluids; updateSlots(); // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); - Logger.WARNING("GOOD RETURN - 1"); + Logger.WARNING("GOOD RETURN - 1.0"); return true; } - + //Special Space Checking private boolean canBufferOutputs(ItemStack[] aInputs, int aParallelRecipes) { // Count slots available in output buses |