Properly convert to configured display units Wind Turbine

This commit is contained in:
Aidan C. Brady 2015-03-24 11:01:17 -04:00
parent 1cc277f2d9
commit ab3064b591
2 changed files with 16 additions and 1 deletions

View file

@ -1213,6 +1213,21 @@ public final class MekanismUtils
return energy;
}
}
public static double convertToDisplay(double energy)
{
switch(general.activeType)
{
case RF:
return energy * general.TO_TE;
case EU:
return energy * general.TO_IC2;
case MJ:
return energy * general.TO_TE / 10;
default:
return energy;
}
}
/**
* Gets a rounded energy display of a defined amount of energy.

View file

@ -59,7 +59,7 @@ public class GuiWindTurbine extends GuiMekanism
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
fontRendererObj.drawString(MekanismUtils.localize("gui.power") + ": " + powerFormat.format(generators.windGenerationMin*tileEntity.getMultiplier()), 51, 35, 0x00CD00);
fontRendererObj.drawString(MekanismUtils.localize("gui.power") + ": " + powerFormat.format(MekanismUtils.convertToDisplay(generators.windGenerationMin*tileEntity.getMultiplier())), 51, 35, 0x00CD00);
fontRendererObj.drawString(MekanismUtils.localize("gui.out") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t", 51, 44, 0x00CD00);
int size = 44;