--- ../src-base/minecraft/net/minecraftforge/common/UsernameCache.java
+++ ../src-work/minecraft/net/minecraftforge/common/UsernameCache.java
@@ -24,6 +24,7 @@
 import com.google.gson.JsonSyntaxException;
 
 import cpw.mods.fml.relauncher.FMLInjectionData;
+import net.minecraft.server.MinecraftServer;
 
 /**
  * Caches player's last known usernames
@@ -39,7 +40,7 @@
 
     private static final Charset charset = Charsets.UTF_8;
 
-    private static final File saveFile = new File( /* The minecraft dir */(File) FMLInjectionData.data()[6], "usernamecache.json");
+    private static final File saveFile = new File( MinecraftServer.serverConfigDir, "usernamecache.json");
     private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
 
     private static final Logger log = LogManager.getLogger(UsernameCache.class);
