This repository has been archived by the owner on May 26, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix json cache crash, handle the file much more cleanly. Probably an …
…MC JIRA since it's a vanilla bug. Closes #619
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
patches/minecraft/net/minecraft/server/management/PlayerProfileCache.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- ../src-base/minecraft/net/minecraft/server/management/PlayerProfileCache.java | ||
+++ ../src-work/minecraft/net/minecraft/server/management/PlayerProfileCache.java | ||
@@ -224,26 +224,12 @@ | ||
{ | ||
List list = null; | ||
BufferedReader bufferedreader = null; | ||
- label81: | ||
{ | ||
try | ||
{ | ||
bufferedreader = Files.newReader(this.field_152665_g, Charsets.UTF_8); | ||
list = (List)this.field_152660_b.fromJson(bufferedreader, field_152666_h); | ||
- break label81; | ||
- } | ||
- catch (FileNotFoundException filenotfoundexception) | ||
- { | ||
- ; | ||
- } | ||
- finally | ||
- { | ||
- IOUtils.closeQuietly(bufferedreader); | ||
- } | ||
|
||
- return; | ||
- } | ||
- | ||
if (list != null) | ||
{ | ||
this.field_152661_c.clear(); | ||
@@ -268,6 +254,20 @@ | ||
} | ||
} | ||
} | ||
+ } | ||
+ catch (FileNotFoundException filenotfoundexception) | ||
+ { | ||
+ ; | ||
+ } | ||
+ catch (com.google.gson.JsonParseException parsefail) | ||
+ { | ||
+ // No op - the cache can quietly rebuild if it's junk | ||
+ } | ||
+ finally | ||
+ { | ||
+ IOUtils.closeQuietly(bufferedreader); | ||
+ } | ||
+ } | ||
} | ||
|
||
public void func_152658_c() |