Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import net.ess3.api.Economy;
- import net.redstoneore.legacyfactions.Role;
- import net.redstoneore.legacyfactions.entity.FPlayer;
- import net.redstoneore.legacyfactions.entity.FPlayerColl;
- import net.redstoneore.legacyfactions.entity.Faction;
- import net.redstoneore.legacyfactions.entity.FactionColl;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- import com.earth2me.essentials.api.UserDoesNotExistException;
- public class Slitmywrists extends JavaPlugin {
- @SuppressWarnings("deprecation")
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
- if (command.getName().equalsIgnoreCase("buff")){
- if (sender instanceof Player){
- Player player = (Player) sender;
- if (FPlayerColl.get(player).hasFaction()){
- if (FPlayerColl.get(player).getRole().toString() == "MODERATOR" || FPlayerColl.get(player).getRole().toString() == "ADMIN"){
- try {
- if (Economy.hasEnough(player.getName(), 60)){
- FPlayer FPLAYERIS = FPlayerColl.get(player);
- Faction PLAYER_FACTION = FactionColl.get(FPLAYERIS);
- for (Player fplayer : PLAYER_FACTION.getOnlinePlayers()) {
- FPlayer PLAYER_IN_FC = FPlayerColl.get(fplayer);
- String name = PLAYER_IN_FC.getName();
- Faction faction = PLAYER_IN_FC.getFaction();
- Role role = PLAYER_IN_FC.getRole();
- }
- } else {
- sender.sendMessage("You don't have enough money.");
- }
- } catch (UserDoesNotExistException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else {
- sender.sendMessage("You must be a fraction moderator or owner.");
- }
- } else {
- sender.sendMessage("You must be in a faction to use this command.");
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement