diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-29 13:22:31 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-29 13:22:31 +0200 |
commit | cfb56c9255fbf37a6bb9f0a6758db87320364cf6 (patch) | |
tree | 3087614059392d5c2b9927ddf37ad01955e7bf84 /src/Plugin.cpp | |
parent | Removed old items ids (diff) | |
download | AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.gz AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.bz2 AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.lz AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.xz AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.zst AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Plugin.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Plugin.cpp b/src/Plugin.cpp index ce995fc..f759d5f 100644 --- a/src/Plugin.cpp +++ b/src/Plugin.cpp @@ -11,6 +11,7 @@ #include "Event.hpp" #include "AssetManager.hpp" #include "Settings.hpp" +#include "DebugInfo.hpp" struct Plugin { @@ -108,6 +109,25 @@ namespace PluginApi { void SettingsUpdate() { PUSH_EVENT("SettingsUpdate", 0); } + + int GetDebugValue(int valId) { + switch (valId) { + case 0: + return DebugInfo::totalSections; + case 1: + return DebugInfo::renderSections; + case 2: + return DebugInfo::readyRenderer; + case 3: + return DebugInfo::gameThreadTime; + case 4: + return DebugInfo::renderFaces; + case 5: + return DebugInfo::culledSections; + default: + return 0; + } + } } int LoadFileRequire(lua_State* L) { @@ -194,6 +214,8 @@ void PluginSystem::Init() { "GetEntitiesList", &World::GetEntitiesList, "GetEntity",&World::GetEntityPtr, "Raycast", &World::Raycast, + "GetBlockLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockLight), + "GetBlockSkyLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockSkyLight), "GetBlockId", &World::GetBlockId, "SetBlockId", &World::SetBlockId); @@ -268,6 +290,8 @@ void PluginSystem::Init() { apiSettings["WriteDouble"] = Settings::WriteDouble; apiTable["SettingsUpdate"] = PluginApi::SettingsUpdate; apiTable["GetTime"] = GetTime; + apiTable["GetBlockInfo"] = GetBlockInfo; + apiTable["GetDebugValue"] = PluginApi::GetDebugValue; } lua_State* PluginSystem::GetLuaState() { |