Advertisement
Guest User

Help me

a guest
Oct 10th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. package fr.swixiz.griopcraft;
  2.  
  3. import java.io.File;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.plugin.PluginManager;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. import fr.swixiz.griopcraft.commands.BroadcastCommand;
  11. import fr.swixiz.griopcraft.commands.ReportCommands;
  12. import fr.swixiz.griopcraft.events.Join;
  13.  
  14. public class GriopCraft extends JavaPlugin{
  15.  
  16.  
  17. public static String joinMessage;
  18.  
  19.  
  20.  
  21.  
  22. public void onEnable(){
  23.  
  24. getCommand();
  25. Listener();
  26.  
  27. File config = new File(getDataFolder(), "config.yml");
  28.  
  29. try{
  30. if(!config.exists()){
  31. getConfig().options().copyDefaults(true);
  32.  
  33. getConfig().set("Chat.joinmessage", "&7[&a+&7] &a");
  34.  
  35. String joinMessage = getConfig().getString("Chat.joinmessage");
  36.  
  37. this.joinMessage = ChatColor.translateAlternateColorCodes('&', joinMessage);
  38.  
  39.  
  40. saveConfig();
  41. }
  42.  
  43.  
  44. }
  45.  
  46. catch(Exception e){
  47. e.printStackTrace();
  48. }
  49. }
  50.  
  51. public void getCommand(){
  52. getCommand("report").setExecutor(new ReportCommands());
  53. getCommand("annonce").setExecutor(new BroadcastCommand());
  54. getCommand("bc").setExecutor(new BroadcastCommand());
  55. }
  56.  
  57. public void Listener(){
  58. PluginManager pm = Bukkit.getServer().getPluginManager();
  59.  
  60. pm.registerEvents(new Join(), this);
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement