def9fb85e827

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 21 Jun 2011 21:08:19 -0400
parents 6f3e12a573a2
children 2ace53af7b31
branches/tags (none)
files src/clojurecraft/core.clj

Changes

--- a/src/clojurecraft/core.clj	Tue Jun 21 21:06:48 2011 -0400
+++ b/src/clojurecraft/core.clj	Tue Jun 21 21:08:19 2011 -0400
@@ -14,6 +14,7 @@
      0x05 :equipment 
      0x06 :spawnposition
      0x07 :useentity
+     0x08 :updatehealth
 })
 (def packet-ids (apply assoc {} (mapcat reverse packet-types)))
 
@@ -170,6 +171,10 @@
           (assoc :target (-read-int conn))
           (assoc :leftclick (-read-bool conn))))
 
+(defn read-packet-updatehealth [conn]
+      (-> {}
+          (assoc :health (-read-short conn))))
+
 
 ; Reading Wrappers -----------------------------------------------------------------
 (defn read-packet [conn packet-id]
@@ -186,6 +191,7 @@
             (= packet-type :equipment) (read-packet-equipment conn)
             (= packet-type :spawnposition) (read-packet-spawnposition conn)
             (= packet-type :useentity) (read-packet-useentity conn)
+            (= packet-type :updatehealth) (read-packet-updatehealth conn)
             :else (str "UNKNOWN PACKET TYPE: " packet-id)
             ))
         (println "\n\n\n")))