Skip to content

Instantly share code, notes, and snippets.

@sjl
Created July 6, 2011 00:23
Show Gist options
  • Save sjl/1066276 to your computer and use it in GitHub Desktop.
Save sjl/1066276 to your computer and use it in GitHub Desktop.
(defn- read-packet-playerpositionlook [bot conn]
(let [payload (assoc {}
:x (-read-double conn)
:stance (-read-double conn)
:y (-read-double conn)
:z (-read-double conn)
:yaw (-read-float conn)
:pitch (-read-float conn)
:onground (-read-bool conn))]
(dosync (alter (:player bot) merge {:location payload}))
payload))
(defn- write-packet-playerpositionlook [conn {x :x y :y stance :stance z :z yaw :yaw pitch :pitch onground :onground}]
(-write-double conn x)
(-write-double conn y)
(-write-double conn stance)
(-write-double conn z)
(-write-float conn yaw)
(-write-float conn pitch)
(-write-bool conn onground))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment