Close #477 Auto-Format code with new formatting settings

This commit is contained in:
mezz committed 2015-01-26 22:26:21 -08:00
1 parent 8e92d16320
commit 5b8b0c78b0
763 files changed
+13174 -8868

No files matched your search

+19 -10
View File
@@ -4,12 +4,18 @@
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.farming.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.util.IIcon;
import org.lwjgl.opengl.GL11;
import forestry.api.farming.IFarmLogic;
import forestry.core.config.Defaults;
import forestry.core.gui.GuiForestry;
@@ -22,10 +28,6 @@ import forestry.core.gui.widgets.Widget;
import forestry.core.proxy.Proxies;
import forestry.core.utils.StringUtil;
import forestry.farming.gadgets.TileFarmPlain;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.util.IIcon;
import org.lwjgl.opengl.GL11;
public class GuiFarm extends GuiForestry<TileFarmPlain> {
@@ -46,8 +48,9 @@ public class GuiFarm extends GuiForestry<TileFarmPlain> {
// Draw icon
drawIcon(Items.water_bucket.getIconFromDamage(0), x + 3, y + 4);
if (!isFullyOpened())
if (!isFullyOpened()) {
return;
}
fontRendererObj.drawStringWithShadow(StringUtil.localize("gui.hydration"), x + 22, y + 8, fontColor.get("ledger.power.header"));
fontRendererObj.drawStringWithShadow(StringUtil.localize("gui.hydr.heat") + ":", x + 22, y + 20, fontColor.get("ledger.power.subheader"));
@@ -82,15 +85,17 @@ public class GuiFarm extends GuiForestry<TileFarmPlain> {
}
private IIcon getIconIndex() {
if (getLogic() == null)
if (getLogic() == null) {
return null;
}
return getLogic().getIcon();
}
@Override
public void draw(int startX, int startY) {
if (getLogic() == null)
if (getLogic() == null) {
return;
}
if (getIconIndex() != null) {
GL11.glDisable(GL11.GL_LIGHTING);
@@ -105,18 +110,21 @@ public class GuiFarm extends GuiForestry<TileFarmPlain> {
public ToolTip getToolTip() {
return toolTip;
}
protected final ToolTip toolTip = new ToolTip(250) {
@Override
public void refresh() {
toolTip.clear();
if (getLogic() == null)
if (getLogic() == null) {
return;
}
toolTip.add(getLogic().getName());
toolTip.add("Fertilizer: " + getLogic().getFertilizerConsumption());
toolTip.add("Water: " + getLogic().getWaterConsumption(farm.getHydrationModifier()));
}
};
}
private final TileFarmPlain farm;
public GuiFarm(EntityPlayer player, TileFarmPlain tile) {
@@ -155,8 +163,9 @@ public class GuiFarm extends GuiForestry<TileFarmPlain> {
// Fuel remaining
int fertilizerRemain = tile.getStoredFertilizerScaled(16);
if (fertilizerRemain > 0)
if (fertilizerRemain > 0) {
drawTexturedModalRect(guiLeft + 81, guiTop + 94 + 17 - fertilizerRemain, xSize, 17 - fertilizerRemain, 4, fertilizerRemain);
}
}
}