diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
28 files changed, 556 insertions, 317 deletions
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java b/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java index f5e1d429f7..2ee1587809 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java @@ -41,9 +41,9 @@ public class BOP_Block_Registrator { log_Rainforest = new LogRainforestTree(); leaves_Rainforest = new LeavesRainforestTree(); sapling_Rainforest = new SaplingRainforestTree(); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood"); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves"); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood", true); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves", true); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling", true); return true; } diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java index 7a40ab154d..264aaa2a20 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java @@ -37,7 +37,7 @@ public class LeavesBase extends BlockLeaves { String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Leaves"; GameRegistry.registerBlock(this, ItemBlock.class, blockName); this.setBlockName(blockName); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves", true); this.setCreativeTab(AddToCreativeTab.tabBOP); LanguageRegistry.addName(this, blockNameLocalized+" Leaves"); Blocks.fire.setFireInfo(this, 80, 150); diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java index 976361a01b..8e8ca0ed0a 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java @@ -33,8 +33,8 @@ public abstract class LogBase extends BlockLog String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Log"; GameRegistry.registerBlock(this, ItemBlock.class, blockName); this.setBlockName(blockName); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "log"+Utils.sanitizeString(blockNameLocalized)); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "log"+Utils.sanitizeString(blockNameLocalized), true); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood", true); this.setCreativeTab(AddToCreativeTab.tabBOP); LanguageRegistry.addName(this, blockNameLocalized); Blocks.fire.setFireInfo(this, 20, 100); diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java index 1aab5133dc..c039e1ebac 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java @@ -45,7 +45,7 @@ public class SaplingBase extends BlockSapling String blockName = "block"+Utils.sanitizeString(blockNameLocalized); GameRegistry.registerBlock(this, ItemBlock.class, blockName); this.setBlockName(blockName); - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling", true); this.setCreativeTab(AddToCreativeTab.tabBOP); LanguageRegistry.addName(this, blockNameLocalized); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 80839f0f64..663804bc81 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -50,6 +50,7 @@ import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricLighter; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; +import gtPlusPlus.xmod.gregtech.loaders.misc.WoodCentrifuging; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; @@ -145,6 +146,7 @@ public class HANDLER_GT { convertPyroToCokeOven(); Meta_GT_Proxy.fixIC2FluidNames(); RecipeLoader_AlgaeFarm.generateRecipes(); + WoodCentrifuging.processLogsForMethane(); } private static void convertPyroToCokeOven() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index f41efe602a..e1849985d0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -99,9 +99,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult try { calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class); - } catch (NoSuchMethodException | SecurityException e) {} - - mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>(); + } + catch (NoSuchMethodException | SecurityException e) {} } @@ -121,7 +120,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>(); // Custom Behaviour Map - private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours; + private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();; public GregtechMeta_MultiBlockBase(final int aID, final String aName, @@ -472,11 +471,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public String getSound() { return ""; } - public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) { + public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) { return canBufferOutputs(aRecipe, aParallelRecipes, true); } - public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) { + public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) { Logger.INFO("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes); @@ -485,11 +484,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true. if (aRecipe == null || aRecipe.mOutputs.length > 16) { if (aRecipe == null) { - return false; + return 0; } else if (aRecipe.mOutputs.length > 16) { if (aAllow16SlotWithoutCheck) { - return true; + return aParallelRecipes; } else { // Do nothing, we want to check this recipe properly. @@ -626,9 +625,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult // We have stacks that did not merge, do we have space for them? if (aInputMap.size() > 0) { if (aInputMap.size() > aInputBusSlotsFree) { + aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes); // We do not have enough free slots in total to accommodate the remaining managed stacks. - Logger.INFO("Failed to find enough space for all item outputs. Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size()); - return false; + Logger.INFO(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size()); + if(aParallelRecipes == 0) { + Logger.INFO("Failed to find enough space for all item outputs."); + return 0; + } + } } @@ -656,7 +660,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult int aEmptyFluidHatches = 0; int aFullFluidHatches = 0; // Create Map for Fluid Output - ConcurrentHashSet<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ConcurrentHashSet<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>(); + ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>(); for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) { if (!isValidMetaTileEntity(tBus)) { continue; @@ -672,32 +676,36 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult } } // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks. - ConcurrentHashSet<FluidStack> aOutputFluids = new ConcurrentHashSet<FluidStack>(); + ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>(); // Ugly ass boxing aOutputFluids.addAll(new AutoMap<FluidStack>(aRecipe.mFluidOutputs)); // Iterate the Hatches, updating their 'stored' data. - aHatchIterator: for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) { + //for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) { + for (int i = 0;i<aOutputHatches.size();i++) { // The Hatch Itself - GT_MetaTileEntity_Hatch_Output aHatch = aHatchData.getValue_1(); + GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1(); // Fluid in the Hatch - FluidStack aHatchStack = aHatchData.getValue_2(); + FluidStack aHatchStack = aOutputHatches.get(i).getValue_2(); // Space left in Hatch - int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount(); + int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount(); // Hatch is full, if (aSpaceLeftInHatch <= 0) { aFullFluidHatches++; - aOutputHatches.remove(aHatchData); - continue aHatchIterator; - } + aOutputHatches.remove(aOutputHatches.get(i)); + i--; + continue; + } // Hatch has space - else { + else { // Check if any fluids match - aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) { - if (GT_Utility.areFluidsEqual(aHatchStack, aOutputStack)) { - int aFluidToPutIntoHatch = aOutputStack.amount; + //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) { + for(int j = 0;j<aOutputFluids.size();j++) { + //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName()); + if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) { + int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes; // Not Enough space to insert all of the fluid. // We fill this hatch and add a smaller Fluidstack back to the iterator. - if (aSpaceLeftInHatch < aFluidToPutIntoHatch) { + if (aSpaceLeftInHatch < aFluidToPutIntoHatch) { // Copy existing Hatch Stack FluidStack aNewHatchStack = aHatchStack.copy(); aNewHatchStack.amount = 0; @@ -710,51 +718,57 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult aNewHatchStack.amount = aHatch.getCapacity(); aNewOutputStack.amount = aFluidLeftAfterInsert; // Remove fluid from output list, merge success - aOutputFluids.remove(aOutputStack); + aOutputFluids.remove(aOutputFluids.get(j)); + j--; // Remove hatch from hatch list, data is now invalid. - aOutputHatches.remove(aHatchData); + aOutputHatches.remove(aOutputHatches.get(i)); + i--; // Add remaining Fluid to Output list aOutputFluids.add(aNewOutputStack); // Re-add hatch to hatch list, with new data. - Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); - aOutputHatches.add(aNewHatchData); - continue aHatchIterator; + //Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); + //aOutputHatches.add(aNewHatchData); + break; } // We can fill this hatch perfectly (rare case), may as well add it directly to the full list. else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) { // Copy Old Stack FluidStack aNewHatchStack = aHatchStack.copy(); // Add in amount from output stack - aNewHatchStack.amount += aOutputStack.amount; + aNewHatchStack.amount += aFluidToPutIntoHatch; // Remove fluid from output list, merge success - aOutputFluids.remove(aOutputStack); + aOutputFluids.remove(aOutputFluids.get(j)); + j--; // Remove hatch from hatch list, data is now invalid. - aOutputHatches.remove(aHatchData); + aOutputHatches.remove(aOutputHatches.get(i)); + i--; // Re-add hatch to hatch list, with new data. Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); aOutputHatches.add(aNewHatchData); - continue aHatchIterator; + break; } // We have more space than we need to merge, so we remove the stack from the output list and update the hatch list. - else { + else { // Copy Old Stack FluidStack aNewHatchStack = aHatchStack.copy(); // Add in amount from output stack - aNewHatchStack.amount += aOutputStack.amount; + aNewHatchStack.amount += aFluidToPutIntoHatch; // Remove fluid from output list, merge success - aOutputFluids.remove(aOutputStack); + aOutputFluids.remove(aOutputFluids.get(j)); + j--; // Remove hatch from hatch list, data is now invalid. - aOutputHatches.remove(aHatchData); + aOutputHatches.remove(aOutputHatches.get(i)); + i--; // Re-add hatch to hatch list, with new data. Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); aOutputHatches.add(aNewHatchData); // Check next fluid - continue aFluidMatch; + continue; } } else { - continue aFluidMatch; + continue; } } } @@ -768,11 +782,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult } // We have Fluid Stacks we did not merge. Do we have space? + Logger.INFO("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches); if (aOutputFluids.size() > 0) { // Not enough space to add fluids. if (aOutputFluids.size() > aEmptyFluidHatches) { - Logger.INFO("Failed to find enough space for all fluid outputs."); - return false; + aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes); + Logger.INFO("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size()); + return 0; + } } @@ -781,7 +798,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult */ } - return true; + return aParallelRecipes; } /** @@ -1034,7 +1051,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult */ // First populate the map if we need to. - if (mCustomBehviours == null || mCustomBehviours.isEmpty()) { + if (mCustomBehviours.isEmpty()) { mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap()); } @@ -1071,8 +1088,9 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult } } } - - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); return false; } @@ -1379,7 +1397,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult return false; } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); return false; } @@ -1553,7 +1572,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult this.mDischargeHatches.clear(); this.mControlCoreBus.clear(); this.mAirIntakes.clear(); - this.mMultiDynamoHatches.clear(); + this.mTecTechEnergyHatches.clear(); + this.mTecTechDynamoHatches.clear(); } } @@ -1578,7 +1598,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult tTileEntity = localIterator.next(); } tTileEntity = null; - for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mMultiDynamoHatches + for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches + .iterator(); localIterator.hasNext(); tTileEntity + .getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { + tTileEntity = localIterator.next(); + } + tTileEntity = null; + for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches .iterator(); localIterator.hasNext(); tTileEntity .getBaseMetaTileEntity() .doExplosion(gregtech.api.enums.GT_Values.V[8])) { @@ -1870,10 +1897,16 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex); } + //Handle TT Multi-A Energy Hatches + else if (LoadedMods.TecTech && isThisHatchMultiEnergy(aMetaTileEntity)) { + log("Found isThisHatchMultiEnergy"); + aDidAdd = addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex); + } + //Handle TT Multi-A Dynamos else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) { log("Found isThisHatchMultiDynamo"); - aDidAdd = addToMachineListInternal(mMultiDynamoHatches, aMetaTileEntity, aBaseCasingIndex); + aDidAdd = addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex); } //Handle Fluid Hatches using seperate logic @@ -2126,10 +2159,16 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult /** - * This is the array Used to Store the Tectech Multi-Amp hatches. + * This is the array Used to Store the Tectech Multi-Amp Dynamo hatches. + */ + + public ArrayList<GT_MetaTileEntity_Hatch> mTecTechDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); + + /** + * This is the array Used to Store the Tectech Multi-Amp Energy hatches. */ - public ArrayList<GT_MetaTileEntity_Hatch> mMultiDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); + public ArrayList<GT_MetaTileEntity_Hatch> mTecTechEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); /** * TecTech Multi-Amp Dynamo Support @@ -2149,12 +2188,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult } if (isThisHatchMultiDynamo(aTileEntity)) { updateTexture(aTileEntity, aBaseCasingIndex); - return this.mMultiDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return this.mTecTechDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); } return false; } - @SuppressWarnings("rawtypes") public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){ Class<?> mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); @@ -2170,12 +2208,58 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (LoadedMods.TecTech){ if (isThisHatchMultiDynamo(aTileEntity)) { - addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex); + return addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex); } } return super.addDynamoToMachineList(aTileEntity, aBaseCasingIndex); } + + + /** + * TecTech Multi-Amp Energy Hatch Support + * @param aTileEntity - The Energy Hatch + * @param aBaseCasingIndex - Casing Texture + * @return + */ + + public boolean addMultiAmpEnergyToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){ + //GT_MetaTileEntity_Hatch_DynamoMulti + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (isThisHatchMultiEnergy(aTileEntity)) { + updateTexture(aTileEntity, aBaseCasingIndex); + return this.mTecTechEnergyHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + } + return false; + } + + public boolean isThisHatchMultiEnergy(Object aMetaTileEntity){ + Class<?> mDynamoClass; + mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); + if (mDynamoClass != null){ + if (mDynamoClass.isInstance(aMetaTileEntity)){ + return true; + } + } + return false; + } + + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoadedMods.TecTech){ + if (isThisHatchMultiEnergy(aTileEntity)) { + return addMultiAmpEnergyToMachineList(aTileEntity, aBaseCasingIndex); + } + + } + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + } /** diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index e72838fcad..6e33529b66 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -63,12 +63,12 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second"; return new String[]{ this.mDescription, - "Fuel Efficiency: " + this.getEfficiency()*2 + "%", + "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution}; } return new String[]{ this.mDescription, - "Fuel Efficiency: " + this.getEfficiency()*2 + "%"}; + "Fuel Efficiency: " + this.getEfficiency() + "%"}; } @@ -267,9 +267,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ final int tFuelValue = this.getFuelValue(this.mFluid), tConsumed = this.consumedFluidPerOperation(this.mFluid); if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount >= tConsumed)) { final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 20) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); - if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){ + if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){ int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed)/3), 1); - //Logger.INFO("True consumption: "+toConsumeTrue+" | Consuming this tick? "+useFuel); this.mFluid.amount -= (int) aSafeFloor; PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution()); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 5ebdbf0ef8..cfbf7bd487 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -38,7 +38,8 @@ extends GT_MetaTileEntity_BasicGenerator @Override public String[] getDescription() { - return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick"}; + String aPollution = "Causes between "+this.getPollution()+ " Pollution per second"; + return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", aPollution}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 6a42232e40..7d20f1eb59 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -54,12 +54,12 @@ extends GregtechRocketFuelGeneratorBase { } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, ((40+((this.mTier) * 16))/4)+(this.mTier)); + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, 80 - (10 * (this.mTier - 4))); } @Override public int getEfficiency() { - int eff = ((40+((this.mTier) * 16))/4)+(this.mTier); + int eff = 80 - (10 * (this.mTier - 4)); return eff; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 78896dd650..b5cfff10e4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -227,7 +227,8 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu return false; } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { Logger.WARNING("BAD RETURN - 2"); return false; } 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 e721761d82..6e4c071ecb 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 @@ -112,7 +112,30 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(final ItemStack aStack) { - return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 250); + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + ItemStack[] inputs = new ItemStack[tBusItems.size()]; + int slot = 0; + for (ItemStack g : tBusItems) { + inputs[slot++] = g; + } + if (inputs.length > 0) { + log("Recipe. ["+inputs.length+"]["+getMaxParallelRecipes()+"]"); + if (checkRecipeGeneric(inputs, new FluidStack[]{}, getMaxParallelRecipes(), getEuDiscountForParallelism(), 250, 10000)) { + log("Recipe 2."); + return true; + } + } + + } + return false; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index 8b07117596..b071c77d15 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -351,7 +351,8 @@ extends GregtechMeta_MultiBlockBase { return false; } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { Logger.MACHINE_INFO("BAD RETURN - 2|"+tCircuitID); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index 8c62937bae..c99a6e286b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -53,8 +53,6 @@ extends GregtechMeta_MultiBlockBase { "Controller (Center Bottom)", "1x Input Bus (Any top or bottom edge casing)", "4x Output Bus (Any top or bottom edge casing)", - "1x Maintenance Hatch (Any top or bottom edge casing)", - "1x Muffler Hatch (Any top or bottom edge casing)", "1x Energy Hatch (Any top or bottom edge casing)", "18x Sieve Grate (Top and Middle 3x3)", "Sieve Casings for the rest (35 min)" diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index ab7fb79c4b..133e10d6f6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -152,9 +152,14 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir); byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir); this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta); + + int aCasingCount = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { + + + if ((i != 0) || (j != 0)) { //Coils 1 if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) { @@ -170,8 +175,15 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } //Top Layer + + Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j); + int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j); + if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 11) { + aCasingCount++; + } + final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j); - if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j), ModBlocks.blockCasings3Misc, 11)) { + if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 11)) { Logger.INFO("Top Layer missing."); return false; } @@ -179,9 +191,16 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { + + + Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j); + int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j); + if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 11) { + aCasingCount++; + } if ((xDir + i != 0) || (zDir + j != 0)) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,zDir + j); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings3Misc, 11)) { + if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 11)) { Logger.INFO("Bottom Layer missing."); return false; } @@ -189,8 +208,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } } - // TODO - Fix Casing Count - return true; + return aCasingCount >= 10; } public int getMaxEfficiency(ItemStack aStack) { @@ -282,7 +300,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase return false; } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { Logger.WARNING("BAD RETURN - 2"); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index c31a7c0758..f24825ba8a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -223,7 +223,10 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { } } catch (IllegalArgumentException | IllegalAccessException e) { } - } + } + else if (this.mMachineMode == MODE.DISASSEMBLY) { + return null; + } return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index 4e5c95ad73..3592475a5c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; @@ -16,6 +17,7 @@ import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.Item; @@ -29,7 +31,7 @@ extends GregtechMeta_MultiBlockBase { private int mHeatingCapacity = 0; private int mMode = 0; private boolean isUsingControllerCircuit = false; - private static final Item circuit = CI.getNumberedCircuit(0).getItem(); + private static Item circuit; public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -46,7 +48,7 @@ extends GregtechMeta_MultiBlockBase { @Override public String getMachineType() { - return "Alloy Smelter"; + return "Fluid Alloy Cooker"; } @Override @@ -104,6 +106,9 @@ extends GregtechMeta_MultiBlockBase { public boolean isCorrectMachinePart(final ItemStack aStack) { if (this.getBaseMetaTileEntity().isServerSide()) { //Get Controller Circuit + if (circuit == null) { + circuit = CI.getNumberedCircuit(0).getItem(); + } if (aStack != null && aStack.getItem() == circuit) { this.mMode = aStack.getItemDamage(); return this.isUsingControllerCircuit = true; @@ -197,6 +202,14 @@ extends GregtechMeta_MultiBlockBase { } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + List<ItemStack> tOutPutItems = new ArrayList<ItemStack>(); + for (ItemStack tOut : tRecipe.mOutputs) { + if (ItemUtils.checkForInvalidItems(tOut)) { + tOutPutItems.add(tOut); + } + } + if (tOutPutItems.size() > 0) + this.mOutputItems = tOutPutItems.toArray(new ItemStack[tOutPutItems.size()]); this.updateSlots(); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index ed6c913e6b..6070e3604a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; import java.util.ArrayList; -import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -10,7 +9,6 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; @@ -25,7 +23,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -37,8 +34,6 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase { - public long mEUStore; - public GregtechMetaTileEntity_Cyclotron(int aID, String aName, String aNameRegional, int tier) { super(aID, aName, aNameRegional); } @@ -95,13 +90,11 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setLong("mEUStore", mEUStore); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - mEUStore = aNBT.getLong("mEUStore"); super.loadNBTData(aNBT); } @@ -395,113 +388,6 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { - if (mEfficiency < 0) - mEfficiency = 0; - - //Time Counter - this.mTotalRunTime++; - this.fixAllMaintenanceIssue(); - - onRunningTick(null); - - boolean aFormCheck = (aTick % 100 == 0 ? checkMultiblock(aBaseMetaTileEntity, mInventory[1]) : true); - - - - if (mRunningOnLoad && aFormCheck) { - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - checkRecipe(mInventory[1]); - } - if (--mUpdate == 0 || --mStartUpCheck == 0) { - mInputHatches.clear(); - mInputBusses.clear(); - mOutputHatches.clear(); - mOutputBusses.clear(); - mDynamoHatches.clear(); - mEnergyHatches.clear(); - mMufflerHatches.clear(); - mMaintenanceHatches.clear(); - mChargeHatches.clear(); - mDischargeHatches.clear(); - mControlCoreBus.clear(); - mAirIntakes.clear(); - mMultiDynamoHatches.clear(); - mMachine = aFormCheck; - } - if (mStartUpCheck < 0) { - if (mMachine) { - if (this.mEnergyHatches != null) { - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { - if (aBaseMetaTileEntity.getStoredEU() + (2048*4) < maxEUStore() - && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits((2048*4), false)) { - aBaseMetaTileEntity.increaseStoredEnergyUnits((2048*4), true); - } - } - } - if (this.mEUStore <= 0 && mMaxProgresstime > 0) { - stopMachine(); - } - if (getRepairStatus() > 0) { - if (mMaxProgresstime > 0) { - this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true); - if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { - if (mOutputItems != null) - for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); - if (mOutputFluids != null) - for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); - mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); - mOutputItems = null; - mProgresstime = 0; - mMaxProgresstime = 0; - mEfficiencyIncrease = 0; - if (mOutputFluids != null && mOutputFluids.length > 0) { - try { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); - } catch (Exception e) { - } - } - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (aBaseMetaTileEntity.isAllowedToWork()) - checkRecipe(mInventory[1]); - } - } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { - turnCasingActive(mMaxProgresstime > 0); - if (aBaseMetaTileEntity.isAllowedToWork()) { - this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (checkRecipe(mInventory[1])) { - if (this.mEUStore < this.mLastRecipe.mSpecialValue) { - mMaxProgresstime = 0; - turnCasingActive(false); - } - aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true); - } - } - if (mMaxProgresstime <= 0) - mEfficiency = Math.max(0, mEfficiency - 1000); - } - } - } else { - this.mLastRecipe = null; - stopMachine(); - } - } else { - turnCasingActive(false); - this.mLastRecipe = null; - stopMachine(); - } - } - //doRandomMaintenanceDamage(); - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) - | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); - aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); - } - } - - @Override public boolean onRunningTick(ItemStack aStack) { if (this.mOutputBusses.size() > 0) { for (GT_MetaTileEntity_Hatch_OutputBus g : this.mOutputBusses) { @@ -529,10 +415,9 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } } } - } - PollutionUtils.addPollution(getBaseMetaTileEntity(), this.getPollutionPerTick(aStack)); - - return true; + } + this.fixAllMaintenanceIssue(); + return super.onRunningTick(aStack); } @@ -570,7 +455,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas return new String[]{ "COMET - Compact Cyclotron MK "+tier, "EU Required: "+powerRequired+"EU/t", - "Stored EU: "+mEUStore+" / "+maxEUStore()}; + "Stored EU: "+this.getEUVar()+" / "+maxEUStore()}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 031bf16b17..cb9c68b53c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -549,7 +549,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M ItemStack[] mFishOutput = generateLoot(this.mMode); mFishOutput = removeNulls(mFishOutput); GT_Recipe g = new Recipe_GT(true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0); - if (!this.canBufferOutputs(g, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(g, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { log("No Space"); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index 8e3e40b3ab..af4132f5ff 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -12,6 +12,7 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; @@ -22,6 +23,7 @@ import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; +import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -52,6 +54,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi private final static int CASING_ID = TAE.getIndexFromPage(3, 11); + + public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -91,13 +95,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi "Supply Rocket Fuels and 1000L(3000L boosted) of "+mLubricantName+" per hour to run", "Supply 4L of "+mCoolantName+" per second per 2100 eu/t to boost output (optional)", "Consumes upto 37500L of Air per second", - "Produces between 4K and 32K eu/t depending on how much fuel is fed", - "When producing more then 16K eu/t fuel wil be consume less efficiently (3x - 1.5x eff)", + "Produces as much energy as you put fuel in becomes less ", + "When producing more then 30K eu/t fuel wil be consume less efficiently (3x - 1.5x eff@55Keu/t)", "Boosting will produce 3x the amount of power but will consume 3x fuel", "Size(WxHxD): 3x3x10, Controller (front centered)", "3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)", "8x "+mGearboxName+" inside the Hollow Casing", - "1x Dynamo Hatch (Top Middle, Max 8)", + "1x Dynamo Hatch (Top Middle, Max 8) suports tectech dynamos", "8x Air Intake Hatch (one of the Casings next to a Gear Box, top row allowed)", "2x Input Hatch (Rocket Fuel/Booster) (one of the Casings next to a Gear Box, top row not allowed)", "1x Maintenance Hatch (one of the Casings next to a Gear Box)", @@ -149,21 +153,20 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi @Override public boolean checkRecipe(final ItemStack aStack) { - if (this.mEfficiency < 0) log(" geting air"); final ArrayList<FluidStack> tFluids = this.getStoredFluids(); FluidStack air = FluidUtils.getFluidStack("air", 1); log(" geting air 2"); int aircount = getAir() ; - if (aircount < euProduction/32) { + if (aircount < euProduction/100) { log(" not enough air"); //log("Not Enough Air to Run "+aircount); return false; } else { log(" no boost"); - boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/32)); + boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/100)); if (!hasIntakeAir) { //log("Could not consume Air to run "+aircount); freeFuelTicks = 0; @@ -221,7 +224,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]<<1); this.mProgresstime = 1; this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = euProduction/4000; + this.mEfficiencyIncrease = euProduction/2000; return true; //log(""); } @@ -229,7 +232,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { - this.mEfficiencyIncrease = euProduction/4000; + this.mEfficiencyIncrease = euProduction/2000; freeFuelTicks--; this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5]<<1); this.mProgresstime = 1; @@ -259,17 +262,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi log("amount: "+amount); log("Value: "+value); int energy = value * amount; - //engine needs at leas 2A EV of fuel to waork - if (energy < 40000){ - log("not enough fuel to work"); - return false; - } - //limits engine to LuV fuel consumption - if (energy > 427500){ - amount = (int) ((double) 427500/value); - energy = 427500; - } log("amount2: "+amount); + if (amount < 5) + return false; FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount)); if (!this.depleteInput(tLiquid)) { log("could not deplete fluid"); @@ -286,8 +281,16 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public void setEUProduction(int energy){ energy /= 20; - // 3x eff unles it gose above 16K eu/t - double energyEfficiency = energy > 5500 ? ((double) Math.sqrt(5500)/Math.sqrt(energy) * energy) : energy; + double energyEfficiency; + if (energy > 10000) { + energyEfficiency = ((double) Math.cbrt(10000)/Math.cbrt(energy)); + if (energy >= 40000) + energyEfficiency *= ((double) Math.cbrt(40000)/Math.cbrt(energy)); + energyEfficiency *= energy; + } + else { + energyEfficiency = energy; + } euProduction = (int) ((double) energyEfficiency * 1.84); if (this.boostEu) euProduction *= 3; @@ -313,6 +316,10 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi int tX = getBaseMetaTileEntity().getXCoord(); int tY = getBaseMetaTileEntity().getYCoord(); int tZ = getBaseMetaTileEntity().getZCoord(); + + this.mTecTechDynamoHatches.clear(); + this.mAllDynamoHatches.clear(); + final int MAX_LENGTH = 8; for (int length=0;length<MAX_LENGTH;length++) { if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, length+1) != getGearboxBlock()) { @@ -425,8 +432,14 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi this.updateTexture(tTileEntity, getCasingTextureIndex()); } } + + mAllDynamoHatches.addAll(this.mDynamoHatches); + + if (LoadedMods.TecTech) { + mAllDynamoHatches.addAll(this.mTecTechDynamoHatches); + } - if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) { + if (this.mAllDynamoHatches.size() <= 0 || this.mAllDynamoHatches.isEmpty()) { log("Wrong count for Dynamos"); return false; } @@ -446,7 +459,85 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi log("Formed Rocket Engine."); return true; - } + } + + @Override + public boolean addEnergyOutput(long aEU) { + if (aEU <= 0) { + return true; + } + if (mAllDynamoHatches.size() > 0) { + return addEnergyOutputMultipleDynamos(aEU, true); + } + return false; + } + + + public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { + int injected = 0; + long totalOutput = 0; + long aFirstVoltageFound = -1; + boolean aFoundMixedDynamos = false; + for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) { + if( aDynamo == null ) { + return false; + } + if (isValidMetaTileEntity(aDynamo)) { + long aVoltage = aDynamo.maxEUOutput(); + long aTotal = aDynamo.maxAmperesOut() * aVoltage; + // Check against voltage to check when hatch mixing + if (aFirstVoltageFound == -1) { + aFirstVoltageFound = aVoltage; + } + else { + /** + * Calcualtes overclocked ness using long integers + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + */ + //Long time calculation + if (aFirstVoltageFound != aVoltage) { + aFoundMixedDynamos = true; + } + } + totalOutput += aTotal; + } + } + + if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) { + explodeMultiblock(); + return false; + } + + long leftToInject; + //Long EUt calculation + long aVoltage; + //Isnt too low EUt check? + int aAmpsToInject; + int aRemainder; + + //xEUt *= 4;//this is effect of everclocking + for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) { + if (isValidMetaTileEntity(aDynamo)) { + leftToInject = aEU - injected; + aVoltage = aDynamo.maxEUOutput(); + aAmpsToInject = (int) (leftToInject / aVoltage); + aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage)); + long powerGain; + for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) { + if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)){ + powerGain = aRemainder; + }else{ + powerGain = aVoltage; + } + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false); + injected += powerGain; + } + } + } + return injected > 0; + } public Block getCasingBlock() { return ModBlocks.blockCasings4Misc; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index a05ecca551..a7afaa6b56 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -232,7 +232,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { } public boolean checkForWater() { - + // Get Facing direction IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; @@ -340,7 +340,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { if (aBaseMetaTileEntity.isClientSide()) { this.mLevel = getCasingTierOnClientSide(); } - + } @Override @@ -379,9 +379,15 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { return false; } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes, false)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { return false; } + if (tRecipe.mInputs.length > 0) { + for (ItemStack aInputToConsume : tRecipe.mInputs) { + this.depleteInput(aInputToConsume); + } + } // -- Try not to fail after this point - inputs have already been consumed! -- @@ -475,7 +481,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { } return false; } - + @SideOnly(Side.CLIENT) private final int getCasingTierOnClientSide() { if (this == null || this.getBaseMetaTileEntity().getWorld() == null) { @@ -497,7 +503,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { return 0; } } - + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 87f8d81bb2..ebae66fe72 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -57,7 +57,10 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { private int mPipeCasingTier = 0; private int mCoilTier = 0; - + public static GT_Recipe_Map getGeneratedRecipeMap() { + return mFluidChemicalReactorRecipes; + } + /** * Internal Recipe Map which holds the actual recipes, backed by the real map, shown by NEI. */ @@ -832,7 +835,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 7300b3507b..9b898e34af 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -10,7 +10,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; @@ -47,6 +46,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe private final int ENERGY_TAX = 2; //TecTech Support + public ArrayList<GT_MetaTileEntity_Hatch> mAllEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, final String aNameRegional) { @@ -138,12 +138,26 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 7) { return 8; } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 8) { - return CORE.GTNH ? GT_Values.V.length : 9; + return 9; } else { return -1; } } + public static int getMaxHatchTier(int aCellTier) { + switch(aCellTier) { + case 9: + return CORE.GTNH ? 15 : 9; + default: + if (aCellTier < 4) { + return 0; + } + else { + return aCellTier; + } + } + } + public static final int CELL_HEIGHT_MAX = 16; public static final int CELL_HEIGHT_MIN = 2; @@ -153,8 +167,11 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - this.mMultiDynamoHatches.clear(); - this.mAllDynamoHatches.clear(); + this.mTecTechDynamoHatches.clear(); + this.mAllDynamoHatches.clear(); + + this.mTecTechEnergyHatches.clear(); + this.mAllEnergyHatches.clear(); boolean tFoundCeiling = false; int tCasingCount = 0; @@ -246,10 +263,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe /** * TecTech Support, this allows adding Multi-Amp dynamos. */ + mAllEnergyHatches.addAll(this.mEnergyHatches); mAllDynamoHatches.addAll(this.mDynamoHatches); if (LoadedMods.TecTech) { - mAllDynamoHatches.addAll(this.mMultiDynamoHatches); + mAllDynamoHatches.addAll(this.mTecTechEnergyHatches); + mAllDynamoHatches.addAll(this.mTecTechDynamoHatches); } @@ -257,7 +276,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe checkMachineProblem("Needed 1 maintenance hatch, found " + this.mMaintenanceHatches.size()); return false; } - if (this.mEnergyHatches.size() < 1) { + if (this.mAllEnergyHatches.size() < 1) { checkMachineProblem("Needed at least 1 energy hatch, found 0"); return false; } @@ -269,15 +288,17 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe // Find average EU throughput int totalEuThroughput = 0; int hatchCount = 0; + + int aMaxHatchTier = getMaxHatchTier(tOverallCellTier); - for (GT_MetaTileEntity_Hatch_Energy re : this.mEnergyHatches) { + for (GT_MetaTileEntity_Hatch re : this.mAllEnergyHatches) { long tier = re.getOutputTier(); - if(tier > tOverallCellTier) { - checkMachineProblem("Energy hatch (tier " + tier + ") is too strong for cells (tier " + tOverallCellTier + ")"); + if(tier > aMaxHatchTier) { + checkMachineProblem("Energy hatch (tier " + tier + ") is too strong for cells (tier " + aMaxHatchTier + ")"); return false; } if(tier < 3) { - checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + tOverallCellTier + ")"); + checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + aMaxHatchTier + ")"); return false; } totalEuThroughput += re.maxEUInput(); @@ -286,12 +307,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe for (GT_MetaTileEntity_Hatch re : this.mAllDynamoHatches) { long tier = re.getInputTier(); - if(tier > tOverallCellTier) { - checkMachineProblem("Dynamo hatch (tier " + tier + ") is too strong for cells (tier " + tOverallCellTier + ")"); + if(tier > aMaxHatchTier) { + checkMachineProblem("Dynamo hatch (tier " + tier + ") is too strong for cells (tier " + aMaxHatchTier + ")"); return false; } if(tier < 3) { - checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + tOverallCellTier + ")"); + checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + aMaxHatchTier + ")"); return false; } totalEuThroughput += re.maxEUOutput(); @@ -431,6 +452,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return MathUtils.roundToClosestInt(mTax); } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + this.fixAllMaintenanceIssue(); + } + @Override public boolean onRunningTick(ItemStack aStack) { // First, decay overcharge (0.1% of stored energy plus 1000 EU per tick) @@ -448,7 +475,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe for (GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) { drawEnergyFromHatch(tHatch); } - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { + for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) { drawEnergyFromHatch(tHatch); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java index e2a30851aa..7754d039cf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java @@ -29,7 +29,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { } private void generateRecipes(final Material material){ - final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15; + final int tVoltageMultiplier = material.vVoltageMultiplier; @@ -40,7 +40,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { ItemList.Shape_Mold_Nugget.get(0), material.getNugget(9), (int) Math.max(material.getMass() * 2L, 1L), - 2 * tVoltageMultiplier); + tVoltageMultiplier); //Gears if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1))) @@ -49,7 +49,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { ItemList.Shape_Mold_Gear.get(0), material.getGear(1), (int) Math.max(material.getMass() * 2L, 1L), - 2 * tVoltageMultiplier); + tVoltageMultiplier); //Ingot if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1))) @@ -58,7 +58,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { ItemList.Shape_Mold_Ingot.get(0), material.getIngot(1), (int) Math.max(material.getMass() * 2L, 1L), - 2 * tVoltageMultiplier); + tVoltageMultiplier); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index 56f65670a8..cd43d6201c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -34,7 +34,6 @@ public class RecipeGen_Extruder extends RecipeGen_Base { private void generateRecipes(final Material material){ - final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15; final ItemStack itemIngot = material.getIngot(1); final ItemStack itemPlate = material.getPlate(1); final ItemStack itemGear = material.getGear(1); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java new file mode 100644 index 0000000000..2d7cd1b73b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java @@ -0,0 +1,85 @@ +package gtPlusPlus.xmod.gregtech.loaders.misc; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class WoodCentrifuging { + + private static final ArrayList<ItemStack> aLogData; + private static final ArrayList<ItemStack> aRubberLogs; + private static final ArrayList<ItemStack> aRubberLogs2; + + static { + aLogData = OreDictionary.getOres("logWood"); + aRubberLogs = OreDictionary.getOres("logRubber"); + aRubberLogs2 = OreDictionary.getOres("woodRubber"); + } + + private static boolean isNormalLog(ItemStack aStack) { + if (aLogData.contains(aStack) & !isRubberLog(aStack)) { + return true; + } + return false; + } + + private static boolean isRubberLog(ItemStack aStack) { + if (aRubberLogs.contains(aStack)) { + return true; + } + else if (aRubberLogs2.contains(aStack)) { + return true; + } + return false; + } + + + private static boolean addCentrifugeRecipe(ItemStack aStack) { + if (isNormalLog(aStack)) { + return addNormalLogCentrifugeRecipe(aStack); + } + else if (isRubberLog(aStack)) { + return addRubberLogCentrifugeRecipe(aStack); + } + return false; + } + + private static boolean addNormalLogCentrifugeRecipe(ItemStack aStack) { + GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack}); + if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 20)) { + Logger.INFO("Added methane extraction for "+ItemUtils.getItemName(aStack)); + return true; + } + return false; + } + private static boolean addRubberLogCentrifugeRecipe(ItemStack aStack) { + GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack}); + if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), ItemList.IC2_Resin.get(1L, new Object[0]), GT_ModHandler.getIC2Item("plantBall", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, null, new int[] { 5000, 3750, 2500, 2500 }, 200, 20)) { + Logger.INFO("Added rubber plant based methane extraction for "+ItemUtils.getItemName(aStack)); + return true; + } + return false; + } + + public static void processLogsForMethane() { + //Try use all woods found, fix/add methane extraction. + if (!aLogData.isEmpty()) { + Logger.INFO("Fixing Methane output of centrifuged logs."); + for (ItemStack stack : aLogData) { + addCentrifugeRecipe(stack); + } + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java index 609d4e0649..1091533a52 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java @@ -125,70 +125,75 @@ public class RecipeLoader_AlgaeFarm { // Create an Automap to dump contents into AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>(); - // Add loot relevant to tier and also add any from lower tiers. - if (aTier >= 0) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(32, 64))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16))); + // Buff output by yielding 6-8 times more. + for (int i=0;i<MathUtils.randInt(4, 8);i++) { + // Add loot relevant to tier and also add any from lower tiers. + if (aTier >= 0) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(32, 64))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16))); + } } - } - if (aTier >= 1) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8))); + if (aTier >= 1) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8))); + } } - } - if (aTier >= 2) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8))); + if (aTier >= 2) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8))); + } } - } - if (aTier >= 3) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(2, 8))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(8, 16))); + if (aTier >= 3) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(2, 8))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(8, 16))); + } } - } - if (aTier >= 4) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(32, 64))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8))); + if (aTier >= 4) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(32, 64))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8))); + } } - } - if (aTier >= 5) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(1, 2))); + if (aTier >= 5) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(1, 2))); + } } - } - // Tier 6 is Highest for outputs - if (aTier >= 6) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16))); - if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16))); + // Tier 6 is Highest for outputs + if (aTier >= 6) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16))); + if (MathUtils.randInt(0, 10) > 9) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16))); + } } - } - - // Iterate a special loop at higher tiers to provide more Red/Gold Algae. - for (int i=0;i<(9-aTier);i++) { - if (aTier >= (6+i)) { - int aMulti = i + 1; - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti))); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti))); - if (MathUtils.randInt(0, 10) > 8) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16*aMulti))); + + // Iterate a special loop at higher tiers to provide more Red/Gold Algae. + for (int i2=0;i2<(9-aTier);i2++) { + if (aTier >= (6+i2)) { + int aMulti = i2 + 1; + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti))); + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti))); + if (MathUtils.randInt(0, 10) > 8) { + aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16*aMulti))); + } } } } + + // Map the AutoMap contents to an Itemstack Array. ItemStack[] aOutputs = new ItemStack[aOutputMap.size()]; for (int i=0;i<aOutputMap.size();i++) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index a3aa7e5e78..eecbde9804 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -46,34 +46,34 @@ public class GregtechDehydrator { GregtechItemList.GT_Dehydrator_MV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(911, "machine.dehydrator.tier.00", "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 16000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_HV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(912, "machine.dehydrator.tier.01", "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 32000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); //Chemical GregtechItemList.GT_Dehydrator_EV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 48000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, "A hangover is the way your body reacts to dehydration. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, "You could probably make space icecream with this.. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, "You can definitely make space icecream with this.. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); //Advanced diff --git a/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java index 7a53572aae..a190511b02 100644 --- a/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java +++ b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java @@ -35,15 +35,7 @@ public class GliderHandler { return; } - ItemStack aItem = event.entityPlayer.getItemInUse(); - if (!ItemUtils.checkForInvalidItems(aItem)) { - Logger.WARNING("[OpenBlocks] Item in use was invalid, trying currentlyEquipped."); - aItem = event.entityPlayer.getCurrentEquippedItem(); - } - if (!ItemUtils.checkForInvalidItems(aItem)) { - Logger.WARNING("[OpenBlocks] Item in use was invalid, trying heldItem."); - aItem = event.entityPlayer.getHeldItem(); - } + ItemStack aItem = PlayerUtils.getItemStackInPlayersHand(event.entityPlayer); if (ItemUtils.checkForInvalidItems(aItem)) { Class aItemGliderClass = ReflectionUtils.getClass("openblocks.common.item.ItemHangGlider"); if (aItemGliderClass.isInstance(aItem.getItem())) { |