aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-12-15 12:14:47 +1000
committerGitHub <noreply@github.com>2017-12-15 12:14:47 +1000
commit0b65e63e3705fc9ead2ddcb71e9da4ad808a2959 (patch)
tree80ed822de0fe5cb4514bd556d87d3d47bfd51488 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
parent0812789124d018247c614a6a6a360881f34be545 (diff)
downloadGT5-Unofficial-0b65e63e3705fc9ead2ddcb71e9da4ad808a2959.tar.gz
GT5-Unofficial-0b65e63e3705fc9ead2ddcb71e9da4ad808a2959.tar.bz2
GT5-Unofficial-0b65e63e3705fc9ead2ddcb71e9da4ad808a2959.zip
Add TecTech support (#166)
+ Added check for TecTech mod. + Added TecTech support to my Base Multiblock. + Added TecTech support to my Power-Substation. + Added TecTech support to my Generator Array. % Made GT++ load after a few more mods that were recently added. $ Fixed else statement for computronics load message during startup. $ By now supporting Multi-amp Dynamos, this closes #161.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java30
2 files changed, 28 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java
index eb7b1eb712..a6b3944a06 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java
@@ -6,12 +6,12 @@ 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_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.fluid.FluidUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
@@ -22,7 +22,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
-public class GregtechMetaTileEntityGeneratorArray extends GT_MetaTileEntity_MultiBlockBase {
+public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase {
GT_Recipe mLastRecipe;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
index a163215459..54365f63d7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import gregtech.api.GregTech_API;
@@ -8,12 +9,14 @@ import gregtech.api.enums.Textures;
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_Energy;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
@@ -34,6 +37,9 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
protected long mTotalEnergyConsumed = 0;
protected long mTotalEnergyLost = 0;
protected long mTotalRunTime = 0;
+
+ //TecTech Support
+ public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList();
public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -246,14 +252,30 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
}
}
}
+
+ /**
+ * TecTech Support, this allows adding Multi-Amp dynamos.
+ */
+ if (this.mDynamoHatches.size() > 0){
+ for (GT_MetaTileEntity_Hatch_Dynamo o : this.mDynamoHatches){
+ mAllDynamoHatches.add(o);
+ }
+ }
+ if (LoadedMods.TecTech && this.mMultiDynamoHatches.size() > 0){
+ for (GT_MetaTileEntity_Hatch o : this.mMultiDynamoHatches){
+ mAllDynamoHatches.add(o);
+ }
+ }
+
+
if ((this.mChargeHatches.size() < 1) || (this.mDischargeHatches.size() < 1)
|| (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() < 1)
- || (this.mDynamoHatches.size() < 1)) {
+ || (this.mAllDynamoHatches.size() < 1)) {
Utils.LOG_MACHINE_INFO("Returned False 3");
Utils.LOG_MACHINE_INFO("Charge Buses: "+this.mChargeHatches.size()+" | expected: 1 | "+(this.mChargeHatches.size() != 1));
Utils.LOG_MACHINE_INFO("Discharge Buses: "+this.mDischargeHatches.size()+" | expected: 1 | "+(this.mDischargeHatches.size() != 1));
Utils.LOG_MACHINE_INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: >= 1 | "+(this.mEnergyHatches.size() < 1));
- Utils.LOG_MACHINE_INFO("Dynamo Hatches: "+this.mDynamoHatches.size()+" | expected: >= 1 | "+(this.mDynamoHatches.size() < 1));
+ Utils.LOG_MACHINE_INFO("Dynamo Hatches: "+this.mAllDynamoHatches.size()+" | expected: >= 1 | "+(this.mAllDynamoHatches.size() < 1));
Utils.LOG_MACHINE_INFO("Maint. Hatches: "+this.mMaintenanceHatches.size()+" | expected: 1 | "+(this.mMaintenanceHatches.size() != 1));
return false;
}
@@ -265,7 +287,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
tempAvg += re.getInputTier();
hatchCount++;
}
- for (GT_MetaTileEntity_Hatch_Dynamo re : this.mDynamoHatches){
+ for (GT_MetaTileEntity_Hatch re : this.mAllDynamoHatches){
tempAvg += re.getOutputTier();
hatchCount++;
}
@@ -493,7 +515,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
}
hatchCount++;
}
- for (GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) {
+ for (GT_MetaTileEntity_Hatch tHatch : this.mAllDynamoHatches) {
//Utils.LOG_INFO("Storing Power in a Dynamo Hatch");
if ((isValidMetaTileEntity(tHatch)) && (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(tHatch.getOutputTier()*2, false))) {
this.setEUVar(this.getEUVar()-(tHatch.getOutputTier()*2));