Flush clipboard rather than close on player disconnect

Addresses #1291
This commit is contained in:
dordsor21
2021-09-13 15:08:03 +01:00
parent 3088b1245c
commit 06d716248e
5 changed files with 39 additions and 5 deletions

View File

@ -840,12 +840,16 @@ public class LocalSession implements TextureHolder {
}
/**
* Ensure the player's clipboard is closed. (will only do something with clipboard-on-disk)
* Ensure the player's clipboard is flushed. (will only do something with clipboard-on-disk)
*/
public void closeClipboard() {
public void flushClipboard() {
synchronized (clipboardLock) {
if (this.clipboard != null) {
this.clipboard.close();
try {
this.clipboard.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}