Permalink
Browse files

implement line

  • Loading branch information...
1 parent 4ab46f0 commit fc7a2c7dc80a65357c8a62ce7277112e048a334d @CmdrDats committed Dec 29, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/cljminecraft/blocks.clj
@@ -231,9 +231,14 @@
;; to be finished......
(defaction line-to-mark
"Draw a line directly to a given mark from current point"
- ctx [mark]
- ctx
- )
+ {:keys [origin material marks]} [mark]
+ (let [originblock (.getBlock origin)
+ mat (i/get-material material)
+ point (location-to-point origin (:origin (get marks mark)))
+ linepoints (apply line point)]
+ (doseq [[x y z] linepoints]
+ (let [block (.getRelative originblock x y z)]
+ (.setTypeIdAndData block (.getItemTypeId mat) (.getData mat) false)))))
(defn line
"Draw a line, relative to current position and direction"

0 comments on commit fc7a2c7

Please sign in to comment.