Attempt to mimic clang-format

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2022-11-03 17:30:13 +00:00
parent 779bc2c63d
commit 5b9bfe8891
11 changed files with 529 additions and 157 deletions

View File

@ -68,7 +68,8 @@ import java.util.TreeMap;
/**
* WARNING: This class is reflectively accessed by legacy Forge versions.
* <p>
* Changing field and method declarations without further testing is not recommended.
* Changing field and method declarations without further testing is not
* recommended.
*/
public final class Launcher extends Applet implements AppletStub {
@ -80,11 +81,10 @@ public final class Launcher extends Applet implements AppletStub {
private final URL documentBase;
private boolean active = false;
public Launcher(Applet applet) {
this(applet, null);
}
public Launcher(Applet applet) { this(applet, null); }
public Launcher(Applet applet, URL documentBase) {
public Launcher(Applet applet, URL documentBase)
{
setLayout(new BorderLayout());
this.add(applet, "Center");
@ -108,7 +108,8 @@ public final class Launcher extends Applet implements AppletStub {
}
}
public void replace(Applet applet) {
public void replace(Applet applet)
{
wrappedApplet = applet;
applet.setStub(this);
@ -127,17 +128,14 @@ public final class Launcher extends Applet implements AppletStub {
}
@Override
public boolean isActive() {
return active;
}
public boolean isActive() { return active; }
@Override
public URL getDocumentBase() {
return documentBase;
}
public URL getDocumentBase() { return documentBase; }
@Override
public URL getCodeBase() {
public URL getCodeBase()
{
try {
// TODO: 2022-10-27 Can this be changed to https?
return new URL("http://www.minecraft.net/game/");
@ -147,7 +145,8 @@ public final class Launcher extends Applet implements AppletStub {
}
@Override
public String getParameter(String name) {
public String getParameter(String name)
{
String param = params.get(name);
if (param != null)
@ -162,62 +161,54 @@ public final class Launcher extends Applet implements AppletStub {
}
@Override
public void resize(int width, int height) {
wrappedApplet.resize(width, height);
}
public void resize(int width, int height) { wrappedApplet.resize(width, height); }
@Override
public void resize(Dimension size) {
wrappedApplet.resize(size);
}
public void resize(Dimension size) { wrappedApplet.resize(size); }
@Override
public void init() {
public void init()
{
if (wrappedApplet != null)
wrappedApplet.init();
}
@Override
public void start() {
public void start()
{
wrappedApplet.start();
active = true;
}
@Override
public void stop() {
public void stop()
{
wrappedApplet.stop();
active = false;
}
@Override
public void destroy() {
wrappedApplet.destroy();
}
public void destroy() { wrappedApplet.destroy(); }
@Override
public void appletResize(int width, int height) {
wrappedApplet.resize(width, height);
}
public void appletResize(int width, int height) { wrappedApplet.resize(width, height); }
@Override
public void setVisible(boolean visible) {
public void setVisible(boolean visible)
{
super.setVisible(visible);
wrappedApplet.setVisible(visible);
}
@Override
public void paint(Graphics graphics) {
}
public void paint(Graphics graphics) {}
@Override
public void update(Graphics graphics) {
}
public void update(Graphics graphics) {}
public void setParameter(String name, String value) {
params.put(name, value);
}
public void setParameter(String name, String value) { params.put(name, value); }
}