Fix Load PlayerData for JSON or Dat Types

This commit is contained in:
Kam committed 2023-06-02 03:37:18 -04:00
1 parent e0191ccf89
commit f6b9f2c973
3 files changed
+7 -24

No files matched your search

@@ -169,28 +169,6 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
world.spawnEntityInWorld(npc);
}
public static NBTTagCompound loadPlayerData(String player) {
File saveDir = CustomNpcs.getWorldSaveDirectory("playerdata");
String filename = player;
if (player.isEmpty()) {
filename = "noplayername";
}
filename = filename + ".json";
File file = null;
try {
file = new File(saveDir, filename);
if (file.exists()) {
return NBTJsonUtil.LoadFile(file);
}
} catch (Exception var5) {
LogWriter.error("Error loading: " + file.getAbsolutePath(), var5);
}
return new NBTTagCompound();
}
public void setCompanion(ICustomNpc npc) {
this.setCompanion((EntityNPCInterface) npc.getMCEntity());
}