diff options
author | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-03-20 22:26:30 -0600 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2014-03-21 23:56:34 -0400 |
commit | 385ace970ee7b7912419d601b8a0867c4c2794df (patch) | |
tree | 2549da069930b488940f8a99833c396ffc7e36d1 /src/main/java/net/minecraft/server/CrashReport.java | |
parent | afb3511a4a5a63007217f2dbbbbc753f3bee0aed (diff) | |
download | craftbukkit-385ace970ee7b7912419d601b8a0867c4c2794df.tar craftbukkit-385ace970ee7b7912419d601b8a0867c4c2794df.tar.gz craftbukkit-385ace970ee7b7912419d601b8a0867c4c2794df.tar.lz craftbukkit-385ace970ee7b7912419d601b8a0867c4c2794df.tar.xz craftbukkit-385ace970ee7b7912419d601b8a0867c4c2794df.zip |
Update CraftBukkit to Minecraft 1.7.5
Diffstat (limited to 'src/main/java/net/minecraft/server/CrashReport.java')
-rw-r--r-- | src/main/java/net/minecraft/server/CrashReport.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/CrashReport.java b/src/main/java/net/minecraft/server/CrashReport.java index aa9e9f71..7e060027 100644 --- a/src/main/java/net/minecraft/server/CrashReport.java +++ b/src/main/java/net/minecraft/server/CrashReport.java @@ -181,9 +181,14 @@ public class CrashReport { StackTraceElement[] astacktraceelement = this.c.getStackTrace(); StackTraceElement stacktraceelement = null; StackTraceElement stacktraceelement1 = null; + int k = astacktraceelement.length - j; - if (astacktraceelement != null && astacktraceelement.length - j < astacktraceelement.length) { - stacktraceelement = astacktraceelement[astacktraceelement.length - j]; + if (k < 0) { + System.out.println("Negative index in crash report handler (" + astacktraceelement.length + "/" + j + ")"); + } + + if (astacktraceelement != null && 0 <= k && k < astacktraceelement.length) { + stacktraceelement = astacktraceelement[k]; if (astacktraceelement.length + 1 - j < astacktraceelement.length) { stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - j]; } @@ -194,7 +199,7 @@ public class CrashReport { CrashReportSystemDetails crashreportsystemdetails1 = (CrashReportSystemDetails) this.e.get(this.e.size() - 1); crashreportsystemdetails1.b(j); - } else if (astacktraceelement != null && astacktraceelement.length >= j) { + } else if (astacktraceelement != null && astacktraceelement.length >= j && 0 <= k && k < astacktraceelement.length) { this.h = new StackTraceElement[astacktraceelement.length - j]; System.arraycopy(astacktraceelement, 0, this.h, 0, this.h.length); } else { @@ -207,7 +212,7 @@ public class CrashReport { } private static String i() { - 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!"}; + 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."}; try { return astring[(int) (System.nanoTime() % (long) astring.length)]; |