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