Fix the LESU not working

This commit is contained in:
modmuss50 2020-01-01 16:05:23 +00:00
parent de4c14542b
commit 2fc9557516

View file

@ -60,10 +60,9 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
countedNetworks.clear(); countedNetworks.clear();
connectedBlocks = 0; connectedBlocks = 0;
for (Direction dir : Direction.values()) { for (Direction dir : Direction.values()) {
BlockPos adjucentBlockPos = new BlockPos(pos.getX() + dir.getOffsetX(), BlockPos adjucentBlockPos = getPos().offset(dir);
pos.getY() + dir.getOffsetX(), pos.getZ() + dir.getOffsetX());
BlockEntity adjucent = world.getBlockEntity(adjucentBlockPos); BlockEntity adjucent = world.getBlockEntity(adjucentBlockPos);
if (adjucent == null || !(adjucent instanceof LSUStorageBlockEntity)) { if (!(adjucent instanceof LSUStorageBlockEntity)) {
continue; continue;
} }
if (((LSUStorageBlockEntity) adjucent).network == null) { if (((LSUStorageBlockEntity) adjucent).network == null) {
@ -82,6 +81,10 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
} }
setMaxStorage(); setMaxStorage();
maxOutput = (connectedBlocks * TechRebornConfig.lesuExtraIOPerBlock) + TechRebornConfig.lesuBaseOutput; maxOutput = (connectedBlocks * TechRebornConfig.lesuExtraIOPerBlock) + TechRebornConfig.lesuBaseOutput;
if (getEnergy() > getMaxStoredPower()) {
setEnergy(getMaxStoredPower());
}
} }
@Override @Override