Code style fixes

This commit is contained in:
Raoul Van den Berge
2016-03-25 22:22:31 +01:00
parent 25b302f914
commit 002b5c0dda

View File

@@ -49,13 +49,11 @@ public class GuiController extends GuiBase {
scrollbar.draw(this);
}
private int calculateOffsetOnScale(int pos ,float scale)
{
float multiplier = (pos / scale);
return (int)multiplier;
private int calculateOffsetOnScale(int pos, float scale) {
float multiplier = (pos / scale);
return (int) multiplier;
}
@Override
public void drawForeground(int mouseX, int mouseY) {
scrollbar.update(this, mouseX, mouseY);
@@ -70,8 +68,6 @@ public class GuiController extends GuiBase {
RenderHelper.enableGUIStandardItemLighting();
ItemStack hoveringMachineStack = null;
for (int i = 0; i < 4; ++i) {
if (slot < controller.getMachines().size()) {
TileMachine machine = controller.getMachines().get(slot);
@@ -80,17 +76,13 @@ public class GuiController extends GuiBase {
ItemStack machineStack = new ItemStack(machineBlock, 1, machineBlock.getMetaFromState(machineState));
if (inBounds(x, y, 16, 16, mouseX, mouseY)) {
hoveringMachineStack = machineStack;
}
drawItem(x, y+5, machineStack);
drawItem(x, y + 5, machineStack);
GlStateManager.pushMatrix();
float scale = 0.5f;
GlStateManager.scale(scale,scale,1);
drawString(calculateOffsetOnScale(x+1,scale) , calculateOffsetOnScale(y-3,scale), machineStack.getDisplayName());
drawString(calculateOffsetOnScale(x+21,scale), calculateOffsetOnScale(y+10,scale),t("misc.refinedstorage:energy_usage_minimal", machine.getEnergyUsage()));
GlStateManager.scale(scale, scale, 1);
drawString(calculateOffsetOnScale(x + 1, scale), calculateOffsetOnScale(y - 3, scale), machineStack.getDisplayName());
drawString(calculateOffsetOnScale(x + 21, scale), calculateOffsetOnScale(y + 10, scale), t("misc.refinedstorage:energy_usage_minimal", machine.getEnergyUsage()));
GlStateManager.popMatrix();
}
@@ -104,13 +96,6 @@ public class GuiController extends GuiBase {
slot++;
}
/* Not needed?
if (hoveringMachineStack != null) {
drawTooltip(mouseX, mouseY, hoveringMachineStack);
}
*/
if (inBounds(barX, barY, barWidth, barHeight, mouseX, mouseY)) {
drawTooltip(mouseX, mouseY, t("misc.refinedstorage:energy_usage", controller.getEnergyUsage()) + "\n" + t("misc.refinedstorage:energy_stored", controller.getEnergyStored(null), controller.getMaxEnergyStored(null)));
}