From dd87aef06606c2e4136b6ede00b5979e84c92af2 Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Fri, 20 Jan 2012 00:10:16 +0100 Subject: [PATCH] replaced version-number-check with failsafe ClassNotFound-check Fixes Ticket 1 :) --- .../minecraft/limitedcreative/LimitedCreativeCore.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/de/jaschastarke/minecraft/limitedcreative/LimitedCreativeCore.java b/src/de/jaschastarke/minecraft/limitedcreative/LimitedCreativeCore.java index 6d0fcc0..57292f3 100644 --- a/src/de/jaschastarke/minecraft/limitedcreative/LimitedCreativeCore.java +++ b/src/de/jaschastarke/minecraft/limitedcreative/LimitedCreativeCore.java @@ -21,7 +21,6 @@ import java.util.logging.Logger; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; -import static de.jaschastarke.minecraft.utils.Util.versionCompare; import static de.jaschastarke.minecraft.utils.Locale.L; import de.jaschastarke.minecraft.utils.Locale; @@ -44,7 +43,11 @@ public class LimitedCreativeCore extends JavaPlugin { public void onEnable() { plugin = this; config = new Configuration(this); - serializeFallBack = versionCompare(getServer().getBukkitVersion().replaceAll("-.*$", ""), "1.1") < 0; + try { + Class.forName("org.bukkit.configuration.file.YamlConstructor", false, getClassLoader()); + } catch (ClassNotFoundException e) { + serializeFallBack = true; + } new Locale(this);