Files
Mekanism-Community-Edition/src/main/java/mekanism/client/ApiJarPresentException.java
T
Richard Freimer 0d4b50908f Formatting and code readability cleanup (#5467)
* First pass reformatting code to be more readable (common still not done)

* Replace google common collect calls with Java calls where possible

* Remove a bunch of unnecessary parenthesis leaving clarifying ones

* Add some missing @Nonnull annotations

* Fix checking wrong type

* Remove unnecessary continue/return statements and simplify comparision check

* Pass exception instead of directly printing stack trace

* Work on cleaning up common, through config so far

* Work on cleaning up common, through integration so far

* Work on cleaning up common, through network so far

* Work on cleaning up common, through tier so far

* Remove empty constructors that get created by default anyways

* Work on cleaning up common, through transmitters so far

* Work on cleaning up common, through utils so far

* Finish cleaning up spacing for common
2019-05-11 14:13:24 -04:00

43 lines
1.3 KiB
Java

package mekanism.client;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiErrorScreen;
import net.minecraftforge.fml.client.CustomModLoadingErrorDisplayException;
/**
* Copied from EnderCore
*/
public class ApiJarPresentException extends CustomModLoadingErrorDisplayException {
private static final long serialVersionUID = 1L;
@Nonnull
private final String[] msgs;
public ApiJarPresentException(@Nonnull String[] msgs) {
super(msgs[0], new RuntimeException());
this.msgs = msgs;
}
@Override
public void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer) {
}
@Override
public void drawScreen(@Nullable GuiErrorScreen errorScreen, @Nullable FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) {
if (errorScreen == null || fontRenderer == null) {
return;
}
int y = errorScreen.height / 2 - msgs.length * 5;
for (String msg : msgs) {
if (msg != null) {
errorScreen.drawCenteredString(fontRenderer, msg, errorScreen.width / 2, y, 0xFFFFFF);
y += 10;
} else {
y += 5;
}
}
}
}