Skip to content

Commit 28ecdb5

Browse files
Cleanup hunks in net.minecraft.crash
1 parent 56b8fc9 commit 28ecdb5

File tree

2 files changed

+5
-177
lines changed

2 files changed

+5
-177
lines changed
Lines changed: 2 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
--- before/net/minecraft/crash/CrashReport.java
22
+++ after/net/minecraft/crash/CrashReport.java
3-
@@ -13,6 +13,7 @@
4-
import java.text.SimpleDateFormat;
5-
import java.util.Date;
6-
import java.util.List;
7-
+
8-
import net.minecraft.util.ReportedException;
9-
import net.minecraft.world.gen.layer.IntCache;
10-
import net.minecraftforge.fml.relauncher.Side;
11-
@@ -116,6 +117,7 @@
3+
@@ -116,6 +116,7 @@
124
return IntCache.getCacheSizes();
135
}
146
});
157
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().enhanceCrashReport(this, this.systemDetailsCategory);
168
}
179

1810
public String getDescription()
19-
@@ -198,18 +200,19 @@
11+
@@ -198,13 +199,14 @@
2012
IOUtils.closeQuietly((Writer)printwriter);
2113
}
2214

@@ -32,102 +24,3 @@
3224
stringbuilder.append("// ");
3325
stringbuilder.append(getWittyComment());
3426
stringbuilder.append("\n\n");
35-
stringbuilder.append("Time: ");
36-
- stringbuilder.append(new SimpleDateFormat().format(new Date()));
37-
+ stringbuilder.append((new SimpleDateFormat()).format(new Date()));
38-
stringbuilder.append("\n");
39-
stringbuilder.append("Description: ");
40-
stringbuilder.append(this.description);
41-
@@ -217,7 +220,7 @@
42-
stringbuilder.append(this.getCauseStackTraceOrString());
43-
stringbuilder.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n");
44-
45-
- for (int i = 0; i < 87; i++)
46-
+ for (int i = 0; i < 87; ++i)
47-
{
48-
stringbuilder.append("-");
49-
}
50-
@@ -247,26 +250,27 @@
51-
}
52-
53-
Writer writer = null;
54-
- boolean flag;
55-
+ boolean flag1;
56-
57-
try
58-
{
59-
writer = new OutputStreamWriter(new FileOutputStream(toFile), StandardCharsets.UTF_8);
60-
writer.write(this.getCompleteReport());
61-
this.crashReportFile = toFile;
62-
- return true;
63-
+ boolean lvt_3_1_ = true;
64-
+ return lvt_3_1_;
65-
}
66-
catch (Throwable throwable)
67-
{
68-
LOGGER.error("Could not save crash report to {}", toFile, throwable);
69-
- flag = false;
70-
+ flag1 = false;
71-
}
72-
finally
73-
{
74-
IOUtils.closeQuietly(writer);
75-
}
76-
77-
- return flag;
78-
+ return flag1;
79-
}
80-
}
81-
82-
@@ -331,49 +335,13 @@
83-
84-
private static String getWittyComment()
85-
{
86-
- String[] astring = new String[]
87-
- {
88-
- "Who set us up the TNT?",
89-
- "Everything's going to plan. No, really, that was supposed to happen.",
90-
- "Uh... Did I do that?",
91-
- "Oops.",
92-
- "Why did you do that?",
93-
- "I feel sad now :(",
94-
- "My bad.",
95-
- "I'm sorry, Dave.",
96-
- "I let you down. Sorry :(",
97-
- "On the bright side, I bought you a teddy bear!",
98-
- "Daisy, daisy...",
99-
- "Oh - I know what I did wrong!",
100-
- "Hey, that tickles! Hehehe!",
101-
- "I blame Dinnerbone.",
102-
- "You should try our sister game, Minceraft!",
103-
- "Don't be sad. I'll do better next time, I promise!",
104-
- "Don't be sad, have a hug! <3",
105-
- "I just don't know what went wrong :(",
106-
- "Shall we play a game?",
107-
- "Quite honestly, I wouldn't worry myself about that.",
108-
- "I bet Cylons wouldn't have this problem.",
109-
- "Sorry :(",
110-
- "Surprise! Haha. Well, this is awkward.",
111-
- "Would you like a cupcake?",
112-
- "Hi. I'm Minecraft, and I'm a crashaholic.",
113-
- "Ooh. Shiny.",
114-
- "This doesn't make any sense!",
115-
- "Why is it breaking :(",
116-
- "Don't do that.",
117-
- "Ouch. That hurt :(",
118-
- "You're mean.",
119-
- "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]",
120-
- "There are four lights!",
121-
- "But it works on my machine."
122-
- };
123-
+ String[] astring = new String[] {"Who set us up the TNT?", "Everything's going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I'm sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don't be sad. I'll do better next time, I promise!", "Don't be sad, have a hug! <3", "I just don't know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn't worry myself about that.", "I bet Cylons wouldn't have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I'm Minecraft, and I'm a crashaholic.", "Ooh. Shiny.", "This doesn't make any sense!", "Why is it breaking :(", "Don't do that.", "Ouch. That hurt :(", "You're mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!", "But it works on my machine."};
124-
125-
try
126-
{
127-
return astring[(int)(System.nanoTime() % (long)astring.length)];
128-
}
129-
- catch (Throwable throwable)
130-
+ catch (Throwable var2)
131-
{
132-
return "Witty comment unavailable :(";
133-
}
Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
11
--- before/net/minecraft/crash/CrashReportCategory.java
22
+++ after/net/minecraft/crash/CrashReportCategory.java
3-
@@ -12,7 +12,7 @@
4-
{
5-
private final CrashReport crashReport;
6-
private final String name;
7-
- private final List<CrashReportCategory.Entry> children = Lists.newArrayList();
8-
+ private final List<CrashReportCategory.Entry> children = Lists.<CrashReportCategory.Entry>newArrayList();
9-
private StackTraceElement[] stackTrace = new StackTraceElement[0];
10-
11-
public CrashReportCategory(CrashReport report, String name)
12-
@@ -40,7 +40,7 @@
13-
{
14-
stringbuilder.append(String.format("World: (%d,%d,%d)", x, y, z));
15-
}
16-
- catch (Throwable throwable2)
17-
+ catch (Throwable var16)
18-
{
19-
stringbuilder.append("(Error finding world loc)");
20-
}
21-
@@ -60,7 +60,7 @@
22-
int i2 = (j + 1 << 4) - 1;
23-
stringbuilder.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", k, l, i1, i, j, j1, k1, l1, i2));
24-
}
25-
- catch (Throwable throwable1)
26-
+ catch (Throwable var15)
27-
{
28-
stringbuilder.append("(Error finding chunk loc)");
29-
}
30-
@@ -79,11 +79,9 @@
31-
int j4 = l2 << 9;
32-
int k4 = (k2 + 1 << 9) - 1;
33-
int j2 = (l2 + 1 << 9) - 1;
34-
- stringbuilder.append(
35-
- String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", k2, l2, i3, j3, k3, l3, i4, j4, k4, j2)
36-
- );
37-
+ stringbuilder.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", k2, l2, i3, j3, k3, l3, i4, j4, k4, j2));
38-
}
39-
- catch (Throwable throwable)
40-
+ catch (Throwable var14)
41-
{
42-
stringbuilder.append("(Error finding world loc)");
43-
}
44-
@@ -123,8 +121,11 @@
3+
@@ -123,8 +123,11 @@
454
}
465
else
476
{
@@ -55,36 +14,12 @@
5514
return this.stackTrace.length;
5615
}
5716
}
58-
@@ -135,10 +136,7 @@
59-
{
60-
StackTraceElement stacktraceelement = this.stackTrace[0];
61-
62-
- if (stacktraceelement.isNativeMethod() == s1.isNativeMethod()
63-
- && stacktraceelement.getClassName().equals(s1.getClassName())
64-
- && stacktraceelement.getFileName().equals(s1.getFileName())
65-
- && stacktraceelement.getMethodName().equals(s1.getMethodName()))
66-
+ if (stacktraceelement.isNativeMethod() == s1.isNativeMethod() && stacktraceelement.getClassName().equals(s1.getClassName()) && stacktraceelement.getFileName().equals(s1.getFileName()) && stacktraceelement.getMethodName().equals(s1.getMethodName()))
67-
{
68-
if (s2 != null != this.stackTrace.length > 1)
69-
{
70-
@@ -192,7 +190,7 @@
71-
for (StackTraceElement stacktraceelement : this.stackTrace)
72-
{
73-
builder.append("\n\tat ");
74-
- builder.append(stacktraceelement);
75-
+ builder.append((Object)stacktraceelement);
76-
}
77-
}
78-
}
79-
@@ -211,9 +209,9 @@
17+
@@ -211,7 +214,7 @@
8018
{
8119
try
8220
{
8321
- return String.format("ID #%d (%s // %s)", i, blockIn.getTranslationKey(), blockIn.getClass().getCanonicalName());
8422
+ return String.format("ID #%d (%s // %s // %s)", i, blockIn.getTranslationKey(), blockIn.getClass().getName(), blockIn.getRegistryName());
8523
}
86-
- catch (Throwable throwable)
87-
+ catch (Throwable var2)
24+
catch (Throwable throwable)
8825
{
89-
return "ID #" + i;
90-
}

0 commit comments

Comments
 (0)