mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed the writer for vminecraftusers
This commit is contained in:
parent
ccf75c0429
commit
ce46e2d011
@ -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;
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
}
|
}
|
@ -43,9 +43,17 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user