mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: load block and item scripts after content load
This commit is contained in:
parent
4c0c6dd51a
commit
a641099d36
5 changed files with 45 additions and 28 deletions
|
|
@ -157,10 +157,13 @@ void scripting::process_post_runnables() {
|
|||
}
|
||||
}
|
||||
|
||||
void scripting::on_content_load(Content* content) {
|
||||
scripting::content = content;
|
||||
scripting::indices = content->getIndices();
|
||||
}
|
||||
|
||||
void scripting::on_world_load(LevelController* controller) {
|
||||
scripting::level = controller->getLevel();
|
||||
scripting::content = level->content;
|
||||
scripting::indices = level->content->getIndices();
|
||||
scripting::blocks = controller->getBlocksController();
|
||||
scripting::controller = controller;
|
||||
|
||||
|
|
@ -671,7 +674,7 @@ int scripting::get_values_on_stack() {
|
|||
return lua::gettop(lua::get_main_state());
|
||||
}
|
||||
|
||||
void scripting::load_block_script(
|
||||
void scripting::load_content_script(
|
||||
const scriptenv& senv,
|
||||
const std::string& prefix,
|
||||
const fs::path& file,
|
||||
|
|
@ -692,7 +695,7 @@ void scripting::load_block_script(
|
|||
register_event(env, "on_blocks_tick", prefix + ".blockstick");
|
||||
}
|
||||
|
||||
void scripting::load_item_script(
|
||||
void scripting::load_content_script(
|
||||
const scriptenv& senv,
|
||||
const std::string& prefix,
|
||||
const fs::path& file,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue