Fix StreamSerializer backwards compatibility (#1868)

Fixes #1813
This commit is contained in:
caoli5288 2022-10-17 02:37:08 +08:00 committed by GitHub
parent 43145bd478
commit 69ae3656b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));
}
/**