summaryrefslogtreecommitdiffstats
path: root/nms-patches/NameReferencingFileConverter.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2015-02-26 22:41:06 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2015-03-04 09:48:58 +0000
commitd8a9c7be4227b2243968b63ab7cc7a00098c93ad (patch)
tree554a08a5f23ffa5dd66a28247d6358515b1ffb7a /nms-patches/NameReferencingFileConverter.patch
parent33d5de312e9fcc8aec3fc53136658cb6920562aa (diff)
downloadcraftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar
craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.gz
craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.lz
craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.xz
craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.zip
Update to Minecraft 1.8.3
Diffstat (limited to 'nms-patches/NameReferencingFileConverter.patch')
-rw-r--r--nms-patches/NameReferencingFileConverter.patch72
1 files changed, 43 insertions, 29 deletions
diff --git a/nms-patches/NameReferencingFileConverter.patch b/nms-patches/NameReferencingFileConverter.patch
index c6fd3919..6a8e7d40 100644
--- a/nms-patches/NameReferencingFileConverter.patch
+++ b/nms-patches/NameReferencingFileConverter.patch
@@ -1,29 +1,18 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/NameReferencingFileConverter.java 2014-11-28 17:43:43.261707431 +0000
-+++ src/main/java/net/minecraft/server/NameReferencingFileConverter.java 2014-11-28 17:38:23.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 @@
+--- /home/matt/mc-dev-private//net/minecraft/server/NameReferencingFileConverter.java 2015-02-26 22:40:22.891608136 +0000
++++ src/main/java/net/minecraft/server/NameReferencingFileConverter.java 2015-02-26 22:40:22.891608136 +0000
+@@ -87,8 +87,9 @@
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
++ // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace
+ } catch (IOException filenotfoundexception) {
-+ e.warn("Could not load existing file " + gameprofilebanlist.c().getName() + ", " + filenotfoundexception.getMessage());
++ NameReferencingFileConverter.e.warn("Could not load existing file " + gameprofilebanlist.c().getName());
}
-+ // CraftBukkit end
}
- try {
-@@ -111,9 +113,11 @@
+@@ -145,8 +146,9 @@
if (ipbanlist.c().exists()) {
try {
ipbanlist.load();
@@ -31,13 +20,11 @@
- 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());
++ NameReferencingFileConverter.e.warn("Could not load existing file " + ipbanlist.c().getName());
}
-+ // CraftBukkit end
}
- try {
-@@ -152,9 +156,11 @@
+@@ -186,8 +188,9 @@
if (oplist.c().exists()) {
try {
oplist.load();
@@ -45,13 +32,11 @@
- 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());
++ NameReferencingFileConverter.e.warn("Could not load existing file " + oplist.c().getName());
}
-+ // CraftBukkit end
}
- try {
-@@ -184,9 +190,11 @@
+@@ -230,8 +233,9 @@
if (whitelist.c().exists()) {
try {
whitelist.load();
@@ -59,13 +44,42 @@
- 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());
++ NameReferencingFileConverter.e.warn("Could not load existing file " + whitelist.c().getName());
}
-+ // CraftBukkit end
}
- try {
-@@ -351,7 +359,7 @@
+@@ -350,6 +354,30 @@
+ File file1 = new File(file2, s + ".dat");
+ File file3 = new File(file, s1 + ".dat");
+
++ // CraftBukkit start - Use old file name to seed lastKnownName
++ NBTTagCompound root = null;
++
++ try {
++ root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file1));
++ } catch (Exception exception) {
++ exception.printStackTrace();
++ }
++
++ if (root != null) {
++ if (!root.hasKey("bukkit")) {
++ root.set("bukkit", new NBTTagCompound());
++ }
++ NBTTagCompound data = root.getCompound("bukkit");
++ data.setString("lastKnownName", s);
++
++ try {
++ NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2));
++ } catch (Exception exception) {
++ exception.printStackTrace();
++ }
++ }
++ // CraftBukkit end
++
+ NameReferencingFileConverter.b(file);
+ if (!file1.renameTo(file3)) {
+ throw new NameReferencingFileConverter.FileConversionException("Could not convert file for " + s, null);
+@@ -467,7 +495,7 @@
private static File d(PropertyManager propertymanager) {
String s = propertymanager.getString("level-name", "world");