Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FileConfiguration config = getConfig();
- public void onEnable() {
- // CREATE CONFIG
- createConfig();
- // FOR CHANGING NAME COLOR LATER ON
- ScoreboardManager manager = (ScoreboardManager) manager;
- Scoreboard board = manager.getNewScoreboard();
- Team escaped = board.registerNewTeam("Escaped");
- }
- public void onPlayerMoveEvent(PlayerMoveEvent e) {
- Player p = e.getPlayer();
- UUID pUUID = (UUID) p.getUniqueId();
- // If they're already in the list, ignore
- if (config.contains(pUUID.toString())) {
- return;
- }
- for(ProtectedRegion r : WGBukkit.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
- // if they are an escapable rank
- if (p.hasPermission("prisonescape.canescape")) {
- // If on the move event they are not in the prison worldguard region
- if (!r.getId().equalsIgnoreCase("prison")) {
- // add to escaped list
- config.addDefault("List", pUUID.toString());
- saveDefaultConfig();
- nameColorChange(pUUID);
- }
- } else {
- if (config.contains(pUUID.toString())) {
- // remove player from config (?) + change name color back to normal
- }
- return;
- }
- }
- }
- public void nameColorChange(UUID pUUID) {
- // TODO
- }
- private void createConfig() {
- .....
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement