Skip to content

Commit

Permalink
Fix IllegalArgumentException in BukkitSerialization
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew121410 committed May 21, 2024
1 parent b1765b2 commit 2b01453
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static String serializeItemStack(ItemStack itemStack) throws IllegalState
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
DataOutput output = new DataOutputStream(outputStream);

if (itemStack == null) {
if (itemStack == null || itemStack.getType().isAir()) {
output.writeInt(0);
return Base64Coder.encodeLines(outputStream.toByteArray());
}
Expand Down Expand Up @@ -57,7 +57,7 @@ public static String serialize(ItemStack[] items) {
output.writeInt(items.length);

for (ItemStack item : items) {
if (item == null) {
if (item == null || item.getType().isAir()) {
output.writeInt(0);
continue;
}
Expand Down

0 comments on commit 2b01453

Please sign in to comment.