Advertisement
Guest User

Untitled

a guest
Jan 28th, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. package me.jkjames7.bc;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. public class Bc extends JavaPlugin{
  14. public final Logger logger = Logger.getLogger("Minecraft");
  15. public static Bc plugin;
  16.  
  17. public void onDisable() {
  18. PluginDescriptionFile pdfFile = this.getDescription();
  19. this.logger.info(pdfFile.getName() + "bc has been Disabled!");
  20. }
  21. @Override
  22. public void onEnable() {
  23. PluginDescriptionFile pdfFile = this.getDescription();
  24. this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + "bc has been Enabled!");
  25. getConfig().options().copyDefaults(true);
  26. saveConfig();
  27. }
  28.  
  29. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
  30. Player player = (Player) sender;
  31. if(commandLabel.equalsIgnoreCase("bcr")){
  32. if(player.hasPermission("bc.r")) {
  33. player.sendMessage(ChatColor.RED + "RELOADED!");
  34. getConfig().options().copyDefaults(true);
  35. saveConfig();
  36. }
  37. else if(commandLabel.equalsIgnoreCase("bc1")){
  38. if(player.hasPermission("bc.1")) {
  39. Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + getConfig().getString("msg1"));
  40. }
  41. else if(commandLabel.equalsIgnoreCase("bc"));
  42. player.sendMessage(ChatColor.AQUA + "~ Broadcaster commands:~ ");
  43. player.sendMessage(ChatColor.GOLD + "~ /bcr " + ChatColor.BLUE + "Use to reload the plugin config");
  44. player.sendMessage(ChatColor.GOLD + "~ /bc1 " + ChatColor.BLUE + "Broadcast the first set message");
  45. return false;
  46. }
  47. return false;
  48.  
  49. }
  50. return false;
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement