mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-11-01 09:09:35 +00:00
Don't use Bukkit.getLogger as the CraftServer isn't loaded at this point
This commit is contained in:
parent
67b502b6f8
commit
5c48793ecf
1 changed files with 6 additions and 6 deletions
|
|
@ -1,11 +1,11 @@
|
|||
From a7dcf39630dd48c612104b9089aef4c0c7cd8068 Mon Sep 17 00:00:00 2001
|
||||
From 3c870b8601dc19ceb1c1ee66dbc3d17e76199a38 Mon Sep 17 00:00:00 2001
|
||||
From: Suddenly <suddenly@suddenly.coffee>
|
||||
Date: Tue, 8 Jul 2014 09:44:18 +1000
|
||||
Subject: [PATCH] Safer JSON Loading
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index 9d1cb33..71ae29e 100644
|
||||
index 9d1cb33..3ef40f2 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -146,6 +146,17 @@ public class JsonList {
|
||||
|
|
@ -15,10 +15,10 @@ index 9d1cb33..71ae29e 100644
|
|||
+ // Spigot Start
|
||||
+ } catch ( java.io.FileNotFoundException ex )
|
||||
+ {
|
||||
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.INFO, "Unable to find file {0}, creating it.", this.c );
|
||||
+ a.info( "Unable to find file {0}, creating it.", this.c );
|
||||
+ } catch ( net.minecraft.util.com.google.gson.JsonSyntaxException ex )
|
||||
+ {
|
||||
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.WARNING, "Unable to read file {0}, backing it up to {0}.backup and creating new copy.", this.c );
|
||||
+ a.warn( "Unable to read file {0}, backing it up to {0}.backup and creating new copy.", this.c );
|
||||
+ File backup = new File( this.c + ".backup" );
|
||||
+ this.c.renameTo( backup );
|
||||
+ this.c.delete();
|
||||
|
|
@ -27,7 +27,7 @@ index 9d1cb33..71ae29e 100644
|
|||
IOUtils.closeQuietly(bufferedreader);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
|
||||
index 9f7de3f..fe42b9a 100644
|
||||
index 9f7de3f..1ce89c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/UserCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
||||
@@ -176,6 +176,11 @@ public class UserCache {
|
||||
|
|
@ -36,7 +36,7 @@ index 9f7de3f..fe42b9a 100644
|
|||
;
|
||||
+ // Spigot Start
|
||||
+ } catch (net.minecraft.util.com.google.gson.JsonSyntaxException ex) {
|
||||
+ org.bukkit.Bukkit.getLogger().warning( "Usercache.json is corrupted or has bad formatting. Deleting it to prevent further issues.");
|
||||
+ JsonList.a.warn( "Usercache.json is corrupted or has bad formatting. Deleting it to prevent further issues." );
|
||||
+ this.g.delete();
|
||||
+ // Spigot End
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue