public void grabTexture(int var1, boolean var2) {
      int var3;
      if((var3 = this.getSlot(var1)) >= 0) {
         this.selected = var3;
      } else {
         if(var2 && var1 > 0 && SessionData.allowedBlocks.contains(Block.blocks[var1])) {
            this.replaceSlot(Block.blocks[var1]);
         }

      }
   }