ItemStack stack = player.getInventory().getHelmet();
if (stack != null)
copiedInventory.add(new InventoryEntry(HELMET, stack.clone()));
stack = player.getInventory().getChestplate();
if (stack != null)
copiedInventory.add(new InventoryEntry(CHESTPLATE, stack.clone()));
stack = player.getInventory().getLeggings();
if (stack != null)
copiedInventory.add(new InventoryEntry(LEGGINGS, stack.clone()));
stack = player.getInventory().getBoots();
if (stack != null)