mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-10 00:52:22 -07:00
1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
--- a/net/minecraft/server/players/OldUsersConverter.java
|
||||
+++ b/net/minecraft/server/players/OldUsersConverter.java
|
||||
@@ -20,6 +_,9 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.core.UUIDUtil;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.nbt.NbtAccounter;
|
||||
+import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.StringUtil;
|
||||
@@ -49,7 +_,8 @@
|
||||
|
||||
private static void lookupPlayers(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback) {
|
||||
@@ -61,10 +51,10 @@
|
||||
File file4 = new File(worldPlayersDirectory, oldFileName + ".dat");
|
||||
File file5 = new File(file3, newFileName + ".dat");
|
||||
+ // CraftBukkit start - Use old file name to seed lastKnownName
|
||||
+ CompoundTag root = null;
|
||||
+ net.minecraft.nbt.CompoundTag root = null;
|
||||
+
|
||||
+ try {
|
||||
+ root = NbtIo.readCompressed(new java.io.FileInputStream(file4), NbtAccounter.unlimitedHeap());
|
||||
+ root = net.minecraft.nbt.NbtIo.readCompressed(new java.io.FileInputStream(file4), net.minecraft.nbt.NbtAccounter.unlimitedHeap());
|
||||
+ } catch (Exception exception) {
|
||||
+ // Paper start
|
||||
+ io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(exception);
|
||||
@@ -75,13 +65,13 @@
|
||||
+
|
||||
+ if (root != null) {
|
||||
+ if (!root.contains("bukkit")) {
|
||||
+ root.put("bukkit", new CompoundTag());
|
||||
+ root.put("bukkit", new net.minecraft.nbt.CompoundTag());
|
||||
+ }
|
||||
+ CompoundTag data = root.getCompound("bukkit");
|
||||
+ net.minecraft.nbt.CompoundTag data = root.getCompoundOrEmpty("bukkit");
|
||||
+ data.putString("lastKnownName", oldFileName);
|
||||
+
|
||||
+ try {
|
||||
+ NbtIo.writeCompressed(root, new java.io.FileOutputStream(file1));
|
||||
+ net.minecraft.nbt.NbtIo.writeCompressed(root, new java.io.FileOutputStream(file1));
|
||||
+ } catch (Exception exception) {
|
||||
+ // Paper start
|
||||
+ io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(exception);
|
||||
|
Reference in New Issue
Block a user