Guest User

Untitled

a guest
Apr 13th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package ru.krylexz.api;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7.  
  8. public class Commands implements CommandExecutor {
  9.  
  10. private Main plugin;
  11.  
  12. public Commands(Main plugin) {
  13. this.plugin = plugin;
  14. }
  15.  
  16. @Override
  17. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  18. String vp = plugin.getConfig().getString("messages.perms.vipplus");
  19. vp = vp.replace("&", "ยง");
  20. Player p = (Player) sender;
  21. if(!sender.hasPermission("krylexz.fly")) {
  22. sender.sendMessage(vp);
  23. return true;
  24. } else {
  25. p.setAllowFlight(true);
  26. p.setFlying(true);
  27. }
  28. if(p.getAllowFlight()) {
  29. p.setFlying(false);
  30. p.setAllowFlight(false);
  31. }
  32. return true;
  33. }
  34. }
Add Comment
Please, Sign In to add comment