Advertisement
Knager

Untitled

Mar 14th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. package me.bukkit.knager.commands;
  2.  
  3. import me.bukkit.knager.*;
  4. import org.bukkit.*;
  5. import org.bukkit.command.*;
  6. import org.bukkit.entity.*;
  7.  
  8. public class CommandExecutor_fly implements CommandExecutor
  9. {
  10.    
  11.     private SimpleFly plugin;
  12.  
  13.     public CommandExecutor_fly(final SimpleFly plugin) {
  14.         this.plugin = plugin;
  15.     }
  16.    
  17.     public boolean onCommand(final CommandSender sender, final Command command, final String Label, final String[] args) {
  18.         if (!command.getName().equalsIgnoreCase("fly")) {
  19.             return false;
  20.         }
  21.         if (!(sender instanceof Player)) {
  22.             sender.sendMessage(ChatColor.RED + "Je bent geen speler");
  23.             return true;
  24.         }
  25.         return false;
  26.        
  27.         final Player player = (Player)sender;
  28.         if (player.hasPermission("fly.use")) {
  29.             player.setAllowFlight(!player.getAllowFlight());
  30.             player.sendMessage(ChatColor.GRAY + "Je hebt fly" + ChatColor.GREEN + ChatColor.BOLD + player.getAllowFlight());
  31.  
  32.         } else {
  33.             player.sendMessage(ChatColor.GRAY + "Hiervoor heb je de rank" + ChatColor.DARK_GRAY + " [" + ChatColor.GOLD + "Wood" + ChatColor.DARK_GRAY + "]" + ChatColor.GRAY + " nodig.");
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement