From 69ae3656b54df8b2aa363a2039328e4f64074125 Mon Sep 17 00:00:00 2001 From: caoli5288 Date: Mon, 17 Oct 2022 02:37:08 +0800 Subject: [PATCH] Fix StreamSerializer backwards compatibility (#1868) Fixes #1813 --- .../java/com/comphenix/protocol/utility/StreamSerializer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/comphenix/protocol/utility/StreamSerializer.java b/src/main/java/com/comphenix/protocol/utility/StreamSerializer.java index 49ca3c7f..fd1f03c3 100644 --- a/src/main/java/com/comphenix/protocol/utility/StreamSerializer.java +++ b/src/main/java/com/comphenix/protocol/utility/StreamSerializer.java @@ -175,7 +175,7 @@ public class StreamSerializer { * @throws IOException If the operation fails due to reflection problems. */ public String serializeItemStack(ItemStack stack) throws IOException { - return Base64.getEncoder().encodeToString(this.serializeItemStackToByteArray(stack)); + return Base64.getMimeEncoder().encodeToString(this.serializeItemStackToByteArray(stack)); } /** @@ -185,7 +185,7 @@ public class StreamSerializer { * @return A deserialized item stack, or NULL if the serialized ItemStack was also NULL. */ public ItemStack deserializeItemStack(String input) { - return this.deserializeItemStackFromByteArray(Base64.getDecoder().decode(input)); + return this.deserializeItemStackFromByteArray(Base64.getMimeDecoder().decode(input)); } /**