Correctly unregister player on quit and close clipboard if using disk.

This commit is contained in:
dordsor21 2020-03-30 17:41:41 +01:00
parent 3cd30ebbff
commit 318e367cf0
2 changed files with 3 additions and 1 deletions

View File

@ -392,6 +392,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
@Override
public void unregister() {
player.removeMetadata("WE", WorldEditPlugin.getInstance());
super.unregister();
}
}

View File

@ -370,9 +370,10 @@ public interface Player extends Entity, Actor {
default void unregister() {
cancel(true);
if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) {
getSession().setClipboard(null);
getSession().clearHistory();
getSession().unregisterTools(this);
} else if (Settings.IMP.CLIPBOARD.USE_DISK) {
getSession().setClipboard(null);
}
}