Skip to content

Commit 50ba173

Browse files
committed
Fix transformer energy distribution algorithm
1 parent f5d9b45 commit 50ba173

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/me/jddev0/ep/block/entity/TransformerBlockEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private static void transferEnergy(Level level, BlockPos blockPos, BlockState st
225225
consumerEnergyDistributed.add(0);
226226

227227
int consumptionLeft = Math.min(blockEntity.baseEnergyTransferRate,
228-
Math.min(blockEntity.energyStorage.getCapacityAsInt(), consumptionSum));
228+
Math.min(blockEntity.energyStorage.getAmountAsInt(), consumptionSum));
229229
try(Transaction transaction = Transaction.open(null)) {
230230
blockEntity.energyStorage.extract(consumptionLeft, transaction);
231231
transaction.commit();

0 commit comments

Comments
 (0)