-
Notifications
You must be signed in to change notification settings - Fork 35
Recipe management
CmdrDats edited this page Dec 30, 2012
·
1 revision
(:require [cljminecraft.recipes :as r])
Source: recipes.clj
Lets you define new shaped or shapeless recipes in a consistent, quick, declarative style.
An example (from recipes.clj) should make the most sense:
(def material-map
{\W :wood \D :dirt \S :stone \O :compass})
(register-recipes
(recipe material-map :ink_sack "WW" 2)
(recipe material-map :monster_egg [" D " "DWD" " D "]))
So, here we're defining an unshaped recipe that takes 2 Wood to create 2 ink sacks (makes sense, right?) and a shaped recipe (notice the square brackets for a vector) to create a monster egg out of wood-in-the-middle and dirt-on-every-side.
See the materials at the [Item functions](Item functions) for an expanding explanation of how the material :keywords work.