Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,17 @@ void craftItem(World world, BlockPos pos, ItemStack machineStack, NBTTagCompound
world.spawnEntity(entity);
}
}
for (ItemStack item2 : items.keySet().toArray(new ItemStack[items.size()]))
for (ItemStack item2 : items.keySet())
{
if (items.get(item2) > 0)
int remaining = items.get(item2);
while (remaining > 0)
{
int amount = Math.min(item2.getMaxStackSize(), remaining);
EntityItem entity = new EntityItem(world, pos.getX() + 0.5F, pos.getY() + 1.5F,
pos.getZ() + 0.5F, item2);
entity.getItem().setCount(items.get(item2));
pos.getZ() + 0.5F, item2.copy());
entity.getItem().setCount(amount);
world.spawnEntity(entity);
remaining -= amount;
}
}
}
Expand Down