Fix generators and solar panel not working without an adjacent GT tile (#37)

This commit is contained in:
Vladislav Laetansky authored and GitHub committed 2022-07-31 10:33:09 +02:00
1 parent c07eb27064
commit 53616d5ba6
3 files changed
+3 -21

No files matched your search

@@ -336,21 +336,12 @@ public class TileEntityBaseGenerator
if (!side)
return;
if (checkForGtTile() && isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
if (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) {
return true;
}
}
return false;
}
public byte getColorization() {
return this.color;
}
@@ -384,21 +384,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
if (!side)
return;
if (checkForGtTile() && isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
if (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) {
return true;
}
}
return false;
}
public byte getColorization() {
return this.color;
}