/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
- package it.lucalumetti.sharplay.indigo.IndigoBlockBan;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.scheduler.BukkitScheduler;
- import org.bukkit.scheduler.BukkitTask;
- public class IndigoBlockBan extends JavaPlugin{
- private static Logger log = Logger.getLogger("Minecraft");
- public BanList banlist = new BanList(this);
- BukkitTask task;
- JavaPlugin plugin = this;
-
- public void onEnable(){
- saveDefaultConfig();
- getCommand("IndigoBlockBan").setExecutor(new CommandExc(banlist, log, new SchedulerTask(log, banlist)));
- this.getServer().getPluginManager().registerEvents(new EventCheck(banlist), this);
- banlist.readLista();
- log.info("IndigoBlockBan avviato!");
- BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
- int time = getConfig().getInt("TEMPO");
- scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
- @Override
- public void run() {
- new SchedulerTask(log, banlist).start(Bukkit.getWorld("world"));
- }
- }, 0L, 20*time);
- }
-
- public void onDisable(){
- banlist.salvaLista();
- }
-
- }