Fixed the writer for vminecraftusers

This commit is contained in:
cerevisiae 2010-12-01 14:28:50 -06:00
parent ccf75c0429
commit ce46e2d011
2 changed files with 10 additions and 8 deletions

View File

@ -94,11 +94,5 @@ public class vMinecraftListener extends PluginListener {
public void onLogin(Player player){ public void onLogin(Player player){
vMinecraftUsers.addUser(player); vMinecraftUsers.addUser(player);
} }
/** Not working yet, I posted the issue to hMod on github though
public boolean onDamage(DamageType type, BaseEntity attacker, BaseEntity defender, int amount) {
return false;
}
**/
} }

View File

@ -43,10 +43,18 @@ public class vMinecraftUsers {
String location = "vminecraftusers.txt"; String location = "vminecraftusers.txt";
try { try {
writer = new FileWriter(location); writer = new FileWriter(location);
writer.write(player.getName()+"::::"); writer.append(player.getName()+"::::");
} catch (Exception e) { } catch (Exception e) {
log.log(Level.SEVERE, "Exception while trying to add user with writer to " + location, e); log.log(Level.SEVERE, "Exception while trying to add user with writer to " + location, e);
} } finally {
try {
if (writer != null) {
writer.close();
}
} catch (IOException e) {
log.log(Level.SEVERE, "Exception while closing writer for " + location, e);
}
}
} }
public static vMinecraftUsers getInstance() { public static vMinecraftUsers getInstance() {