Advertisement
riking

Untitled

Nov 24th, 2014
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1.     // -------------------------------------------- //
  2.     // Pre-notify mcMMO of player quits so that it can save to the DB before the new server gets the data
  3.     // -------------------------------------------- //
  4.     @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
  5.     public void saveMcmmoDataOnLeave(EventMassiveCorePlayerLeave event)
  6.     {
  7.         final Player player = event.getPlayer();
  8.         McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
  9.         mcMMOPlayer.resetAbilityMode();
  10.         BleedTimerTask.bleedOut(player);
  11.         mcMMOPlayer.getProfile().save();
  12.         UserManager.remove(player); // This prevents mcMMO from clobbering the data with an async save
  13.         ScoreboardManager.teardownPlayer(player);
  14.  
  15.         if (mcMMOPlayer.inParty()) {
  16.             mcMMOPlayer.logoutParty();
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement