Skip to content

Commit

Permalink
fix: 回退 EnumAPI.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
engsr6982 committed Dec 20, 2024
1 parent c57298d commit 5dfd461
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/API/EnumAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@
namespace jse::EnumAPI {

void RegisterEnum(ScriptEngine* engine) {
static Local<Value> enumMap = ([]() -> Local<Value> {
std::unordered_map<std::string, std::unordered_map<std::string_view, int>> enumMap;
static std::unordered_map<std::string, std::unordered_map<std::string_view, int>> enumMap;

REGISTER_ENUM_MACRO(endstone::PermissionDefault, "PermissionDefault");
REGISTER_ENUM_MACRO(endstone::PluginLoadOrder, "PluginLoadOrder");
REGISTER_ENUM_MACRO(endstone::Logger::Level, "LoggerLevel");
REGISTER_ENUM_MACRO(endstone::PermissionDefault, "PermissionDefault");
REGISTER_ENUM_MACRO(endstone::PluginLoadOrder, "PluginLoadOrder");
REGISTER_ENUM_MACRO(endstone::Logger::Level, "LoggerLevel");

return ConvertToScriptX(enumMap);
})();

engine->set("Enums", enumMap);
engine->set("Enums", ConvertToScriptX(enumMap));
}

#undef REGISTER_ENUM_MACRO
Expand Down

0 comments on commit 5dfd461

Please sign in to comment.