Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. FileConfiguration config = getConfig();
  2.     public void onEnable() {
  3.         // CREATE CONFIG
  4.         createConfig();
  5.         // FOR CHANGING NAME COLOR LATER ON
  6.         ScoreboardManager manager = (ScoreboardManager) manager;
  7.         Scoreboard board = manager.getNewScoreboard();
  8.         Team escaped = board.registerNewTeam("Escaped");
  9.        
  10.     }
  11.     public void onPlayerMoveEvent(PlayerMoveEvent e) {
  12.         Player p = e.getPlayer();
  13.         UUID pUUID = (UUID) p.getUniqueId();
  14.         // If they're already in the list, ignore
  15.         if (config.contains(pUUID.toString())) {
  16.             return;
  17.         }
  18.         for(ProtectedRegion r : WGBukkit.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
  19.             // if they are an escapable rank
  20.             if (p.hasPermission("prisonescape.canescape")) {
  21.                 // If on the move event they are not in the prison worldguard region
  22.                 if (!r.getId().equalsIgnoreCase("prison")) {
  23.                     // add to escaped list
  24.                     config.addDefault("List", pUUID.toString());
  25.                     saveDefaultConfig();
  26.                     nameColorChange(pUUID);
  27.                 }
  28.             } else {
  29.                 if (config.contains(pUUID.toString())) {
  30.                     // remove player from config (?) + change name color back to normal
  31.                 }
  32.                 return;
  33.             }
  34.         }
  35.     }
  36.     public void nameColorChange(UUID pUUID) {
  37.         // TODO
  38.     }
  39.    
  40.    
  41.     private void createConfig() {
  42.         .....
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement