geforkt von Mirrors/Paper
7edfec9059
When loading the data .json files.
38 Zeilen
1.3 KiB
Diff
38 Zeilen
1.3 KiB
Diff
From 6e1d18cb391db54c04f8aaa084877a2dd937027b Mon Sep 17 00:00:00 2001
|
|
From: md_5 <git@md-5.net>
|
|
Date: Sat, 12 Apr 2014 15:18:27 +1000
|
|
Subject: [PATCH] Print Warning not Stack Trace.
|
|
|
|
When loading the data .json files.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
|
index 6729249..c52c853 100644
|
|
--- a/src/main/java/net/minecraft/server/JsonList.java
|
|
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
|
@@ -3,6 +3,7 @@ package net.minecraft.server;
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedWriter;
|
|
import java.io.File;
|
|
+import java.io.FileNotFoundException;
|
|
import java.io.IOException;
|
|
import java.lang.reflect.ParameterizedType;
|
|
import java.util.ArrayList;
|
|
@@ -140,7 +141,13 @@ public class JsonList {
|
|
try {
|
|
bufferedreader = Files.newReader(this.c, Charsets.UTF_8);
|
|
collection = (Collection) this.b.fromJson(bufferedreader, f);
|
|
- } finally {
|
|
+ }
|
|
+ // Spigot Start
|
|
+ catch ( FileNotFoundException ex )
|
|
+ {
|
|
+ org.bukkit.Bukkit.getServer().getLogger().warning( "Could not find file " + this.c + ", creating it." );
|
|
+ } // Spigot End
|
|
+ finally {
|
|
IOUtils.closeQuietly(bufferedreader);
|
|
}
|
|
|
|
--
|
|
1.8.3.2
|
|
|