mirror of
https://github.com/shansen/EggCatcher.git
synced 2024-11-22 18:16:15 +01:00
Bugfix for Vault initialization.
This commit is contained in:
parent
242a279af2
commit
12033af8aa
6
pom.xml
6
pom.xml
@ -17,7 +17,7 @@
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>bukkit-repo</id>
|
||||
<url>http://repo.bukkit.org/content/repositories/snapshots/</url>
|
||||
<url>http://repo.bukkit.org/content/repositories/releases/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@ -25,12 +25,12 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.2.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.2.4-R1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
<version>1.2.8</version>
|
||||
<version>1.2.13</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -28,6 +28,7 @@ import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class EggCatcher extends JavaPlugin {
|
||||
@ -55,17 +56,23 @@ public class EggCatcher extends JavaPlugin {
|
||||
pm.registerEvents(entityListener, this);
|
||||
|
||||
if (getServer().getPluginManager().getPlugin("Vault") != null) {
|
||||
economy = getServer().getServicesManager()
|
||||
.getRegistration(Economy.class).getProvider();
|
||||
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
|
||||
.getRegistration(Economy.class);
|
||||
if(economyProvider!=null){
|
||||
economy = economyProvider.getProvider();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckConfigurationFile() {
|
||||
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
|
||||
|
||||
if (configVersion == 1.16) {
|
||||
if (configVersion == 1.17) {
|
||||
//
|
||||
this.saveConfig();
|
||||
}
|
||||
if (configVersion == 1.16) {
|
||||
this.getConfig().set("ConfigVersion", 1.17);
|
||||
this.saveConfig();
|
||||
} else {
|
||||
this.saveResource("config.yml", true);
|
||||
this.reloadConfig();
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: EggCatcher
|
||||
version: 1.16
|
||||
version: 1.17
|
||||
description: This plugin allows you to catch mobs in eggs.
|
||||
author: shansen
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user