Fixed bug where config file gets rewritten

on every reload.
This commit is contained in:
shansen 2012-04-03 13:14:07 +02:00
parent 12033af8aa
commit 87aac15567
2 changed files with 10 additions and 8 deletions

View File

@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
package me.shansen.EggCatcher;
@ -56,9 +56,9 @@ public class EggCatcher extends JavaPlugin {
pm.registerEvents(entityListener, this);
if (getServer().getPluginManager().getPlugin("Vault") != null) {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
.getRegistration(Economy.class);
if(economyProvider!=null){
RegisteredServiceProvider<Economy> economyProvider = getServer()
.getServicesManager().getRegistration(Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
}
@ -66,11 +66,13 @@ public class EggCatcher extends JavaPlugin {
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion == 1.17) {
if (configVersion == 1.18) {
//
this.saveConfig();
}
if (configVersion == 1.16) {
} else if (configVersion == 1.17) {
this.getConfig().set("ConfigVersion", 1.18);
this.saveConfig();
} else if (configVersion == 1.16) {
this.getConfig().set("ConfigVersion", 1.17);
this.saveConfig();
} else {

View File

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