mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
a8ddf37419
By: GunfighterJ <joseph.jenniges@gmail.com>
31 lines
1.1 KiB
Diff
31 lines
1.1 KiB
Diff
@@ -47,6 +47,30 @@
|
|
private void a(File file, String s, String s1) {
|
|
File file1 = new File(this.d, s + ".dat");
|
|
File file2 = 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.a(file);
|
|
if (!file1.renameTo(file2)) {
|