Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -------------------------------------------- //
- // Pre-notify mcMMO of player quits so that it can save to the DB before the new server gets the data
- // -------------------------------------------- //
- @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
- public void saveMcmmoDataOnLeave(EventMassiveCorePlayerLeave event)
- {
- final Player player = event.getPlayer();
- McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
- mcMMOPlayer.resetAbilityMode();
- BleedTimerTask.bleedOut(player);
- mcMMOPlayer.getProfile().save();
- UserManager.remove(player); // This prevents mcMMO from clobbering the data with an async save
- ScoreboardManager.teardownPlayer(player);
- if (mcMMOPlayer.inParty()) {
- mcMMOPlayer.logoutParty();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement