Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.core.spazzolino.Commands;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.entity.Player;
- import me.core.spazzolino.main;
- public class FlyCommand
- implements CommandExecutor
- {
- FileConfiguration config = main.plugin.getConfig();
- public boolean onCommand(CommandSender sender, Command cmd, String CommandLabel, String[] args){
- if(cmd.getName().equalsIgnoreCase("fly")){
- Player p = (Player)sender;
- if (!(sender instanceof Player)){
- sender.sendMessage("Only players may use this command!");
- return true;
- }
- if(p.getAllowFlight() == false) {
- p.sendMessage(config.getString("CommandOptions.Fly.enable").replaceAll("&", "ยง").toString());
- p.setAllowFlight(true);
- return true;
- }
- p.setAllowFlight(false);
- p.sendMessage(config.getString("CommandOptions.Fly.disable").replaceAll("&", "ยง").toString());
- return true;
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement