Bugfix for Vault initialization.

This commit is contained in:
shansen 2012-04-01 03:21:14 +02:00
parent 242a279af2
commit 12033af8aa
3 changed files with 15 additions and 8 deletions

View File

@ -17,7 +17,7 @@
<repositories> <repositories>
<repository> <repository>
<id>bukkit-repo</id> <id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/repositories/snapshots/</url> <url>http://repo.bukkit.org/content/repositories/releases/</url>
</repository> </repository>
</repositories> </repositories>
@ -25,12 +25,12 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.2.2-R0.1-SNAPSHOT</version> <version>1.2.4-R1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId> <artifactId>Vault</artifactId>
<version>1.2.8</version> <version>1.2.13</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -28,6 +28,7 @@ import net.milkbowl.vault.economy.Economy;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class EggCatcher extends JavaPlugin { public class EggCatcher extends JavaPlugin {
@ -55,17 +56,23 @@ public class EggCatcher extends JavaPlugin {
pm.registerEvents(entityListener, this); pm.registerEvents(entityListener, this);
if (getServer().getPluginManager().getPlugin("Vault") != null) { if (getServer().getPluginManager().getPlugin("Vault") != null) {
economy = getServer().getServicesManager() RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
.getRegistration(Economy.class).getProvider(); .getRegistration(Economy.class);
if(economyProvider!=null){
economy = economyProvider.getProvider();
}
} }
} }
public void CheckConfigurationFile() { public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0); double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion == 1.17) {
if (configVersion == 1.16) {
// //
this.saveConfig(); this.saveConfig();
}
if (configVersion == 1.16) {
this.getConfig().set("ConfigVersion", 1.17);
this.saveConfig();
} else { } else {
this.saveResource("config.yml", true); this.saveResource("config.yml", true);
this.reloadConfig(); this.reloadConfig();

View File

@ -1,5 +1,5 @@
name: EggCatcher name: EggCatcher
version: 1.16 version: 1.17
description: This plugin allows you to catch mobs in eggs. description: This plugin allows you to catch mobs in eggs.
author: shansen author: shansen