Fixed unlocking player data before updating last seen
This commit is contained in:
parent
6775c74599
commit
534978cef3
|
|
@ -23,16 +23,16 @@ public class LogoutEvent implements Listener {
|
||||||
if (Config.DEBUG)
|
if (Config.DEBUG)
|
||||||
Logger.info("Syncing %", event.getPlayer().getName());
|
Logger.info("Syncing %", event.getPlayer().getName());
|
||||||
GUI.GUIByUUID.remove(uuid);
|
GUI.GUIByUUID.remove(uuid);
|
||||||
|
EconUser user = EconUser.getUser(uuid);
|
||||||
|
if (user != null) {
|
||||||
|
user.syncPoints();
|
||||||
|
EconUser.removeUser(uuid);
|
||||||
|
}
|
||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
out.writeUTF("try-unlock");
|
out.writeUTF("try-unlock");
|
||||||
out.writeUTF(uuid.toString());
|
out.writeUTF(uuid.toString());
|
||||||
Bukkit.getServer().sendPluginMessage(VillagerUI.getInstance(),
|
Bukkit.getServer().sendPluginMessage(VillagerUI.getInstance(),
|
||||||
"villagerui:player-data",
|
"villagerui:player-data",
|
||||||
out.toByteArray());
|
out.toByteArray());
|
||||||
EconUser user = EconUser.getUser(uuid);
|
|
||||||
if (user == null)
|
|
||||||
return;
|
|
||||||
user.syncPoints();
|
|
||||||
EconUser.removeUser(uuid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user