replaced version-number-check with failsafe ClassNotFound-check

Fixes Ticket 1 :)
This commit is contained in:
Jascha Starke 2012-01-20 00:10:16 +01:00
parent 8c719cccdb
commit dd87aef066

View file

@ -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);