예제 #1
0
 @Override
 @SuppressWarnings("deprecation")
 public void reloadConfig() {
   if (configuration != null && configuration.isExtendedNames()) {
     NameCollection.unregisterPlugin(this);
   }
   super.reloadConfig();
   final FileConfiguration getConfig = getConfig();
   getConfig.options().copyDefaults(true);
   if (getConfig.isSet(BUY_PATTERN)) {
     getConfig.getConfigurationSection(BUY_SECTION).set(PATTERN, getConfig.getString(BUY_PATTERN));
     getConfig.set(BUY_PATTERN, null);
   }
   if (getConfig.isSet(SELL_PATTERN)) {
     getConfig
         .getConfigurationSection(SELL_SECTION)
         .set(PATTERN, getConfig.getString(SELL_PATTERN));
     getConfig.set(SELL_PATTERN, null);
   }
   configuration = new StandardConfig(this);
   if (configuration.isExtendedNames()) {
     NameCollection.registerPlugin(this);
   }
   showcaseListener.setStatus(configuration.isShowcaseEnabled());
   locale = new Localized(this);
   materialConfig = new MaterialConfig(this);
   try {
     if (getConfig.getBoolean(LOG_BLOCK)) {
       final Plugin logblockPlugin = getServer().getPluginManager().getPlugin("LogBlock");
       if (logblockPlugin == null || !(logblockPlugin instanceof LogBlock)) {
         getLogger().warning("Failed to find LogBlock");
         consumer = null;
       } else {
         consumer = ((LogBlock) logblockPlugin).getConsumer();
         if (consumer == null) {
           getLogger().warning("Error getting LogBlock consumer");
         } else {
           getLogger().info("Sucessfully hooked into LogBlock");
         }
       }
     } else {
       consumer = null;
       getLogger().info("Did not hook into LogBlock");
     }
   } catch (final Throwable t) {
     consumer = null;
     getLogger().log(Level.SEVERE, "Error handling LogBlock", t);
   }
 }
예제 #2
0
 /** Does nothing as of yet. */
 @Override
 public void onDisable() {
   if (configuration.isExtendedNames()) {
     NameCollection.unregisterPlugin(this);
   }
 }