Fixed iConomy 4.0 API support

This commit is contained in:
DarkLiKally 2011-02-25 21:53:19 +01:00
parent 3ed8eb76c2
commit e61b496ca4
2 changed files with 13 additions and 5 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldguard.bukkit; package com.sk89q.worldguard.bukkit;
import com.nijikokun.bukkit.iConomy.iConomy;
import com.sk89q.worldguard.protection.regionmanager.RegionManager; import com.sk89q.worldguard.protection.regionmanager.RegionManager;
import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent; import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent;
import org.bukkit.entity.Item; import org.bukkit.entity.Item;
@ -41,7 +42,9 @@ public class WorldGuardPlayerListener extends PlayerListener {
* Plugin. * Plugin.
*/ */
private WorldGuardPlugin plugin; private WorldGuardPlugin plugin;
private boolean checkediConomy = false;
/** /**
* Construct the object; * Construct the object;
* *
@ -177,6 +180,15 @@ public void onPlayerLogin(PlayerLoginEvent event) {
} }
} }
} }
if (!checkediConomy) {
iConomy iconomy = (iConomy)plugin.getServer().getPluginManager().getPlugin("iConomy");
if (iconomy != null) {
plugin.getWgConfiguration().setiConomy(iconomy);
}
checkediConomy = true;
}
} }
/** /**

View File

@ -44,8 +44,6 @@ public class WorldGuardPlugin extends JavaPlugin {
new WorldGuardBlockListener(this); new WorldGuardBlockListener(this);
private final WorldGuardEntityListener entityListener = private final WorldGuardEntityListener entityListener =
new WorldGuardEntityListener(this); new WorldGuardEntityListener(this);
private final WorldGuardServerListener serverListener =
new WorldGuardServerListener(this);
private final CommandHandler commandHandler = new CommandHandler(this); private final CommandHandler commandHandler = new CommandHandler(this);
private final GlobalRegionManager globalRegionManager = new GlobalRegionManager(this); private final GlobalRegionManager globalRegionManager = new GlobalRegionManager(this);
@ -103,8 +101,6 @@ private void registerEvents() {
pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this);
pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this);
pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Priority.Monitor, this);
// 25 equals about 1s real time // 25 equals about 1s real time
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new TimedFlagsTimer(this), 25 * 5, 25 * 5); this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new TimedFlagsTimer(this), 25 * 5, 25 * 5);
} }