diff options
author | Martin Robertz <dream-master@gmx.net> | 2021-09-28 18:23:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 18:23:39 +0200 |
commit | 15329949a92047a620d920e267e8566f3dd0c5b1 (patch) | |
tree | a70c729627519ee031463780bd7cd430b707aaee | |
parent | 2df75cd6bda63309ff57aeba2bcb69ba60a4ec0e (diff) | |
parent | 5fc62f31ad8c331386ff5097800b66b4f28875f5 (diff) | |
download | GT5-Unofficial-15329949a92047a620d920e267e8566f3dd0c5b1.tar.gz GT5-Unofficial-15329949a92047a620d920e267e8566f3dd0c5b1.tar.bz2 GT5-Unofficial-15329949a92047a620d920e267e8566f3dd0c5b1.zip |
Merge pull request #43 from GTNewHorizons/mvf
allow MVF accept fluid input
Former-commit-id: 2d67b3390f12fbbe8d22328d0f2cbe6c1afe75ea
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 26 | ||||
-rw-r--r-- | src/main/resources/assets/bartworks/lang/en_US.lang | 2 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 1877a88183..2fdaa545dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -40,6 +40,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; @@ -95,21 +96,30 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); ArrayList<ItemStack> outputItems = new ArrayList<>(); + ArrayList<FluidStack> outputFluids = new ArrayList<>(); long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; - while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + while ((this.getStoredInputs().size() > 0 || this.getStoredFluids().size() > 0) && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tInputFluids, tInputs)) { found_Recipe = true; - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - outputItems.add(tRecipe.getOutput(i)); + if (tRecipe.mOutputs != null) { + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + } + if (tRecipe.mFluidOutputs != null) { + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + outputFluids.add(tRecipe.getFluidOutput(i)); + } } ++processed; } else @@ -138,6 +148,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); this.updateSlots(); return true; } @@ -168,8 +180,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) ) && - !this.mInputBusses.isEmpty() && - !this.mOutputBusses.isEmpty() && !this.mMaintenanceHatches.isEmpty() && LoaderReference.tectech ? (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : @@ -200,4 +210,4 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre public List getTecTechEnergyMultis() { return TTMultiAmp; } -}
\ No newline at end of file +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index b2a671cd20..be66d04b55 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -102,7 +102,7 @@ tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);0-1x Input Bus (Any casing);0-1x Output Bus (Any casing);0-1x Input Hatch (Any casing);0-1x Output Hatch (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY |