mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
collect generator voxel fragments to directory
This commit is contained in:
parent
788ad1f6a6
commit
d839da7dab
8 changed files with 5 additions and 3 deletions
|
|
@ -180,12 +180,14 @@ static int l_get_default_generator(lua::State* L) {
|
|||
/// @brief Get a list of all world generators
|
||||
/// @return A table with the IDs of all world generators
|
||||
static int l_get_generators(lua::State* L) {
|
||||
if (content == nullptr) {
|
||||
throw std::runtime_error("content is not initialized");
|
||||
}
|
||||
const auto& generators = content->generators.getDefs();
|
||||
lua::createtable(L, generators.size(), 0);
|
||||
|
||||
int i = 0;
|
||||
for (auto& [name, _] : generators) {
|
||||
std::cout << name << std::endl;
|
||||
lua::pushstring(L, name);
|
||||
lua::rawseti(L, i + 1);
|
||||
i++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue