Advertisement
wreed12345

Untitled

Jul 28th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. @EventHandler
  2. public void onCraftItem(CraftItemEvent e)
  3. {
  4.     System.out.println("init");
  5.     ItemStack[] stacks = e.getInventory().getMatrix(); // for some reason
  6.                // has 10 elements
  7.                // always
  8.                
  9.     //the above always has 10 elements which most likely
  10.     //means that some will be null of nothing is contained
  11.     System.out.println(stacks.length);
  12.    
  13.     for (ItemStack i : stacks)
  14.     {
  15.         if(i == null)
  16.             continue;
  17.        
  18.         System.out.println(i.getItemMeta().getDisplayName());
  19.     }
  20.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement