Advertisement
Guest User

Untitled

a guest
Dec 27th, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. @Override
  2.     public boolean matches(InventoryCrafting inventoryCrafting, World world) {
  3.         ItemStack saw = null;
  4.         ItemStack plank = null;
  5.  
  6.         for (int i = 0; i < inventoryCrafting.getSizeInventory(); ++i) {
  7.             ItemStack stackInSlot = inventoryCrafting.getStackInSlot(i);
  8.  
  9.             if (stackInSlot != null) {
  10.                 if (stackInSlot.getItem() == ModItems.itemSaw) {
  11.                     if (saw != null) return false;
  12.                     saw = stackInSlot;
  13.  
  14.                     if (stackInSlot.getItem() == Item.getItemFromBlock(Blocks.wooden_slab)) {
  15.                         if (plank != null) return false;
  16.                         plank = stackInSlot;
  17.                     }
  18.                 }
  19.             }
  20.  
  21.         }
  22.         return saw != null && plank != null;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement