ReportType .java

net.minecraft.ReportType (record): members: header, nuggets, NETWORK_PROTOCOL_ERROR, getErrorComment, CHUNK_IO_ERROR, appendHeader, CRASH, TEST, PROFILE.

net.minecraftrecord148 linescommon4.4 KB

API Surface (3)

record ReportType(String header, List<String> nuggets)
String getErrorComment()
void appendHeader(final StringBuilder builder, final List<String> extraComments)

Fields & Constants (5)

CRASH
PROFILE
TEST
NETWORK_PROTOCOL_ERROR
CHUNK_IO_ERROR

String literals (88)

"Minecraft Crash Report"
"Who set us up the TNT?"
"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, have a hug! <3"
"I just don't know what went wrong :("
"Shall we play a game?"
"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."

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ReportType.java148 lines · Minecraft 26.3 · verbatim
1
package net.minecraft;
2
3
import java.util.List;
4
import net.minecraft.util.Util;
5
6
public record ReportType(String header, List<String> nuggets) {
7
	public static final ReportType CRASH = new ReportType(
8
		"Minecraft Crash Report",
9
		List.of(
10
			"Who set us up the TNT?",
11
			"Everything's going to plan. No, really, that was supposed to happen.",
12
			"Uh... Did I do that?",
13
			"Oops.",
14
			"Why did you do that?",
15
			"I feel sad now :(",
16
			"My bad.",
17
			"I'm sorry, Dave.",
18
			"I let you down. Sorry :(",
19
			"On the bright side, I bought you a teddy bear!",
20
			"Daisy, daisy...",
21
			"Oh - I know what I did wrong!",
22
			"Hey, that tickles! Hehehe!",
23
			"I blame Dinnerbone.",
24
			"You should try our sister game, Minceraft!",
25
			"Don't be sad. I'll do better next time, I promise!",
26
			"Don't be sad, have a hug! <3",
27
			"I just don't know what went wrong :(",
28
			"Shall we play a game?",
29
			"Quite honestly, I wouldn't worry myself about that.",
30
			"I bet Cylons wouldn't have this problem.",
31
			"Sorry :(",
32
			"Surprise! Haha. Well, this is awkward.",
33
			"Would you like a cupcake?",
34
			"Hi. I'm Minecraft, and I'm a crashaholic.",
35
			"Ooh. Shiny.",
36
			"This doesn't make any sense!",
37
			"Why is it breaking :(",
38
			"Don't do that.",
39
			"Ouch. That hurt :(",
40
			"You're mean.",
41
			"This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]",
42
			"There are four lights!",
43
			"But it works on my machine."
44
		)
45
	);
46
	public static final ReportType PROFILE = new ReportType(
47
		"Minecraft Profiler Results",
48
		List.of(
49
			"I'd Rather Be Surfing",
50
			"Shiny numbers!",
51
			"Am I not running fast enough? :(",
52
			"I'm working as hard as I can!",
53
			"Will I ever be good enough for you? :(",
54
			"Speedy. Zoooooom!",
55
			"Hello world",
56
			"40% better than a crash report.",
57
			"Now with extra numbers",
58
			"Now with less numbers",
59
			"Now with the same numbers",
60
			"You should add flames to things, it makes them go faster!",
61
			"Do you feel the need for... optimization?",
62
			"*cracks redstone whip*",
63
			"Maybe if you treated it better then it'll have more motivation to work faster! Poor server."
64
		)
65
	);
66
	public static final ReportType TEST = new ReportType(
67
		"Minecraft Test Report",
68
		List.of(
69
			"Don't mind me",
70
			"One day I will be a real crash!",
71
			"Booo! Haha, did I scare you?",
72
			"Help, I'm trapped in a report factory!",
73
			"Have I answered your question?",
74
			"No hugs here, sorry",
75
			"I Can't Believe It's Not A Crash Report!",
76
			"Where's the kaboom!?"
77
		)
78
	);
79
	public static final ReportType NETWORK_PROTOCOL_ERROR = new ReportType(
80
		"Minecraft Network Protocol Error Report",
81
		List.of(
82
			"0xBADF00D",
83
			"+'${`%&NO CARRIER",
84
			"Please insert The Internet CD #4",
85
			"Sabotage!",
86
			"Are you sure you are not moving wrongly?",
87
			"This time is not my fault, I promise!",
88
			"All lines are down!",
89
			"Maybe a shark bit some cable",
90
			"404",
91
			"I'm sorry, I don't speak that language",
92
			"What we've got here is failure to communicate",
93
			"It's the tubes, they're clogged!",
94
			"Abort, Retry, Ignore?",
95
			"Could be worse, I guess",
96
			"Wait, was the last bit one or zero?",
97
			"Too many suspicious packets",
98
			"Don't worry, I'll be fine",
99
			"Maybe this time it will work!",
100
			"I heard pigeons are more reliable"
101
		)
102
	);
103
	public static final ReportType CHUNK_IO_ERROR = new ReportType(
104
		"Minecraft Chunk IO Error Report",
105
		List.of(
106
			"I have failed you!",
107
			"Let's not do it again...",
108
			"Worst magic trick ever!",
109
			"Remember to backup your worlds regularly",
110
			"Pirates stole your chunk!",
111
			"Ker-chunk!",
112
			"Ideally, this shouldn't be here",
113
			"Let's hope it wasn't anything important",
114
			"Computers were a mistake",
115
			"Welp",
116
			"Not my proudest moment",
117
			"Who needs blocks in a block game, right?",
118
			"This chunk is no more...it has ceased to be...this is an EX-chunk",
119
			"loss.mca"
120
		)
121
	);
122
123
	public String getErrorComment() {
124
		try {
125
			return this.nuggets.get((int)(Util.getNanos() % this.nuggets.size()));
126
		} catch (Throwable ignored) {
127
			return "Witty comment unavailable :(";
128
		}
129
	}
130
131
	public void appendHeader(final StringBuilder builder, final List<String> extraComments) {
132
		builder.append("---- ");
133
		builder.append(this.header());
134
		builder.append(" ----\n");
135
		builder.append("// ");
136
		builder.append(this.getErrorComment());
137
		builder.append('\n');
138
139
		for (String extraComment : extraComments) {
140
			builder.append("// ");
141
			builder.append(extraComment);
142
			builder.append('\n');
143
		}
144
145
		builder.append('\n');
146
	}
147
}
148

Decompiled Minecraft 26.3 source of ReportType (net/minecraft/ReportType.java) with Mojang official mappings, stored verbatim on the site.