Advertisement
Maxarade

Untitled

May 23rd, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. package fr.maxarade.castle;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.plugin.PluginManager;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class castle extends JavaPlugin{
  11.  
  12. public EventClass ec;
  13. public VoidClass vc;
  14.  
  15. @Override
  16. public void onEnable(){
  17. this.ec = new EventClass(this);
  18. this.vc = new VoidClass(this);
  19.  
  20. getLogger().info("Plugin démarré !");
  21. saveDefaultConfig();
  22. PluginManager pm = getServer().getPluginManager();
  23. pm.registerEvents(ec, this);
  24. getConfig().createSection("options");
  25. getConfig().createSection("options.bloc");
  26. getConfig().createSection("options.tickets");
  27. getConfig().set("options.tickets", Integer.valueOf(30));
  28. getConfig().createSection("options.PlayersCount");
  29. getConfig().set("options.PlayersCount", Integer.valueOf(0));
  30. // Actions à effectuer au démarrage du plugin, c'est-à-dire :
  31. // - Au démarrage du serveur
  32. // - Après un /reload
  33. }
  34.  
  35.  
  36. @Override
  37. public void onDisable(){
  38. getLogger().info("Plugin inactif !");
  39. // Actions à effectuer à la désactivation du plugin
  40. // - A l'extinction du serveur
  41. // - Pendant un /reload
  42. }
  43.  
  44. public boolean onCommand(CommandSender sender, Command command, String label, String[]args){
  45. Player p = (Player) sender;
  46.  
  47. if(command.getName().equalsIgnoreCase("addone")){
  48. this.vc.add(1);
  49. p.sendMessage(ChatColor.GREEN+">> Vous avez ajouté un joueur : "+getConfig().getInt("options.PlayerCount"));
  50. }
  51.  
  52. return false;
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement