What is best way to serialize inventory with items and save it as text into SQLite row? I am creating "transmutators" plugin and I need whole inventory to be serialized as text to database. Thanks for any help!
ItemStack implements ConfigurationSerializable. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html#serialize-- https://hub.spigotmc.org/javadocs/s...ory/ItemStack.html#deserialize-java.util.Map-
So doing something like this Code (Java): ByteArrayOutputStream str = new ByteArrayOutputStream(); BukkitObjectOutputStream data = new BukkitObjectOutputStream(str); data.writeObject(itemstack); String base64 = Base64.getEncoder().encodeToString(str.toByteArray()); should be best? I see it is also Serializable (without any config) but I am asking for best way