Skip to content

Commit 57202c7

Browse files
committed
feat: Replace hard termos incompat with big warning
1 parent 2b9d807 commit 57202c7

1 file changed

Lines changed: 18 additions & 47 deletions

File tree

src/main/java/com/falsepattern/lib/internal/asm/CoreLoadingPlugin.java

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ public class CoreLoadingPlugin implements IFMLLoadingPlugin {
5656

5757
static {
5858
DeploaderStub.bootstrap(false);
59-
FPLog.LOG.info("Removing skill issues...");
6059
try {
6160
Class.forName("thermos.Thermos");
62-
FPLog.LOG.fatal("Sorry, i prefer iced coffee.");
63-
throw skillIssue("Thermos is not supported by FalsePatternLib, please use a normal forge server.");
61+
loudWarning("Thermos is not officially supported by FalsePatternLib, or any of our other mods. " +
62+
"Do not report any bugs to FalsePattern or MEGA from Thermos servers, unless " +
63+
"you're also submitting a pull request to fix it. All non Thermos-specific errors " +
64+
"MUST be reproducible in a non-Thermos environment to be considered valid.");
6465
} catch (ClassNotFoundException ignored) {
6566
}
6667
//Scan for dependencies now
@@ -75,54 +76,24 @@ public class CoreLoadingPlugin implements IFMLLoadingPlugin {
7576
CrashImprover.probe();
7677
}
7778

78-
@SuppressWarnings("SameParameterValue")
79-
private static Error skillIssue(String message) {
80-
int width = message.length();
81-
String shutup = "Any bug reports concerning this message will be silently deleted.";
82-
int suWidth = shutup.length();
83-
int padding = width - suWidth;
84-
boolean padMSG = padding < 0;
85-
if (padMSG) {
86-
padding = -padding;
79+
private static void loudWarning(String message) {
80+
val len = message.length();
81+
val lines = new StringBuilder(4 + len);
82+
lines.append("--");
83+
for (int i = 0; i < len; i++) {
84+
lines.append('-');
8785
}
88-
int padLeft = padding / 2;
89-
int padRight = padding - padLeft;
90-
int maxWidth = Math.max(width, suWidth);
91-
StringBuilder bld = new StringBuilder("\n\n");
92-
for (int i = 0; i < maxWidth + 2; i++) {
93-
bld.append('-');
86+
lines.append("--");
87+
val l = lines.toString();
88+
for (int i = 0; i < 5; i++) {
89+
FPLog.LOG.fatal(l);
9490
}
95-
bld.append("\n|");
96-
if (padMSG) {
97-
for (int i = 0; i < padLeft; i++) {
98-
bld.append(' ');
99-
}
100-
bld.append(message);
101-
for (int i = 0; i < padRight; i++) {
102-
bld.append(' ');
103-
}
104-
} else {
105-
bld.append(message);
91+
for (int i = 0; i < 5; i++) {
92+
FPLog.LOG.fatal("| {} |", message);
10693
}
107-
bld.append("|\n|");
108-
if (!padMSG) {
109-
for (int i = 0; i < padLeft; i++) {
110-
bld.append(' ');
111-
}
112-
bld.append(shutup);
113-
for (int i = 0; i < padRight; i++) {
114-
bld.append(' ');
115-
}
116-
} else {
117-
bld.append(shutup);
94+
for (int i = 0; i < 5; i++) {
95+
FPLog.LOG.fatal(l);
11896
}
119-
bld.append("|\n");
120-
for (int i = 0; i < maxWidth + 2; i++) {
121-
bld.append('-');
122-
}
123-
val skillIssue = new Error(bld.toString());
124-
skillIssue.setStackTrace(new StackTraceElement[0]);
125-
return skillIssue;
12697
}
12798

12899
@Override

0 commit comments

Comments
 (0)