ReportType.java
net.minecraft.ReportType
信息
- 全限定名:net.minecraft.ReportType
- 类型:public record
- 包:net.minecraft
- 源码路径:src/main/java/net/minecraft/ReportType.java
- 起始行号:L6
- 职责:
TODO
字段/常量
-
CRASH- 类型:
ReportType - 修饰符:
public static final - 源码定位:
L7 - 说明:
TODO
- 类型:
-
PROFILE- 类型:
ReportType - 修饰符:
public static final - 源码定位:
L46 - 说明:
TODO
- 类型:
-
TEST- 类型:
ReportType - 修饰符:
public static final - 源码定位:
L66 - 说明:
TODO
- 类型:
-
NETWORK_PROTOCOL_ERROR- 类型:
ReportType - 修饰符:
public static final - 源码定位:
L79 - 说明:
TODO
- 类型:
-
CHUNK_IO_ERROR- 类型:
ReportType - 修饰符:
public static final - 源码定位:
L103 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public String getErrorComment() @ L123
- 方法名:getErrorComment
- 源码定位:L123
- 返回类型:String
- 修饰符:public
参数:
- 无
说明:
TODO
public void appendHeader(StringBuilder builder, List<String> extraComments) @ L131
- 方法名:appendHeader
- 源码定位:L131
- 返回类型:void
- 修饰符:public
参数:
- builder: StringBuilder
- extraComments: List
说明:
TODO
代码
public record ReportType(String header, List<String> nuggets) {
public static final ReportType CRASH = new ReportType(
"Minecraft Crash Report",
List.of(
"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."
)
);
public static final ReportType PROFILE = new ReportType(
"Minecraft Profiler Results",
List.of(
"I'd Rather Be Surfing",
"Shiny numbers!",
"Am I not running fast enough? :(",
"I'm working as hard as I can!",
"Will I ever be good enough for you? :(",
"Speedy. Zoooooom!",
"Hello world",
"40% better than a crash report.",
"Now with extra numbers",
"Now with less numbers",
"Now with the same numbers",
"You should add flames to things, it makes them go faster!",
"Do you feel the need for... optimization?",
"*cracks redstone whip*",
"Maybe if you treated it better then it'll have more motivation to work faster! Poor server."
)
);
public static final ReportType TEST = new ReportType(
"Minecraft Test Report",
List.of(
"Don't mind me",
"One day I will be a real crash!",
"Booo! Haha, did I scare you?",
"Help, I'm trapped in a report factory!",
"Have I answered your question?",
"No hugs here, sorry",
"I Can't Believe It's Not A Crash Report!",
"Where's the kaboom!?"
)
);
public static final ReportType NETWORK_PROTOCOL_ERROR = new ReportType(
"Minecraft Network Protocol Error Report",
List.of(
"0xBADF00D",
"+'${`%&NO CARRIER",
"Please insert The Internet CD #4",
"Sabotage!",
"Are you sure you are not moving wrongly?",
"This time is not my fault, I promise!",
"All lines are down!",
"Maybe a shark bit some cable",
"404",
"I'm sorry, I don't speak that language",
"What we've got here is failure to communicate",
"It's the tubes, they're clogged!",
"Abort, Retry, Ignore?",
"Could be worse, I guess",
"Wait, was the last bit one or zero?",
"Too many suspicious packets",
"Don't worry, I'll be fine",
"Maybe this time it will work!",
"I heard pigeons are more reliable"
)
);
public static final ReportType CHUNK_IO_ERROR = new ReportType(
"Minecraft Chunk IO Error Report",
List.of(
"I have failed you!",
"Let's not do it again...",
"Worst magic trick ever!",
"Remember to backup your worlds regularly",
"Pirates stole your chunk!",
"Ker-chunk!",
"Ideally, this shouldn't be here",
"Let's hope it wasn't anything important",
"Computers were a mistake",
"Welp",
"Not my proudest moment",
"Who needs blocks in a block game, right?",
"This chunk is no more...it has ceased to be...this is an EX-chunk",
"loss.mca"
)
);
public String getErrorComment() {
try {
return this.nuggets.get((int)(Util.getNanos() % this.nuggets.size()));
} catch (Throwable var2) {
return "Witty comment unavailable :(";
}
}
public void appendHeader(StringBuilder builder, List<String> extraComments) {
builder.append("---- ");
builder.append(this.header());
builder.append(" ----\n");
builder.append("// ");
builder.append(this.getErrorComment());
builder.append('\n');
for (String extraComment : extraComments) {
builder.append("// ");
builder.append(extraComment);
builder.append('\n');
}
builder.append('\n');
}
}引用的其他类
- Util
- 引用位置:
方法调用 - 关联成员:
Util.getNanos()
- 引用位置: