Commits
Jofkos authored and md_5 committed b4e9811235e
5 5 | import java.lang.reflect.Method; |
6 6 | import java.lang.reflect.Modifier; |
7 7 | import java.util.HashMap; |
8 8 | import java.util.Map; |
9 9 | import java.util.logging.Level; |
10 10 | import java.util.logging.Logger; |
11 11 | |
12 12 | import org.apache.commons.lang.Validate; |
13 13 | import org.bukkit.Color; |
14 14 | import org.bukkit.FireworkEffect; |
15 + | import org.bukkit.Location; |
15 16 | import org.bukkit.block.banner.Pattern; |
16 17 | import org.bukkit.configuration.Configuration; |
17 18 | import org.bukkit.inventory.ItemStack; |
18 19 | import org.bukkit.potion.PotionEffect; |
19 20 | import org.bukkit.util.BlockVector; |
20 21 | import org.bukkit.util.Vector; |
21 22 | |
22 23 | /** |
23 24 | * Utility class for storing and retrieving classes for {@link Configuration}. |
24 25 | */ |
28 29 | private static Map<String, Class<? extends ConfigurationSerializable>> aliases = new HashMap<String, Class<? extends ConfigurationSerializable>>(); |
29 30 | |
30 31 | static { |
31 32 | registerClass(Vector.class); |
32 33 | registerClass(BlockVector.class); |
33 34 | registerClass(ItemStack.class); |
34 35 | registerClass(Color.class); |
35 36 | registerClass(PotionEffect.class); |
36 37 | registerClass(FireworkEffect.class); |
37 38 | registerClass(Pattern.class); |
39 + | registerClass(Location.class); |
38 40 | } |
39 41 | |
40 42 | protected ConfigurationSerialization(Class<? extends ConfigurationSerializable> clazz) { |
41 43 | this.clazz = clazz; |
42 44 | } |
43 45 | |
44 46 | protected Method getMethod(String name, boolean isStatic) { |
45 47 | try { |
46 48 | Method method = clazz.getDeclaredMethod(name, Map.class); |
47 49 | |