Hi. Anyone know how to accomlish this with the Forge API? I have been searching for a number of days and simply can not find the appropriate information on the web.
I wrote a simple bukkit plugin for our servers that writes out player positions into a file every 200 ticks, but I now need to write this for our Forge servers also. This meta data is used by scripts and programs outside of the minecraft server. Pretty Simple piece of code, but I simply haven't found suitable info to convert to Forge. I have the basic forge Mod running based on the example provided with Forge API.
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
// open the meta file for writing
File mfile = new File(metafile);
FileWriter writer;
try {
writer = new FileWriter(mfile, false);
pw = new PrintWriter(writer);
} catch(IOException e) {
e.printStackTrace();
}
for(Player i : Bukkit.getServer().getOnlinePlayers()){
pw.println(i.getName()+ ":" + i.getLocation().getX() + ":" + i.getLocation().getY() + ":" + i.getLocation().getZ());
}
pw.close();
}
}, 0L, 200L);
Any information appreciated.