[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 20:05:27 -08:00
1 parent 75574797e2
commit b7fab1a5aa
16 files changed
+191 -167

No files matched your search

@@ -1,18 +1,13 @@
/*
*This file is modified based on
*https://github.com/DimensionalDevelopment/VanillaFix/blob/99cb47cc05b4790e8ef02bbcac932b21dafa107f/src/main/java/org/dimdev/vanillafix/crashes/GuiProblemScreen.java
*The source file uses the MIT License.
* This file is modified based on
* https://github.com/DimensionalDevelopment/VanillaFix/blob/99cb47cc05b4790e8ef02bbcac932b21dafa107f/src/main/java/org/
* dimdev/vanillafix/crashes/GuiProblemScreen.java The source file uses the MIT License.
*/
package vfyjxf.bettercrashes.utils;
import static vfyjxf.bettercrashes.BetterCrashesConfig.isGTNH;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.ArrayList;
@@ -20,14 +15,22 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.crash.CrashReport;
import org.apache.commons.lang3.StringUtils;
import vfyjxf.bettercrashes.BetterCrashesConfig;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class GuiProblemScreen extends GuiScreen {
@@ -52,8 +55,7 @@ public abstract class GuiProblemScreen extends GuiScreen {
private String modListString;
protected static final List<String> UNSUPPORTED_MOD_IDS = Arrays.asList();
protected List<String> detectedUnsupportedModNames;
private static final String GTNH_ISSUE_TRACKER =
"https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues?q=label%3A%22Type%3A+Crash%22";
private static final String GTNH_ISSUE_TRACKER = "https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues?q=label%3A%22Type%3A+Crash%22";
public GuiProblemScreen(CrashReport report) {
this.report = report;
@@ -63,28 +65,31 @@ public abstract class GuiProblemScreen extends GuiScreen {
public void initGui() {
mc.setIngameNotInFocus();
buttonList.clear();
buttonList.add(new GuiButton(
1,
width / 2 - 50,
height / 4 + 120 + 12,
110,
20,
I18n.format("bettercrashes.gui.common.openCrashReport")));
buttonList.add(new GuiButton(
2,
width / 2 - 50 + 115,
height / 4 + 120 + 12,
110,
20,
I18n.format("bettercrashes.gui.common.uploadReportAndCopyLink")));
buttonList.add(
new GuiButton(
1,
width / 2 - 50,
height / 4 + 120 + 12,
110,
20,
I18n.format("bettercrashes.gui.common.openCrashReport")));
buttonList.add(
new GuiButton(
2,
width / 2 - 50 + 115,
height / 4 + 120 + 12,
110,
20,
I18n.format("bettercrashes.gui.common.uploadReportAndCopyLink")));
if (BetterCrashesConfig.isGTNH) {
buttonList.add(new GuiButton(
3,
width / 2 - 50 - 15,
height / 4 + 120 + 12 + 25,
140,
20,
I18n.format("bettercrashes.gui.common.gtnhIssueTracker")));
buttonList.add(
new GuiButton(
3,
width / 2 - 50 - 15,
height / 4 + 120 + 12 + 25,
140,
20,
I18n.format("bettercrashes.gui.common.gtnhIssueTracker")));
}
}
@@ -104,11 +109,12 @@ public abstract class GuiProblemScreen extends GuiScreen {
button.enabled = false;
button.displayString = I18n.format("bettercrashes.gui.common.uploading");
Thread thread = new Thread("BetterCrashes report uploading") {
@Override
public void run() {
try {
hasteLink = CrashReportUpload.uploadToUbuntuPastebin(
"https://paste.ubuntu.com", report.getCompleteReport());
hasteLink = CrashReportUpload
.uploadToUbuntuPastebin("https://paste.ubuntu.com", report.getCompleteReport());
synchronized (button) {
button.enabled = true;
button.displayString = I18n.format("bettercrashes.gui.common.success");
@@ -175,8 +181,7 @@ public abstract class GuiProblemScreen extends GuiScreen {
drawCenteredString(
fontRendererObj,
report.getFile() != null
? "\u00A7n" + report.getFile().getName()
report.getFile() != null ? "\u00A7n" + report.getFile().getName()
: I18n.format("bettercrashes.gui.common.reportSaveFailed"),
width / 2,
y += 11,
@@ -198,7 +203,11 @@ public abstract class GuiProblemScreen extends GuiScreen {
if (hasUnsupportedMods) {
drawString(fontRendererObj, I18n.format("bettercrashes.gui.common.paragraph4_gtnh"), x, y += 10, textColor);
drawCenteredString(
fontRendererObj, StringUtils.join(detectedUnsupportedModNames, ", "), width / 2, y += 11, 0xE0E000);
fontRendererObj,
StringUtils.join(detectedUnsupportedModNames, ", "),
width / 2,
y += 11,
0xE0E000);
drawString(fontRendererObj, I18n.format("bettercrashes.gui.common.paragraph5_gtnh"), x, y += 12, textColor);
}