Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public static void removeItem(EntityPlayer player, ItemStack is, int amount) {
  2. if(is == null)
  3. return;
  4.  
  5. int removed = 0;
  6.  
  7. for(ItemStack stack : player.inventory.mainInventory) {
  8. if(stack != null && removed <= is.stackSize) {
  9. if(areItemStacksEqual(stack, is)) {
  10. stack.stackSize--;
  11. removed++;
  12. }
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement