Fix saving after unlock
This commit is contained in:
parent
49bbf4fe1b
commit
f167e43d4b
|
|
@ -20,6 +20,9 @@ public class LogoutEvent implements Listener {
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
UUID uuid = event.getPlayer().getUniqueId();
|
UUID uuid = event.getPlayer().getUniqueId();
|
||||||
|
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
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);
|
||||||
|
|
@ -35,4 +38,6 @@ public class LogoutEvent implements Listener {
|
||||||
"villagerui:player-data",
|
"villagerui:player-data",
|
||||||
out.toByteArray());
|
out.toByteArray());
|
||||||
}
|
}
|
||||||
|
}.runTaskAsynchronously(VillagerUI.getInstance());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,9 @@ public class EconUser {
|
||||||
uuid.toString(), getPointsMap().object2ObjectEntrySet().stream()
|
uuid.toString(), getPointsMap().object2ObjectEntrySet().stream()
|
||||||
.map(entry -> entry.getKey() + " - " + entry.getValue().toString())
|
.map(entry -> entry.getKey() + " - " + entry.getValue().toString())
|
||||||
.collect(Collectors.joining("\n")));
|
.collect(Collectors.joining("\n")));
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Queries.updateUserPoints(uuid, pointsMap);
|
Queries.updateUserPoints(uuid, pointsMap);
|
||||||
}
|
}
|
||||||
}.runTaskAsynchronously(VillagerUI.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void removePoints(String villagerType, int points, int remove)
|
private void removePoints(String villagerType, int points, int remove)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user