Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.krylexz.api;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- public class Commands implements CommandExecutor {
- private Main plugin;
- public Commands(Main plugin) {
- this.plugin = plugin;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- String vp = plugin.getConfig().getString("messages.perms.vipplus");
- vp = vp.replace("&", "ยง");
- Player p = (Player) sender;
- if(!sender.hasPermission("krylexz.fly")) {
- sender.sendMessage(vp);
- return true;
- } else {
- p.setAllowFlight(true);
- p.setFlying(true);
- }
- if(p.getAllowFlight()) {
- p.setFlying(false);
- p.setAllowFlight(false);
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment