Changed for loop to foreach / enhanced for loop

This commit is contained in:
Naman
2018-07-11 10:19:22 -05:00
parent bd7b57cf5a
commit fded071136
2 changed files with 6 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package com.massivecraft.factions.util;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@@ -23,8 +24,8 @@ public class InventoryUtil {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
dataOutput.writeInt(items.length);
for (int i = 0; i < items.length; i++) {
dataOutput.writeObject(items[i]);
for (ItemStack item: items) {
dataOutput.writeObject(item);
}
dataOutput.close();
return Base64Coder.encodeLines(outputStream.toByteArray());