Skip to content

Instantly share code, notes, and snippets.

@bgnori
Created May 5, 2012 03:00
Show Gist options
  • Save bgnori/2599289 to your computer and use it in GitHub Desktop.
Save bgnori/2599289 to your computer and use it in GitHub Desktop.
(defn fusion-wall [player]
(let [world (.getWorld player)
loc (.getLocation player)
direction (.normalize (.setY (.getDirection loc) 0))
perpendicular (.normalize ( .setZ (.setY (.setX direction ;fixme
(.getZ direction)
)
0.0 )
(* -1 (.getX direction))
))
height (.normalize (
.setZ (.setY (.setX (.clone direction) ;FIXME (Vector. 1 2 3) fails.
0.0)
1.0)
0.0
))
fusion-at (.add (.clone loc) (.multiply (.clone direction) 10))
]
(prn fusion-wall loc)
(prn fusion-at height perpendicular)
(doseq [i (range 1 10) j [-1 0 1]]
(let [x
(.add (.add (.clone fusion-at) (.multiply (.clone perpendicular) j) ) (.multiply (.clone height) i))
]
(prn x)
(.strikeLightningEffect world x)
(.setType (.getBlock x) Material/STONE)
;(Thread/sleep 40) ;(+ 30 (rand-int 50)))
)
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment