public void testJson() { if (!MinecraftVersion.hasGsonSupport()) { getLogger().warning( "Wasn't able to find Gson! The Item-NBT-API may not work with Json serialization/deserialization!"); return; getLogger().warning( "Wasn't able to find JSON key! The Item-NBT-API may not work with Json serialization/deserialization!"); jsonCompatible = false; SimpleJsonTestObject simpleObject = nbtItem.getObject(JSON_TEST_KEY, SimpleJsonTestObject.class); if (simpleObject == null) { getLogger().warning( "Wasn't able to check JSON key! The Item-NBT-API may not work with Json serialization/deserialization!"); jsonCompatible = false; || simpleObject.getTestDouble() != DOUBLE_TEST_VALUE || !simpleObject.isTestBoolean() == BOOLEAN_TEST_VALUE) { getLogger().warning( "One key does not equal the original value in JSON! The Item-NBT-API may not work with Json serialization/deserialization!"); jsonCompatible = false; getLogger().log(Level.SEVERE, null, ex); getLogger().warning(ex.getMessage()); jsonCompatible = false;
instance = this; new MetricsLite(this); getLogger().info("Checking bindings..."); getLogger().info("Minecraft Version:"); MinecraftVersion.getVersion(); getLogger().info("Gson:"); MinecraftVersion.hasGsonSupport(); getLogger().info("Classes:"); for (ClassWrapper c : ClassWrapper.values()) { if (c.getClazz() == null) { getLogger().warning(c.name() + " did not find it's class!"); compatible = false; getLogger().info("Methods:"); for (ReflectionMethod method : ReflectionMethod.values()) { if (method.isCompatible() && !method.isLoaded()) { getLogger().warning(method.name() + " did not find the method!"); compatible = false; getLogger().info("Running NBT reflection test..."); try { NBTList list = comp.getList("testlist", NBTType.NBTTagString); if (MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4) { getLogger().warning( "Skipped the NBTList check, because 1.7 doesn't fully support it! The Item-NBT-API may not work!"); } else { getLogger().warning("Wasn't able to check a key! The Item-NBT-API may not work!");