/src/it/lucalumetti/sharplay/indigo/IndigoBlockBan/IndigoBlockBan.java

https://gitlab.com/Luca_Lumetti/indigoblockban · Java · 37 lines · 30 code · 7 blank · 0 comment · 0 complexity · 494eefcee9b23f732db06ebde6085598 MD5 · raw file

  1. package it.lucalumetti.sharplay.indigo.IndigoBlockBan;
  2. import java.util.logging.Logger;
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.plugin.java.JavaPlugin;
  5. import org.bukkit.scheduler.BukkitScheduler;
  6. import org.bukkit.scheduler.BukkitTask;
  7. public class IndigoBlockBan extends JavaPlugin{
  8. private static Logger log = Logger.getLogger("Minecraft");
  9. public BanList banlist = new BanList(this);
  10. BukkitTask task;
  11. JavaPlugin plugin = this;
  12. public void onEnable(){
  13. saveDefaultConfig();
  14. getCommand("IndigoBlockBan").setExecutor(new CommandExc(banlist, log, new SchedulerTask(log, banlist)));
  15. this.getServer().getPluginManager().registerEvents(new EventCheck(banlist), this);
  16. banlist.readLista();
  17. log.info("IndigoBlockBan avviato!");
  18. BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
  19. int time = getConfig().getInt("TEMPO");
  20. scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
  21. @Override
  22. public void run() {
  23. new SchedulerTask(log, banlist).start(Bukkit.getWorld("world"));
  24. }
  25. }, 0L, 20*time);
  26. }
  27. public void onDisable(){
  28. banlist.salvaLista();
  29. }
  30. }