Add Raw Byte ItemStack Serialization

Serializes using NBT which is safer for server data migrations than bukkits format.

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
This commit is contained in:
Mariell Hoversholm
2020-04-30 16:56:31 +02:00
parent a690b2a859
commit 21792a6e4b
4 changed files with 123 additions and 0 deletions

View File

@@ -14,7 +14,11 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization;
* <p>
* Behavior of implementations extending this class is not guaranteed across
* future versions.
* @deprecated Object streams on their own are not safe. For safer and more consistent serialization of items,
* use {@link org.bukkit.inventory.ItemStack#serializeAsBytes()} or
* {@link org.bukkit.inventory.ItemStack#serializeItemsAsBytes(java.util.Collection)}.
*/
@Deprecated(since = "1.21") // Paper
public class BukkitObjectInputStream extends ObjectInputStream {
/**

View File

@@ -14,7 +14,11 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
* <p>
* Behavior of implementations extending this class is not guaranteed across
* future versions.
* @deprecated Object streams on their own are not safe. For safer and more consistent serialization of items,
* use {@link org.bukkit.inventory.ItemStack#serializeAsBytes()} or
* {@link org.bukkit.inventory.ItemStack#serializeItemsAsBytes(java.util.Collection)}.
*/
@Deprecated(since = "1.21") // Paper
public class BukkitObjectOutputStream extends ObjectOutputStream {
/**