Advertisement
Guest User

123123123123

a guest
Dec 22nd, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. package me.gamerover;
  2.  
  3.  import java.util.logging.Logger;
  4.  import org.bukkit.ChatColor;
  5.  import org.bukkit.command.Command;
  6.  import org.bukkit.command.CommandSender;
  7.  import org.bukkit.entity.Player;
  8.  import org.bukkit.plugin.PluginDescriptionFile;
  9.  import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11.  public class Main extends JavaPlugin {
  12.  public static Main plugin;
  13.  public final Logger logger = Logger.getLogger("Minecraft");
  14.  
  15.      @Override
  16.      public void onDisable() {
  17.      
  18.       PluginDescriptionFile pdfFile = this.getDescription();
  19.       this.logger.info(pdfFile.getName() + " " + pdfFile.getVersion() + "EpicSite  disable");
  20.       }
  21.       @Override
  22.       public void onEnable(){
  23.        
  24.       this.saveDefaultConfig();
  25.  
  26.       PluginDescriptionFile pdfFile = this.getDescription();
  27.       this.logger.info(pdfFile.getName() + " " + pdfFile.getVersion() + "EpicSite abilited");
  28.       }
  29.  
  30.       public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
  31.  
  32.         Player player = (Player) sender;
  33.  
  34.         if(commandLabel.equalsIgnoreCase("site")){
  35.           if(player.hasPermission("es.use")){
  36.            
  37.             String sito = this.getConfig().getString("site");
  38.             String messaggio = this.getConfig().getString("message");
  39.             messaggio = ChatColor.translateAlternateColorCodes('&', messaggio);
  40.             String messaggiofinale = messaggio.replaceAll("%site%", sito);
  41.             player.sendMessage(messaggiofinale);
  42.  
  43.           } else {
  44.              player.sendMessage(ChatColor.RED + player.getName() + " don't have permissions");
  45.            }
  46.        }
  47.        return false;
  48.      }
  49.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement