fixed gens outputting their amps up to 6 times (#20)

* fixed gens outputting their amps up to 6 times

* change according to review
This commit is contained in:
KiloJoel authored and GitHub committed 2021-02-12 17:58:07 +01:00
1 parent e4df980eac
commit 57b7e8e841
2 files changed
+21 -8

No files matched your search

@@ -336,14 +336,19 @@ public class TileEntityBaseGenerator
if (!side)
return;
if (checkForGtTile() && isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
drainEnergyUnits((byte) 0, getOutputVoltage(), tEU);
}
}
private boolean checkForGtTile() {
for (byte i = 0; i < 6; i = (byte) (i + 1)) {
if (getIGregTechTileEntityAtSide(i) != null) {
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
drainEnergyUnits(i, getOutputVoltage(), tEU);
}
return true;
}
}
return false;
}
public byte getColorization() {
@@ -379,14 +379,22 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
}
public void inputintoGTnet() {
if (!side)
return;
if (checkForGtTile() && isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
drainEnergyUnits((byte) 0, getOutputVoltage(), tEU);
}
}
private boolean checkForGtTile() {
for (byte i = 0; i < 6; i = (byte) (i + 1)) {
if (getIGregTechTileEntityAtSide(i) != null) {
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
drainEnergyUnits(i, getOutputVoltage(), tEU);
}
return true;
}
}
return false;
}
public byte getColorization() {