mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 16:34:46 +00:00
Fix Load PlayerData for JSON or Dat Types
This commit is contained in:
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());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user