Lineup batteries and energy storages.

This commit is contained in:
drcrazy 2020-01-13 15:35:59 +03:00
parent b9c8a1a215
commit 342043dbba
10 changed files with 50 additions and 64 deletions

View file

@ -45,12 +45,15 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
public int superconductors = 0;
public AdjustableSUBlockEntity() {
super(TRBlockEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnergyTier.INSANE, TechRebornConfig.aesuMaxInput, TechRebornConfig.aesuMaxOutput, TechRebornConfig.aesuMaxEnergy);
super(TRBlockEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnergyTier.INSANE, TechRebornConfig.aesuMaxEnergy);
}
@Override
public void tick() {
super.tick();
if (world == null){
return;
}
if (OUTPUT > getMaxConfigOutput()) {
OUTPUT = getMaxConfigOutput();
@ -97,7 +100,7 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
toTag(blockEntity);
dropStack.setTag(new CompoundTag());
dropStack.getTag().put("blockEntity", blockEntity);
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
return dropStack;
}

View file

@ -51,14 +51,14 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity
public int maxOutput;
public int maxStorage;
public EnergyStorageBlockEntity(BlockEntityType<?> blockEntityType, String name, int invSize, Block wrenchDrop, EnergyTier tier, int maxInput, int maxOuput, int maxStorage) {
public EnergyStorageBlockEntity(BlockEntityType<?> blockEntityType, String name, int invSize, Block wrenchDrop, EnergyTier tier, int maxStorage) {
super(blockEntityType);
inventory = new RebornInventory<>(invSize, name + "BlockEntity", 64, this);
this.wrenchDrop = wrenchDrop;
this.tier = tier;
this.name = name;
this.maxInput = maxInput;
this.maxOutput = maxOuput;
this.maxInput = tier.getMaxInput();
this.maxOutput = tier.getMaxOutput();
this.maxStorage = maxStorage;
// Call it again after we have proper values for energy I\O
checkTier();
@ -76,11 +76,8 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity
if (Energy.valid(stack)) {
Energy.of(this)
.into(
Energy
.of(stack)
)
.move();
.into(Energy.of(stack))
.move(tier.getMaxInput());
}
}
if (!inventory.getInvStack(1).isEmpty()) {

View file

@ -39,10 +39,10 @@ import techreborn.init.TRContent;
public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
/**
* MFSU should store 40M FE with 2048 FE/t I/O
* MFSU should store 4M Energy with 512 E/t I/O
*/
public HighVoltageSUBlockEntity() {
super(TRBlockEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnergyTier.HIGH, 512, 512, 10_000_000);
super(TRBlockEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnergyTier.HIGH, 4_000_000);
}
@Override

View file

@ -38,7 +38,7 @@ import techreborn.init.TRContent;
public class LowVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public LowVoltageSUBlockEntity() {
super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnergyTier.LOW, 32, 32, 40000);
super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnergyTier.LOW, 40_000);
}
@Override

View file

@ -39,10 +39,10 @@ import techreborn.init.TRContent;
public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
/**
* MFE should store 1.2M FE with 512 FE/t I/O
* MFE should store 300k energy with 128 E/t I/O
*/
public MediumVoltageSUBlockEntity() {
super(TRBlockEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnergyTier.MEDIUM, 128, 128, 300000);
super(TRBlockEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnergyTier.MEDIUM, 300_000);
}
@Override

View file

@ -45,7 +45,7 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
private double clientEnergy;
public InterdimensionalSUBlockEntity() {
super(TRBlockEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnergyTier.EXTREME, TechRebornConfig.idsuMaxInput, TechRebornConfig.idsuMaxOutput, TechRebornConfig.idsuMaxEnergy);
super(TRBlockEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnergyTier.INSANE, TechRebornConfig.idsuMaxEnergy);
}
@Override

View file

@ -47,7 +47,7 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
private ArrayList<LesuNetwork> countedNetworks = new ArrayList<>();
public LapotronicSUBlockEntity() {
super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnergyTier.INSANE, 8192, TechRebornConfig.lesuBaseOutput, 1_000_000);
super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnergyTier.LOW, 1_000_000);
checkOverfill = false;
}
@ -80,7 +80,7 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
}
setMaxStorage();
maxOutput = (connectedBlocks * TechRebornConfig.lesuExtraIOPerBlock) + TechRebornConfig.lesuBaseOutput;
maxOutput = (connectedBlocks * TechRebornConfig.lesuExtraIOPerBlock) + tier.getMaxOutput();
if (getEnergy() > getMaxStoredPower()) {
setEnergy(getMaxStoredPower());