Liking cljdoc? Tell your friends :D

lambdaisland.witchcraft.cursor

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/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/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)
    )
```
raw docstring

lambdaisland.witchcraft.gallery.big-chicken

A 9 block high chicken shape

A 9 block high chicken shape
raw docstring

lambdaisland.witchcraft.gallery.ocean-space-base

A futuristic base consisting of a big torus suspending by three pointy towers.

A futuristic base consisting of a big torus suspending by three pointy towers.
raw docstring

lambdaisland.witchcraft.gallery.squid-casa-events

Event handlers that hook up two buttons to beam the player from one to the other.

Event handlers that hook up two buttons to beam the player from one to the
other.
raw docstring

No vars found in this namespace.

lambdaisland.witchcraft.glowstone

Glowstone specific code, in particular server start/stop logic. Kept separate to allow using the Witchcraft API in non-Glowstone Bukkit-compatible servers.

Glowstone specific code, in particular server start/stop logic. Kept separate
to allow using the Witchcraft API in non-Glowstone Bukkit-compatible servers.
raw docstring

lambdaisland.witchcraft.glowstone.config

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)`
raw docstring

lambdaisland.witchcraft.glowstone.worlds

Generate new worlds based on simple xyz->material functions

Quite naive, more a proof of concept.

Generate new worlds based on simple xyz->material functions

Quite naive, more a proof of concept.
raw docstring

lambdaisland.witchcraft.markup

Adding color and text effects to chat messages and titles via hiccup-like Markup

Adding color and text effects to chat messages and titles via hiccup-like
Markup
raw docstring

lambdaisland.witchcraft.matrix

Vector/Matrix math

A vector in this context can be anything that implements [[lambdaisland.witchcraft/with-xyz]]: a Clojure vector ([x y z]), a Clojure map ({:x .. :y .. :z ..}), or a Glowstone Location or Vector. You get the type back that you put in.

A matrix is a vector of vectors (regular Clojure vectors) and can be 3x3 (linear) or 4x4 (affine/homogenous).

This code is not optimized for speed, it is fine for generating and manipulating minecraft structures, not for heavy number crunching.

Vector/Matrix math

A vector in this context can be anything that
implements [[lambdaisland.witchcraft/with-xyz]]: a Clojure vector (`[x y z]`),
a Clojure map (`{:x .. :y .. :z ..}`), or a Glowstone `Location` or `Vector`.
You get the type back that you put in.

A matrix is a vector of vectors (regular Clojure vectors) and can be
3x3 (linear) or 4x4 (affine/homogenous).

This code is not optimized for speed, it is fine for generating and
manipulating minecraft structures, not for heavy number crunching.

raw docstring

lambdaisland.witchcraft.nrepl.task-eval

Schedule all nREPL eval operations on the server thread.

This way you don't have to wrap a lot of operations in a [[wc/run-task]].

Schedule all nREPL eval operations on the server thread.

This way you don't have to wrap a lot of operations in a [[wc/run-task]].
raw docstring

lambdaisland.witchcraft.palette

Utilities for constructing block palettes and working with texture colors.

Utilities for constructing block palettes and working with texture colors.
raw docstring

lambdaisland.witchcraft.paper

Start an embedded Paper server, and paper-specific extensions.

To use this you need to download Paper yourself, and start Clojure/JVM with the right args.

deps.edn:

:aliases {
:cider/nrepl
{:extra-deps
 {nrepl/nrepl                   {:mvn/version "0.8.3"}
  refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"}
  cider/cider-nrepl             {:mvn/version "0.26.0"}}}

:papermc
{:extra-deps {io.papermc/paper {:local/root "/home/arne/Downloads/paper-1.17.1-157.jar"}}
 :main-opts ["-m" "paper-witch"]}}
}

Command line:

clj -J-Dcom.mojang.eula.agree=true -J-javaagent:/home/arne/Downloads/paper-1.17.1-157.jar -A:cider/nrepl -M:papermc
Start an embedded Paper server, and paper-specific extensions.

To use this you need to download Paper yourself, and start Clojure/JVM with the right args.

deps.edn:
```
:aliases {
:cider/nrepl
{:extra-deps
 {nrepl/nrepl                   {:mvn/version "0.8.3"}
  refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"}
  cider/cider-nrepl             {:mvn/version "0.26.0"}}}

:papermc
{:extra-deps {io.papermc/paper {:local/root "/home/arne/Downloads/paper-1.17.1-157.jar"}}
 :main-opts ["-m" "paper-witch"]}}
}
```

Command line:
```
clj -J-Dcom.mojang.eula.agree=true -J-javaagent:/home/arne/Downloads/paper-1.17.1-157.jar -A:cider/nrepl -M:papermc
```
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close