   "Format entity state for use with spatial index. Includes all
    collision component state in the metadata of the spatial tree item"
   [id {:keys [pos-x pos-y offset-x offset-y]} {:keys [height width attributes]}]
-  (rbush-item pos-x
+  (r/rbush-item pos-x
               pos-y
               ;; Adjust the width and height of the bounding box based
               ;; on where the entity will be next frame

       (not (attack? attributes))
       (not (keyword-identical? id (:from-id attributes)))))

(defn ^boolean not-self? [id item]
  (not (keyword-identical? id (:id (nth item 4)))))

(defn ^boolean not-self-attack? [id item]
  (not (keyword-identical? id (get-in (nth item 4) [:attributes :from-id]))))

(defn collision-events
  "Returns a hashmap of all collision events by entity ID"

      (if item
        (if (valid-collision-item? item width height)
          (let [id (:id (nth item 4))
                collisions (r/rbush-search spatial-index item)]
            (if (some #(not (or (self? id %) (self-attack? id %)))
                      collisions)
              (recur (rest items)
                     (assoc! accum id [(ev/mk-event {:collisions collisions}
