Skip to content

Commit 4b81e47

Browse files
committed
Always check conversions
1 parent 7685869 commit 4b81e47

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/main/java/mekanism/common/integration/energy/fluxnetworks/FNIntegration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public long receiveEnergyL(long maxReceive, boolean simulate) {
2323
if (toInsert == 0) {
2424
return 0;
2525
}
26-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
26+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
2727
//Before we can actually execute it we need to simulate to calculate how much we can actually insert
2828
long simulatedRemainder = handler.insertEnergy(toInsert, Action.SIMULATE);
2929
if (simulatedRemainder == toInsert) {
@@ -60,7 +60,7 @@ public long extractEnergyL(long maxExtract, boolean simulate) {
6060
if (toExtract == 0) {
6161
return 0;
6262
}
63-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
63+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
6464
//Before we can actually execute it we need to simulate to calculate how much we can actually extract in our other units
6565
long simulatedExtracted = handler.extractEnergy(toExtract, Action.SIMULATE);
6666
//Convert how much we could extract back to FE so that it gets appropriately clamped so that for example 1.5 FE gets treated

src/main/java/mekanism/common/integration/energy/fluxnetworks/FNStrictEnergyHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public long insertEnergy(long amount, Action action) {
5555
if (toInsert == 0) {
5656
return amount;
5757
}
58-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
58+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
5959
//Before we can actually execute it we need to simulate to calculate how much we can actually insert
6060
long simulatedInserted = storage.receiveEnergyL(toInsert, true);
6161
if (simulatedInserted == 0) {
@@ -103,7 +103,7 @@ public long extractEnergy(long amount, Action action) {
103103
if (toExtract == 0) {
104104
return 0L;
105105
}
106-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
106+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
107107
//Before we can actually execute it we need to simulate to calculate how much we can actually extract in our other units
108108
long simulatedExtracted = storage.extractEnergyL(toExtract, true);
109109
//Convert how much we could extract back to Joules so that it gets appropriately clamped so that for example 1 Joule gets treated

src/main/java/mekanism/common/integration/energy/grandpower/GPIntegration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public long receive(long maxReceive, boolean simulate) {
2323
if (toInsert == 0) {
2424
return 0;
2525
}
26-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
26+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
2727
//Before we can actually execute it we need to simulate to calculate how much we can actually insert
2828
long simulatedRemainder = handler.insertEnergy(toInsert, Action.SIMULATE);
2929
if (simulatedRemainder == toInsert) {
@@ -60,7 +60,7 @@ public long extract(long maxExtract, boolean simulate) {
6060
if (toExtract == 0) {
6161
return 0;
6262
}
63-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
63+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
6464
//Before we can actually execute it we need to simulate to calculate how much we can actually extract in our other units
6565
long simulatedExtracted = handler.extractEnergy(toExtract, Action.SIMULATE);
6666
//Convert how much we could extract back to FE so that it gets appropriately clamped so that for example 1.5 FE gets treated

src/main/java/mekanism/common/integration/energy/grandpower/GPStrictEnergyHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public long insertEnergy(long amount, Action action) {
5555
if (toInsert == 0) {
5656
return amount;
5757
}
58-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
58+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
5959
//Before we can actually execute it we need to simulate to calculate how much we can actually insert
6060
long simulatedInserted = storage.receive(toInsert, true);
6161
if (simulatedInserted == 0) {
@@ -103,7 +103,7 @@ public long extractEnergy(long amount, Action action) {
103103
if (toExtract == 0) {
104104
return 0;
105105
}
106-
if (action.execute() && !EnergyUnit.FORGE_ENERGY.isOneToOne()) {
106+
if (!EnergyUnit.FORGE_ENERGY.isOneToOne()) {
107107
//Before we can actually execute it we need to simulate to calculate how much we can actually extract in our other units
108108
long simulatedExtracted = storage.extract(toExtract, true);
109109
//Convert how much we could extract back to Joules so that it gets appropriately clamped so that for example 1 Joule gets treated

0 commit comments

Comments
 (0)