Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.95 KB | None | 0 0
  1. import net.ess3.api.Economy;
  2. import net.redstoneore.legacyfactions.Role;
  3. import net.redstoneore.legacyfactions.entity.FPlayer;
  4. import net.redstoneore.legacyfactions.entity.FPlayerColl;
  5. import net.redstoneore.legacyfactions.entity.Faction;
  6. import net.redstoneore.legacyfactions.entity.FactionColl;
  7.  
  8. import org.bukkit.Bukkit;
  9. import org.bukkit.ChatColor;
  10. import org.bukkit.command.Command;
  11. import org.bukkit.command.CommandSender;
  12. import org.bukkit.entity.Player;
  13. import org.bukkit.plugin.java.JavaPlugin;
  14.  
  15. import com.earth2me.essentials.api.UserDoesNotExistException;
  16.  
  17. public class Slitmywrists extends JavaPlugin {
  18.  
  19.     @SuppressWarnings("deprecation")
  20.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
  21.        
  22.         if (command.getName().equalsIgnoreCase("buff")){
  23.             if (sender instanceof Player){
  24.                 Player player = (Player) sender;
  25.                 if (FPlayerColl.get(player).hasFaction()){
  26.                     if (FPlayerColl.get(player).getRole().toString() == "MODERATOR" || FPlayerColl.get(player).getRole().toString() == "ADMIN"){
  27.                         try {
  28.                             if (Economy.hasEnough(player.getName(), 60)){
  29.                                 FPlayer FPLAYERIS = FPlayerColl.get(player);
  30.                                 Faction PLAYER_FACTION = FactionColl.get(FPLAYERIS);
  31.  
  32.                                 for (Player fplayer : PLAYER_FACTION.getOnlinePlayers()) {
  33.                                     FPlayer PLAYER_IN_FC = FPlayerColl.get(fplayer);
  34.                                     String name = PLAYER_IN_FC.getName();
  35.                                     Faction faction = PLAYER_IN_FC.getFaction();
  36.                                     Role role = PLAYER_IN_FC.getRole();
  37.                                     }
  38.                             } else {
  39.                                 sender.sendMessage("You don't have enough money.");
  40.                             }
  41.                         } catch (UserDoesNotExistException e) {
  42.                             // TODO Auto-generated catch block
  43.                             e.printStackTrace();
  44.                         }
  45.                     } else {
  46.                         sender.sendMessage("You must be a fraction moderator or owner.");
  47.                     }
  48.                 } else {
  49.                     sender.sendMessage("You must be in a faction to use this command.");
  50.                 }
  51.             }
  52.         }
  53.        
  54.         return false;
  55.     }
  56.    
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement