Fix incorrect EU-RF conversion
This commit is contained in:
parent
e9ece63a99
commit
277e5e5e45
1 changed files with 24 additions and 9 deletions
|
@ -86,7 +86,7 @@ public abstract class TilePowerAcceptor extends RFProviderTile implements
|
||||||
public double getDemandedEnergy() {
|
public double getDemandedEnergy() {
|
||||||
if (!PowerSystem.EUPOWENET)
|
if (!PowerSystem.EUPOWENET)
|
||||||
return 0;
|
return 0;
|
||||||
return getMaxInput();
|
return getMaxPower() - getEnergy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Strippable("mod:IC2")
|
@Strippable("mod:IC2")
|
||||||
|
@ -154,21 +154,21 @@ public abstract class TilePowerAcceptor extends RFProviderTile implements
|
||||||
if (!canAcceptEnergy(from)) {
|
if (!canAcceptEnergy(from)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (int) ((int) addEnergy(maxReceive, simulate) * PowerSystem.euPerRF);
|
return (int) ((int) addEnergy(maxReceive, simulate) / PowerSystem.euPerRF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyStored(ForgeDirection from) {
|
public int getEnergyStored(ForgeDirection from) {
|
||||||
if (!PowerSystem.RFPOWENET)
|
if (!PowerSystem.RFPOWENET)
|
||||||
return 0;
|
return 0;
|
||||||
return (int) ((int) getEnergy() * PowerSystem.euPerRF);
|
return (int) ((int) getEnergy() / PowerSystem.euPerRF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxEnergyStored(ForgeDirection from) {
|
public int getMaxEnergyStored(ForgeDirection from) {
|
||||||
if (!PowerSystem.RFPOWENET)
|
if (!PowerSystem.RFPOWENET)
|
||||||
return 0;
|
return 0;
|
||||||
return (int) ((int) getMaxPower() * PowerSystem.euPerRF);
|
return (int) ((int) getMaxPower() / PowerSystem.euPerRF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -178,7 +178,7 @@ public abstract class TilePowerAcceptor extends RFProviderTile implements
|
||||||
if (!canAcceptEnergy(from)) {
|
if (!canAcceptEnergy(from)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (int) ((int) useEnergy(maxExtract, simulate) * PowerSystem.euPerRF);
|
return (int) ((int) useEnergy(maxExtract, simulate) / PowerSystem.euPerRF);
|
||||||
}
|
}
|
||||||
//END COFH
|
//END COFH
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ public abstract class TilePowerAcceptor extends RFProviderTile implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getEnergy() {
|
public double getEnergy() {
|
||||||
return energy;
|
return energy / PowerSystem.euPerRF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -263,8 +263,23 @@ public abstract class TilePowerAcceptor extends RFProviderTile implements
|
||||||
@Override
|
@Override
|
||||||
public void addWailaInfo(List<String> info) {
|
public void addWailaInfo(List<String> info) {
|
||||||
super.addWailaInfo(info);
|
super.addWailaInfo(info);
|
||||||
info.add("Energy buffer Size " + getMaxPower() + "eu");
|
info.add("Energy buffer Size " + getEUString(getMaxPower()));
|
||||||
info.add("Max Input " + getMaxInput() + "eu");
|
info.add("Max Input " + getEUString(getMaxInput()));
|
||||||
info.add("Max Output " + getMaxOutput() + "eu");
|
info.add("Max Output " + getEUString(getMaxOutput()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getEUString(double euValue)
|
||||||
|
{
|
||||||
|
if (euValue >= 1000000) {
|
||||||
|
double tenX = Math.round(euValue / 100000);
|
||||||
|
return Double.toString(tenX / 10.0).concat(" m EU");
|
||||||
|
}
|
||||||
|
else if (euValue >= 1000) {
|
||||||
|
double tenX = Math.round(euValue / 100);
|
||||||
|
return Double.toString(tenX / 10.0).concat(" k EU");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Double.toString(Math.floor(euValue)).concat(" EU");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue