OpenMiner/Notes

70 lines
1.1 KiB
Plaintext
Raw Normal View History

2018-06-20 05:43:52 +02:00
Notes
# Lua API integration
## HUD
```lua
2019-01-07 03:55:37 +01:00
local hud = LuaHUD.new()
2019-01-07 03:55:37 +01:00
hud:hotbar {
pos = {x = 42, y = 84},
texture = "default_hotbar.png",
slots = 8,
}
2019-01-07 03:55:37 +01:00
openminer:player():set_hud(hud)
```
## World
2019-01-07 03:55:37 +01:00
```lua
openminer:get_block(pos)
openminer:get_meta(pos)
openminer:get_inventory(pos)
```
## Biome definition
```lua
mod:biome {
name = "grassland",
top_block = "default:grass",
ground_block = "default:dirt",
deep_block = "default:stone",
beach_block = "default:sand",
liquid_block = "default:water",
tree = {
type = "basic", -- only one type of tree to start
leaf_block = "default:leaves",
log_block = "default:log",
},
flora = {
{
block = "default:tallgrass",
spawns_on = "default:grass",
probability = 0.25 -- this in the range 0..1
},
{
block = "default:flower",
spawns_on = "default:grass",
probability = 0.1
}
}
}
```
* * *
# Old notes
2018-06-20 05:43:52 +02:00
• GUI Texture:
• Button: 200x20 (0;46, 0;66, 0;86)
• Hotbar: 182x22
• Selection: 24x24 (0;22)
> vim:ft=notes