summaryrefslogtreecommitdiffstats
path: root/nms-patches/NameReferencingFileConverter.patch
blob: 9a64629b59807150e9b32ad9c9d906ccc90b20fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--- ../work/decompile-8eb82bde//net/minecraft/server/NameReferencingFileConverter.java	2014-11-28 11:22:56.082823160 +0000
+++ src/main/java/net/minecraft/server/NameReferencingFileConverter.java	2014-11-28 11:01:54.000000000 +0000
@@ -32,7 +32,7 @@
     public static final File c = new File("ops.txt");
     public static final File d = new File("white-list.txt");
 
-    static List a(File file, Map map) {
+    static List a(File file, Map map) throws IOException { // CraftBukkit - Added throws
         List list = Files.readLines(file, Charsets.UTF_8);
         Iterator iterator = list.iterator();
 
@@ -77,9 +77,11 @@
             if (gameprofilebanlist.c().exists()) {
                 try {
                     gameprofilebanlist.load();
-                } catch (FileNotFoundException filenotfoundexception) {
-                    NameReferencingFileConverter.e.warn("Could not load existing file " + gameprofilebanlist.c().getName(), filenotfoundexception);
+                // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace                
+                } catch (IOException filenotfoundexception) {
+                    e.warn("Could not load existing file " + gameprofilebanlist.c().getName() + ", " + filenotfoundexception.getMessage());
                 }
+                // CraftBukkit end
             }
 
             try {
@@ -111,9 +113,11 @@
             if (ipbanlist.c().exists()) {
                 try {
                     ipbanlist.load();
-                } catch (FileNotFoundException filenotfoundexception) {
-                    NameReferencingFileConverter.e.warn("Could not load existing file " + ipbanlist.c().getName(), filenotfoundexception);
+                // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace
+                } catch (IOException filenotfoundexception) {
+                    e.warn("Could not load existing file " + ipbanlist.c().getName() + ", " + filenotfoundexception.getMessage());
                 }
+                // CraftBukkit end
             }
 
             try {
@@ -152,9 +156,11 @@
             if (oplist.c().exists()) {
                 try {
                     oplist.load();
-                } catch (FileNotFoundException filenotfoundexception) {
-                    NameReferencingFileConverter.e.warn("Could not load existing file " + oplist.c().getName(), filenotfoundexception);
+                // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace
+                } catch (IOException filenotfoundexception) {
+                    e.warn("Could not load existing file " + oplist.c().getName() + ", " + filenotfoundexception.getMessage());
                 }
+                // CraftBukkit end
             }
 
             try {
@@ -184,9 +190,11 @@
             if (whitelist.c().exists()) {
                 try {
                     whitelist.load();
-                } catch (FileNotFoundException filenotfoundexception) {
-                    NameReferencingFileConverter.e.warn("Could not load existing file " + whitelist.c().getName(), filenotfoundexception);
+                // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace
+                } catch (IOException filenotfoundexception) {
+                    e.warn("Could not load existing file " + whitelist.c().getName() + ", " + filenotfoundexception.getMessage());
                 }
+                // CraftBukkit end
             }
 
             try {
@@ -351,7 +359,7 @@
 
     private static File d(PropertyManager propertymanager) {
         String s = propertymanager.getString("level-name", "world");
-        File file = new File(s);
+        File file = new File(MinecraftServer.getServer().server.getWorldContainer(), s); // CraftBukkit - Respect container setting
 
         return new File(file, "players");
     }