Guest User

Untitled

a guest
Jul 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. instance Binary MCInventory where
  2. put inv = return ()
  3. get = do
  4. t <- get
  5. c <- get
  6. items <- replicateM (fromIntegral c) $ do
  7. iid <- get :: Get Int16
  8. case (iid) of
  9. -1 -> return (-1, 0, 0)
  10. otherwise -> (iid, get, get)
  11. return (MCInventory t c items)
Add Comment
Please, Sign In to add comment