Update buildscript & apply automatic formatting rules

This commit is contained in:
Raven Szewczyk authored and Jason Mitchell committed 2022-06-27 10:23:18 -07:00
1 parent a7683b885d
commit f7a900e910
173 files changed
+4581 -5321

No files matched your search

@@ -1,19 +1,17 @@
package codechicken.nei.config;
import codechicken.nei.LayoutManager;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.awt.Rectangle;
import java.util.List;
import static codechicken.lib.gui.GuiDraw.changeTexture;
import static codechicken.lib.gui.GuiDraw.drawString;
import static codechicken.lib.gui.GuiDraw.drawStringC;
import static codechicken.lib.gui.GuiDraw.getStringWidth;
public abstract class OptionButton extends Option
{
import codechicken.nei.LayoutManager;
import java.awt.Rectangle;
import java.util.List;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public abstract class OptionButton extends Option {
protected static final ResourceLocation guiTex = new ResourceLocation("textures/gui/widgets.png");
public final String prefix;
@@ -53,8 +51,7 @@ public abstract class OptionButton extends Option
}
public Rectangle buttonSize() {
if (getPrefix() == null)
return new Rectangle(0, 0, slot.slotWidth(), 20);
if (getPrefix() == null) return new Rectangle(0, 0, slot.slotWidth(), 20);
int width = Math.max(60, getStringWidth(getButtonText()));
return new Rectangle(slot.slotWidth() - width, 0, width, 20);
@@ -79,8 +76,7 @@ public abstract class OptionButton extends Option
}
public void drawPrefix() {
if (getPrefix() != null)
drawString(getPrefix(), 10, 6, -1);
if (getPrefix() != null) drawString(getPrefix(), 10, 6, -1);
}
public void drawButton(int mx, int my) {
@@ -103,9 +99,7 @@ public abstract class OptionButton extends Option
@Override
public void mouseClicked(int x, int y, int button) {
if (pointInside(x, y))
if (onClick(button))
playClickSound();
if (pointInside(x, y)) if (onClick(button)) playClickSound();
}
public boolean onClick(int button) {
@@ -114,8 +108,7 @@ public abstract class OptionButton extends Option
@Override
public List<String> handleTooltip(int mx, int my, List<String> currenttip) {
if (getTooltip() != null)
currenttip.add(getTooltip());
if (getTooltip() != null) currenttip.add(getTooltip());
return currenttip;
}
}