2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/NameReferencingFileConverter.java
|
|
|
|
+++ b/net/minecraft/server/NameReferencingFileConverter.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -88,8 +88,9 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
if (gameprofilebanlist.c().exists()) {
|
|
|
|
try {
|
|
|
|
gameprofilebanlist.load();
|
|
|
|
- } catch (FileNotFoundException filenotfoundexception) {
|
|
|
|
- NameReferencingFileConverter.e.warn("Could not load existing file " + gameprofilebanlist.c().getName(), filenotfoundexception);
|
2015-02-26 23:41:06 +01:00
|
|
|
+ // CraftBukkit start - FileNotFoundException -> IOException, don't print stacetrace
|
2014-11-25 22:32:16 +01:00
|
|
|
+ } catch (IOException filenotfoundexception) {
|
2015-02-26 23:41:06 +01:00
|
|
|
+ NameReferencingFileConverter.e.warn("Could not load existing file " + gameprofilebanlist.c().getName());
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -146,8 +147,9 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
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) {
|
2015-02-26 23:41:06 +01:00
|
|
|
+ NameReferencingFileConverter.e.warn("Could not load existing file " + ipbanlist.c().getName());
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -187,8 +189,9 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
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) {
|
2015-02-26 23:41:06 +01:00
|
|
|
+ NameReferencingFileConverter.e.warn("Could not load existing file " + oplist.c().getName());
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -231,8 +234,9 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
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) {
|
2015-02-26 23:41:06 +01:00
|
|
|
+ NameReferencingFileConverter.e.warn("Could not load existing file " + whitelist.c().getName());
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -350,6 +354,30 @@
|
2015-02-26 23:41:06 +01:00
|
|
|
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);
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -467,7 +495,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
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");
|
|
|
|
}
|