private void loadResearch(EntityPlayer fakePlayer) { boolean online = false; for(String username : MinecraftServer.getServer().getAllUsernames()) { if(username.equals(player)) { online = true; break; } } if(online) { this.research = ResearchManager.getResearchForPlayer(player); } else { if(research == null) { Thaumcraft.proxy.getCompletedResearch().put(fakePlayer.getCommandSenderName(), new ArrayList<String>()); IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler(); SaveHandler sh = (SaveHandler)playerNBTManagerObj; File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_75771_c"); File file1 = new File(dir, player + ".thaum"); File file2 = new File(dir, player + ".thaumbak"); ResearchManager.loadPlayerData(fakePlayer, file1, file2, false); this.research = ResearchManager.getResearchForPlayerSafe(fakePlayer.getCommandSenderName()); } } Thaumcraft.proxy.getCompletedResearch().put(fakePlayer.getCommandSenderName(), research == null ? new ArrayList<String>() : research); }
public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString) { SaveHandler sh = (SaveHandler) playerFileData; File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_"+"75771_c"); MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString)); }
public IPlayerFileData getSaveHandler() { return null; }
@Override public IPlayerFileData getPlayerNBTManager() { return null; }
/** * returns null if no saveHandler is relevent (eg. SMP) */ public IPlayerFileData getSaveHandler() { return this; }
@Override public IPlayerFileData getSaveHandler() { return null; }
public IPlayerFileData func_75756_e() { return null; }
public IPlayerFileData func_75756_e() { return this; }
@Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); }
@Override public IPlayerFileData func_75756_e() { return parent.func_75756_e(); }
@Override public IPlayerFileData getSaveHandler() { return parent.getSaveHandler(); }
public IPlayerFileData getPlayerNBTManager() { return null; }
IPlayerFileData func_75756_e();