Added average eu change to the aesu.
This commit is contained in:
parent
755c64369a
commit
63fa58eb24
4 changed files with 26 additions and 2 deletions
|
@ -62,7 +62,7 @@ public class ContainerAesu extends TechRebornContainer {
|
||||||
if(this.storedEu != tile.energy){
|
if(this.storedEu != tile.energy){
|
||||||
icrafting.sendProgressBarUpdate(this, 1, (int) tile.energy);
|
icrafting.sendProgressBarUpdate(this, 1, (int) tile.energy);
|
||||||
}
|
}
|
||||||
if(this.euChange != tile.getEuChange()){
|
if(this.euChange != tile.getEuChange() && tile.getEuChange() != -1){
|
||||||
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
|
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ public class ConfigTechReborn {
|
||||||
public static int CentrifugeInputTick;
|
public static int CentrifugeInputTick;
|
||||||
public static int DragoneggsiphonerOutput;
|
public static int DragoneggsiphonerOutput;
|
||||||
public static int heatGeneratorOutput;
|
public static int heatGeneratorOutput;
|
||||||
|
public static int aveargeEuOutTickTime;
|
||||||
// Charge
|
// Charge
|
||||||
public static int AdvancedDrillCharge;
|
public static int AdvancedDrillCharge;
|
||||||
public static int LapotronPackCharge;
|
public static int LapotronPackCharge;
|
||||||
|
@ -559,6 +560,14 @@ public class ConfigTechReborn {
|
||||||
StatCollector
|
StatCollector
|
||||||
.translateToLocal("config.techreborn.thermalGeneratorMaxCharge.tooltip"))
|
.translateToLocal("config.techreborn.thermalGeneratorMaxCharge.tooltip"))
|
||||||
.getInt();
|
.getInt();
|
||||||
|
aveargeEuOutTickTime = config
|
||||||
|
.get(CATEGORY_POWER,
|
||||||
|
StatCollector
|
||||||
|
.translateToLocal("config.techreborn.aveargeEuOutTickTime"),
|
||||||
|
100,
|
||||||
|
StatCollector
|
||||||
|
.translateToLocal("config.techreborn.aveargeEuOutTickTime.tooltip"))
|
||||||
|
.getInt();
|
||||||
|
|
||||||
// Teir
|
// Teir
|
||||||
AdvancedDrillTier = config
|
AdvancedDrillTier = config
|
||||||
|
|
|
@ -4,6 +4,7 @@ import ic2.api.tile.IWrenchable;
|
||||||
import ic2.core.block.wiring.TileEntityElectricBlock;
|
import ic2.core.block.wiring.TileEntityElectricBlock;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.util.Inventory;
|
import techreborn.util.Inventory;
|
||||||
import techreborn.util.LogHelper;
|
import techreborn.util.LogHelper;
|
||||||
|
@ -17,6 +18,8 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
||||||
public Inventory inventory = new Inventory(2, "TileAesu", 64);
|
public Inventory inventory = new Inventory(2, "TileAesu", 64);
|
||||||
private int OUTPUT = 64; //The current output
|
private int OUTPUT = 64; //The current output
|
||||||
private double euLastTick = 0;
|
private double euLastTick = 0;
|
||||||
|
private double euChange;
|
||||||
|
private int ticks;
|
||||||
|
|
||||||
public TileAesu()
|
public TileAesu()
|
||||||
{
|
{
|
||||||
|
@ -27,6 +30,13 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
||||||
public void updateEntity()
|
public void updateEntity()
|
||||||
{
|
{
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
if(ticks == ConfigTechReborn.aveargeEuOutTickTime){
|
||||||
|
euChange = -1;
|
||||||
|
ticks = 0;
|
||||||
|
} else {
|
||||||
|
ticks ++;
|
||||||
|
euChange += energy - euLastTick;
|
||||||
|
}
|
||||||
euLastTick = energy;
|
euLastTick = energy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +127,10 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getEuChange(){
|
public double getEuChange(){
|
||||||
return energy - euLastTick;
|
if(euChange == -1){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return (euChange / ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -760,6 +760,8 @@ config.techreborn.centrifugeMaxCharge=Maximum charge for Centrifuge
|
||||||
config.techreborn.centrifugeMaxCharge.tooltip=
|
config.techreborn.centrifugeMaxCharge.tooltip=
|
||||||
config.techreborn.thermalGeneratorMaxCharge=Maximum charge for Thermal Generator
|
config.techreborn.thermalGeneratorMaxCharge=Maximum charge for Thermal Generator
|
||||||
config.techreborn.thermalGeneratorMaxCharge.tooltip=
|
config.techreborn.thermalGeneratorMaxCharge.tooltip=
|
||||||
|
config.techreborn.aveargeEuOutTickTim=Eu out time
|
||||||
|
config.techreborn.aveargeEuOutTickTime.tooltip=How often in ticks to update the eu out
|
||||||
|
|
||||||
#ConfigGui
|
#ConfigGui
|
||||||
config.techreborn.category.general=General Configs
|
config.techreborn.category.general=General Configs
|
||||||
|
|
Loading…
Add table
Reference in a new issue