From 3faedec602757e89db74512382cde93c1a0ab70d Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 19 Dec 2012 23:26:29 +0100 Subject: [PATCH] Fix Spawns / Jail loading --- .../com/earth2me/essentials/storage/BukkitConstructor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java index e5fc19ea3..8c12acfe3 100644 --- a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java +++ b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java @@ -13,22 +13,22 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.material.MaterialData; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPluginLoader; import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor; import org.yaml.snakeyaml.error.YAMLException; import org.yaml.snakeyaml.introspector.Property; import org.yaml.snakeyaml.nodes.*; -public class BukkitConstructor extends Constructor +public class BukkitConstructor extends CustomClassLoaderConstructor { private final transient Pattern NUMPATTERN = Pattern.compile("\\d+"); private final transient Plugin plugin; public BukkitConstructor(final Class clazz, final Plugin plugin) { - super(clazz); + super(clazz, plugin.getClass().getClassLoader()); this.plugin = plugin; yamlClassConstructors.put(NodeId.scalar, new ConstructBukkitScalar()); yamlClassConstructors.put(NodeId.mapping, new ConstructBukkitMapping()); @@ -276,6 +276,7 @@ public class BukkitConstructor extends Constructor return super.construct(node); } + @Override protected Object constructJavaBean2ndStep(final MappingNode node, final Object object) { Map, TypeDescription> typeDefinitions;