Skip to content

Commit

Permalink
[docs] 'item', 'recipe', 'sky', 'tree', 'biome', 'dimension' document…
Browse files Browse the repository at this point in the history
…ation added.
  • Loading branch information
Unarelith committed Mar 12, 2020
1 parent d861627 commit 292595e
Show file tree
Hide file tree
Showing 12 changed files with 646 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Contributions are **welcome** and will be fully **credited**.

- **Read the coding style** - Make sure you read the [coding style](https://github.com/Unarelith/OpenMiner/wiki/Coding-Style) before opening a pull request.

- **Document any change in behaviour** - Make sure any relevant documentation is kept up-to-date.
- **Document any change in behaviour** - Make sure any relevant [documentation](https://openminer.readthedocs.io/en/latest/) is kept up-to-date.

- **Create feature branches** - Don't ask us to pull from your master branch.

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ The long-term goal of this project is to provide a viable alternative to Minecra
## Wiki

- [Getting started](https://github.com/Unarelith/OpenMiner/wiki/Getting-Started)
- [Coding style](https://github.com/Unarelith/OpenMiner/wiki/Coding-Style)
- [Contributing](https://github.com/Unarelith/OpenMiner/blob/master/CONTRIBUTING.md)
- [Coding style](https://github.com/Unarelith/OpenMiner/wiki/Coding-Style)
- [Lua API](https://openminer.readthedocs.io/en/latest/lua-api-overview/)
- [Blocks](https://openminer.readthedocs.io/en/latest/lua-api-blocks/)
- [Block](https://openminer.readthedocs.io/en/latest/lua-api-block/)
- [Item](https://openminer.readthedocs.io/en/latest/lua-api-item/)
- [Recipe](https://openminer.readthedocs.io/en/latest/lua-api-recipe/)
- [Sky](https://openminer.readthedocs.io/en/latest/lua-api-sky/)
- [Tree](https://openminer.readthedocs.io/en/latest/lua-api-tree/)
- [Biome](https://openminer.readthedocs.io/en/latest/lua-api-biome/)
- [Dimension](https://openminer.readthedocs.io/en/latest/lua-api-dimension/)
- [Network Protocol](https://github.com/Unarelith/OpenMiner/wiki/Network-Protocol)

## Keys

Expand Down
8 changes: 7 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
- [Contributing](https://github.com/Unarelith/OpenMiner/blob/master/CONTRIBUTING.md)
- [Coding Style](https://github.com/Unarelith/OpenMiner/wiki/Coding-Style)
- [Lua API](lua-api-overview.md)
- [Blocks](lua-api-blocks.md)
- [Block](lua-api-block.md)
- [Item](lua-api-item.md)
- [Recipe](lua-api-recipe.md)
- [Sky](lua-api-sky.md)
- [Tree](lua-api-tree.md)
- [Biome](lua-api-biome.md)
- [Dimension](lua-api-dimension.md)
- [Network Protocol](https://github.com/Unarelith/OpenMiner/wiki/Network-Protocol)

## Other
Expand Down
214 changes: 214 additions & 0 deletions docs/lua-api-biome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
# Lua API: Biome

## Example

```lua
mod:biome {
id = "desert",
name = "Desert",

params = {
temperature = -0.3,
precipitation = -0.7
},

trees = {
{
type = "default:tree_cactus",
probability = 0.001,
}
},

flora = {
{
block = "default:deadbush",
spawns_on = "default:sand",
probability = 0.005,
}
},

top_block = "default:sand",
ground_block = "default:sand",
deep_block = "default:stone",
beach_block = "default:sand",
liquid_block = "default:water",
portal_block = "default:portal",
portal_frame_block = "default:obsidian",
}
```

## Attributes

### `id`

ID of the biome. **Mandatory field.**

Example:
```lua
id = "biome_desert"
```

IDs are usually of the form `mod:biome` but the `mod:` prefix is prepended automatically so it's not needed.

### `name`

Label of the biome. **Mandatory field.**

Example:
```lua
name = "Desert"
```

This label is the name that will appear everywhere in the game.

### `params`

Parameters used to generate the biome.

Example:
```lua
params = {
temperature = -0.3,
precipitation = -0.7
}
```

Current valid parameters are:

- `temperature`
- `precipitation`

### `top_block`

String ID of the block used on the top of the terrain.

Example:
```lua
top_block = "default:grass"
```

### `ground_block`

String ID of the block used for the upper part of the terrain, under `top_block`.

Example:
```lua
ground_block = "default:dirt"
```

### `deep_block`

String ID of the block used for the lower part of the terrain, below `ground_block`.

Example:
```lua
deep_block = "default:stone"
```

### `beach_block`

String ID of the block used around and under `liquid_block`.

Example:
```lua
beach_block = "default:sand"
```

### `liquid_block`

String ID of the block used to make lakes under `SEALEVEL` (see EngineConfig.hpp).

Example:
```lua
liquid_block = "default:water"
```

### `portal_block`

String ID of the block used to generate portal center.

Example:
```lua
portal_block = "default:portal"
```

**Note:** This attribute is temporary and will get removed soon.

### `portal_frame_block`

String ID of the block used to generate portal frame.

Example:
```lua
portal_frame_block = "default:obsidian"
```

**Note:** This attribute is temporary and will get removed soon.

### `trees`

Table that defines tree placement.

Example:
```lua
trees = {
{
type = "default:oak",
probability = 0.01
},
{
type = "default:cactus",
probability = 0.001
}
}
```

Possible attributes:
- `type`: String ID of the tree definition
- `probability`: Probability to spawn this tree

### `flora`

Table that defines flora placement.

Example:
```lua
flora = {
{
block = "default:tallgrass",
spawns_on = "default:grass",
probability = 0.25
},
{
block = "default:dandelion",
spawns_on = "default:grass",
probability = 0.025
}
}
```

Possible attributes:
- `block`: Block used as flora
- `spawn_on`: What the block below must be
- `probability`: Probability to spawn `block`

### `ores`

Table that defines ore placement.

Example:
```lua
ores = {
{
block = "default:iron_ore",
probability = 0.0003,
size = 8
}
}
```

Possible attributes:
- `block`: Ore block to be used
- `probability`: Probability to spawn an ore vein with that block
- `size`: Ore vein size

15 changes: 12 additions & 3 deletions docs/lua-api-blocks.md → docs/lua-api-block.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lua API: Blocks
# Lua API: Block

## Example

Expand Down Expand Up @@ -45,11 +45,20 @@ tiles = "myblock.png"
tiles = {"myblock_top.png", "myblock_bottom.png", "myblock_side.png"}
```

More documentation will come on the table form.
Table format:
```cpp
// namely: West, East, South, North, Bottom, Top
{0, 0, 0, 0, 0, 0}, // for size = 1
{1, 1, 1, 1, 0, 0}, // for size = 2
{2, 2, 2, 2, 1, 0}, // for size = 3
{2, 3, 3, 3, 1, 0}, // for size = 4
{2, 3, 4, 4, 1, 0}, // for size = 5
{2, 3, 4, 5, 1, 0}, // for size = 6
```
The textures will be loaded from `mods/<your-mod>/textures/blocks`
**Note:** Currently, you can only use textures of the exact same size (16x16, 32x32) than the other block textures in the game.
**Note:** Currently, you can only use textures of the exact same size (16x16, 32x32) than the other block/item textures in the game.
### `harvest_requirements`
Expand Down
57 changes: 57 additions & 0 deletions docs/lua-api-dimension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Lua API: Dimension

## Example

```lua
mod:dimension {
id = "overworld",
name = "Overworld",

biomes = {"default:grassland", "default:desert"},

sky = "default:sky_overworld",
}
```

## Attributes

### `id`

ID of the dimension. **Mandatory field.**

Example:
```lua
id = "dimension_nether"
```

IDs are usually of the form `mod:dimension` but the `mod:` prefix is prepended automatically so it's not needed.

### `name`

Label of the dimension. **Mandatory field.**

Example:
```lua
name = "Nether"
```

This label is the name that will appear everywhere in the game.

### `biomes`

Table containing all the string IDs of the possible biomes for this dimension.

Example:
```lua
biomes = {"default:grassland", "default:desert"}
```

### `sky`

String ID of the sky definition used for this dimension.

Example:
```lua
sky = "default:sky_nether"
```

Loading

0 comments on commit 292595e

Please sign in to comment.