Beet plugin to generate Minecraft worldgen files
Project description
gaia-beet
Beet plugin to generate Minecraft worldgen files
Introduction
Writing density functions in JSON by hand can be tiring and confusing. This package allows you to write them as natural looking expressions.
gaia.df("basic:foo", abs(DF.const(4) ** 3) + DF.ref("basic:bar"))
Installation
The package can be installed with pip
.
$ pip install gaia-beet
Getting started
When using with beet
, a simple beet.yml
is enough:
pipeline:
- main
This references a main.py
plugin file where the density functions will be defined:
from beet import Context
from gaia_beet import Gaia, DensityFunction as DF
def beet_default(ctx: Context):
gaia = ctx.inject(Gaia)
blah = DF.slide(DF.const(2))
foo = gaia.df("basic:foo", abs(DF.const(4) ** 3) + blah)
gaia.df("basic:bar", blah * foo)
Contributing
Contributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The project uses poetry
.
$ poetry install
You can run the tests with poetry run pytest
.
$ poetry run pytest
The project must type-check with pyright
. If you're using VSCode the pylance
extension should report diagnostics automatically. You can also install the type-checker locally with npm install
and run it from the command-line.
$ npm run watch
$ npm run check
The code follows the black
code style. Import statements are sorted with isort
.
$ poetry run isort gaia_beet examples tests
$ poetry run black gaia_beet examples tests
$ poetry run black --check gaia_beet examples tests
License - MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gaia_beet-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75d3817882c9b06c5ba7f55f371065c3bf7a7397e07c7247596a0e596a1ebd37 |
|
MD5 | bf1d4cbe740c137cb553eadd9a5eed0e |
|
BLAKE2b-256 | 9d19f3bb9cad13ecd3ce28780d44a6b345e808a4eda6042d7296dfd55e476dc8 |