aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-12-08 01:31:05 +0100
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-12-08 01:31:05 +0100
commit524418b7dd38f6d2b6ef2b536243b0c7b85483d5 (patch)
treecd7fe805fe201c06a108d748e4a48243f92c5dd4 /src/main
parentc46c6723e6a7af3edd6d3f660901388d7e01389e (diff)
downloadGT5-Unofficial-524418b7dd38f6d2b6ef2b536243b0c7b85483d5.tar.gz
GT5-Unofficial-524418b7dd38f6d2b6ef2b536243b0c7b85483d5.tar.bz2
GT5-Unofficial-524418b7dd38f6d2b6ef2b536243b0c7b85483d5.zip
Fixed Numbers in Loader
+ fixed Werkstoff Mixer recipes not generating + fixed insaine high voltage, and insaine short time requirements for FluidExtractionRecipe and FluidSolidifierRecipe + fixed ElectrolyzerRecipes, CentrifugeRecipes, ChemicalRecipes, MultiblockChemicalRecipes, MixerRecipes time + added not yet enabled TT integrated ManualTrafo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 0e0b878ded7e1780bb71004cd6cb76016ca562e6
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java38
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java137
3 files changed, 157 insertions, 20 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
index 1f9968c9a3..f274260d13 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java
@@ -483,7 +483,7 @@ public class RecipeLoader implements Runnable {
);
GT_ModHandler.addCraftingRecipe(
- new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L),
+ /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L),
RecipeLoader.BITSD,
new Object[]{
"SCS",
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
index 15133368b4..4c92f195f1 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
@@ -1971,7 +1971,7 @@ public class WerkstoffLoader implements Runnable {
HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>();
int cells = 0;
- if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) {
+ if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) {
for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue().toArray(new Pair[0])) {
if (container.getKey() instanceof Materials) {
if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) {
@@ -2052,19 +2052,19 @@ public class WerkstoffLoader implements Runnable {
ItemStack input = werkstoff.get(dust);
input.stackSize = werkstoff.getContents().getKey();
if (werkstoff.getStats().isElektrolysis())
- GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0));
+ GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0));
if (werkstoff.getStats().isCentrifuge())
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0));
+ GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0));
if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) {
if (cells > 0)
stOutputs.add(Materials.Empty.getCells(cells));
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0));
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0);
+ GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0));
+ GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0);
}
if (werkstoff.getGenerationFeatures().hasMixerRecipes()) {
if (cells > 0)
stOutputs.add(Materials.Empty.getCells(cells));
- GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0));
+ GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0));
}
}
@@ -2295,8 +2295,8 @@ public class WerkstoffLoader implements Runnable {
}
if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,(int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30);
}
if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) {
@@ -2349,21 +2349,21 @@ public class WerkstoffLoader implements Runnable {
}
if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) {
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) {
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
}
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
- GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
} else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
- GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
+ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30);
}
}
} \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java
new file mode 100644
index 0000000000..b62ec218b5
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java
@@ -0,0 +1,137 @@
+package com.github.bartimaeusnek.crossmod.tectech;
+
+import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo {
+
+ ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnerys = new ArrayList<>();
+ ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> mTTDynamos = new ArrayList<>();
+ public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public TT_TileEntity_ManualTrafo(String aName) {
+ super(aName);
+ }
+
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new TT_TileEntity_ManualTrafo(this.mName);
+ }
+
+
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0L) {
+ return true;
+ } else {
+ return mTTDynamos.size() > 0 || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true);
+ }
+ }
+
+
+ public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
+ int injected = 0;
+ long totalOutput = 0L;
+ long aFirstVoltageFound = -1L;
+ boolean aFoundMixedDynamos = false;
+ Iterator var10 = this.mDynamoHatches.iterator();
+
+ long aVoltage;
+ while(var10.hasNext()) {
+ GT_MetaTileEntity_Hatch_Dynamo aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var10.next();
+ if (aDynamo == null) {
+ return false;
+ }
+
+ if (isValidMetaTileEntity(aDynamo)) {
+ aVoltage = aDynamo.maxEUOutput();
+ long aTotal = aDynamo.maxAmperesOut() * aVoltage;
+ if (aFirstVoltageFound == -1L) {
+ aFirstVoltageFound = aVoltage;
+ } else if (aFirstVoltageFound != aVoltage) {
+ aFoundMixedDynamos = true;
+ }
+
+ totalOutput += aTotal;
+ }
+ }
+
+ if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) {
+ this.explodeMultiblock();
+ return false;
+ } else {
+ Iterator var17 = this.mDynamoHatches.iterator();
+
+ while(true) {
+ GT_MetaTileEntity_Hatch_Dynamo aDynamo;
+ do {
+ if (!var17.hasNext()) {
+ return injected > 0;
+ }
+
+ aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var17.next();
+ } while(!isValidMetaTileEntity(aDynamo));
+
+ long leftToInject = aEU - (long)injected;
+ aVoltage = aDynamo.maxEUOutput();
+ int aAmpsToInject = (int)(leftToInject / aVoltage);
+ int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage);
+ int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), (long)aAmpsToInject);
+
+ for(int i = 0; i < ampsOnCurrentHatch; ++i) {
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false);
+ }
+
+ injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch);
+ if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits((long)aRemainder, false);
+ injected += aRemainder;
+ }
+ }
+ }
+ }
+
+
+
+ public boolean drainEnergyInput(long aEU) {
+ if (aEU <= 0L) {
+ return true;
+ } else {
+ {
+ Iterator var3 = this.mTTEnerys.iterator();
+
+ GT_MetaTileEntity_Hatch_EnergyMulti tHatch;
+ do {
+ if (!var3.hasNext()) {
+ return false;
+ }
+
+ tHatch = (GT_MetaTileEntity_Hatch_EnergyMulti)var3.next();
+ } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false));
+ }
+ {
+ Iterator var3 = this.mEnergyHatches.iterator();
+
+ GT_MetaTileEntity_Hatch_Energy tHatch;
+ do {
+ if (!var3.hasNext()) {
+ return false;
+ }
+
+ tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next();
+ } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false));
+ }
+
+ return true;
+ }
+ }
+} \ No newline at end of file