422b7fb72294

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 23 Jun 2011 19:43:16 -0400
parents a2bc9cda9da9
children ed5e7651a472
branches/tags (none)
files src/clojurecraft/core.clj

Changes

--- a/src/clojurecraft/core.clj	Thu Jun 23 19:38:05 2011 -0400
+++ b/src/clojurecraft/core.clj	Thu Jun 23 19:43:16 2011 -0400
@@ -349,6 +349,18 @@
 
   (-write-byte conn windowid))
 
+(defn write-packet-windowclick [conn {windowid :windowid slot :slot rightclick :rightclick actionnumber :actionnumber shift :shift itemid :itemid itemcount :itemcount itemuses :itemuses}]
+  (-write-byte conn (:windowclick packet-ids))
+
+  (-write-byte conn windowid)
+  (-write-short conn slot)
+  (-write-byte conn rightclick)
+  (-write-short conn actionnumber)
+  (-write-bool conn shift)
+  (-write-short conn itemid)
+  (-write-byte conn itemcount)
+  (-write-short conn itemuses))
+
 
 ; Writing Wrappers -----------------------------------------------------------------
 (defn flushc [conn]
@@ -384,6 +396,7 @@
     :newinvalidstate      (write-packet-newinvalidstate conn payload)
     :openwindow           (write-packet-openwindow conn payload)
     :closewindow          (write-packet-closewindow conn payload)
+    :windowclick          (write-packet-windowclick conn payload)
 
     )
   (flushc conn))