コード例 #1
0
ファイル: AccountsPlugin.java プロジェクト: EthilVan/Plugins
  @Override
  public void onEnable() {
    PluginManager pm = Bukkit.getPluginManager();

    AccountsConfig config;
    try {
      config = getLoader().loadOrCreate("config.json", AccountsConfig.class);
    } catch (GsonLoadException exc) {
      getLogger().log(Level.SEVERE, "Unable to load config.json", exc);
      config = new AccountsConfig();
    }

    Accounts accounts = new EVAccounts(this, config);
    EthilVan.registerAccounts(accounts);

    Listener accountsListener = new AccountsListener(this);
    pm.registerEvents(accountsListener, this);

    ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
    protocolManager.addPacketListener(new NamePlatePacketListener(this));

    CommandsRegistration registration = new CommandsRegistration(this, Locale.FRANCE);
    registration.register(new AccountsCommands());

    Bukkit.getScheduler().runTaskTimer(this, this, 6000, 6000);
  }