Clojure API for Glowstone
Clojure API for Glowstone
Bukkit wrapper and
Bukkit wrapper and
No vars found in this namespace.
Create and handle Glowstone ServerConfig instances
Generally to configure Glowstone you edit YAML files, but that's not very
Clojure-y. This config munging below allows you to define config values as
inline EDN. The values in the config map that you provide to data-config
or server-config are keywords derived from the ServerConfig$Key enum,
see (keys config-keys)
Create and handle Glowstone ServerConfig instances Generally to configure Glowstone you edit YAML files, but that's not very Clojure-y. This config munging below allows you to define config values as inline EDN. The values in the config map that you provide to [[data-config]] or [[server-config]] are keywords derived from the `ServerConfig$Key` enum, see `(keys config-keys)`
Logo-like API for drawing blocks by using a walking metaphor.
This is a functional API, movements simply build up a list of block positions,
call build at the end to actually make them materialize in the game.
A cursor contains a current location (x/y/z), a directions (:north, :north-east, :east, etc.), and a current building material, e.g :lapis-block (see [[lambdaisland.witchcraft.bukkit/materials]]).
It also contains a drawing flag :draw? and a list of blocks :blocks. When
drawing is on, then any step will add a block to the list. build creates
blocks in the world based on this, and resets the list.
Call start to get an initial cursor, this will return a cursor that is one
step ahead of the player (so what you draw is in sight), facing away from the
player.
(require '[lambdaisland.witchcraft.cursor :as c])
(-> (c/start)
(c/draw)
(c/material :red-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :blue-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :green-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :yellow-glazed-terracotta)
(c/steps 3)
(c/build)
)
Logo-like API for drawing blocks by using a walking metaphor.
This is a functional API, movements simply build up a list of block positions,
call [[build]] at the end to actually make them materialize in the game.
A cursor contains a current location (x/y/z), a
directions (:north, :north-east, :east, etc.), and a current building
material, e.g :lapis-block (see [[lambdaisland.witchcraft.bukkit/materials]]).
It also contains a drawing flag `:draw?` and a list of blocks `:blocks`. When
drawing is on, then any step will add a block to the list. [[build]] creates
blocks in the world based on this, and resets the list.
Call [[start]] to get an initial cursor, this will return a cursor that is one
step ahead of the player (so what you draw is in sight), facing away from the
player.
```
(require '[lambdaisland.witchcraft.cursor :as c])
(-> (c/start)
(c/draw)
(c/material :red-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :blue-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :green-glazed-terracotta)
(c/steps 3)
(c/rotate 2)
(c/material :yellow-glazed-terracotta)
(c/steps 3)
(c/build)
)
```
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |