Advertisement
Guest User

Untitled

a guest
Dec 27th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 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.             }
  15.  
  16.             if (stackInSlot != null) {
  17.                 if (stackInSlot.getItem() == Item.getItemFromBlock(Blocks.wooden_slab)) {
  18.                     if (plank != null) return false;
  19.                     plank = stackInSlot;
  20.                 }
  21.             }
  22.         }
  23.         return saw != null;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement