Skip to content

Commit 4d96beb

Browse files
committed
chore: move MoreGlobal to lse::api
1 parent 13a9504 commit 4d96beb

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

src/legacy/api/BlockEntityAPI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Local<Value> BlockEntityClass::getNbt(const Arguments&) {
7979
}
8080

8181
Local<Value> BlockEntityClass::setNbt(const Arguments& args) {
82+
using namespace lse::api;
8283
CHECK_ARGS_COUNT(args, 1);
8384

8485
try {

src/legacy/api/EntityAPI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ Local<Value> EntityClass::getNbt(const Arguments&) {
12921292
}
12931293

12941294
Local<Value> EntityClass::setNbt(const Arguments& args) {
1295+
using namespace lse::api;
12951296
CHECK_ARGS_COUNT(args, 1);
12961297

12971298
try {

src/legacy/api/PlayerAPI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ Player* PlayerClass::extract(Local<Value> v) {
334334
}
335335

336336
// 公用API
337+
using namespace lse::api;
337338
Local<Value> McClass::getPlayerNbt(const Arguments& args) {
338339
CHECK_ARGS_COUNT(args, 1);
339340
CHECK_ARG_TYPE(args[0], ValueKind::kString);

src/lse/Entry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ LegacyScriptEngine& LegacyScriptEngine::getInstance() {
7171

7272
bool LegacyScriptEngine::enable() {
7373
auto& logger = getSelf().getLogger();
74-
if (!MoreGlobal::onEnable()) {
74+
if (!api::MoreGlobal::onEnable()) {
7575
logger.error("Failed to enable MoreGlobal"_tr());
7676
}
7777
ll::service::PlayerInfo::getInstance();
@@ -97,7 +97,7 @@ void initializeLegacyStuff() {
9797

9898
InitBasicEventListeners();
9999
InitMessageSystem();
100-
MoreGlobal::onLoad();
100+
api::MoreGlobal::onLoad();
101101
}
102102

103103
bool LegacyScriptEngine::load() {

src/lse/api/MoreGlobal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "mc/world/level/storage/DBStorage.h"
66
#include "mc/world/level/storage/DBStorageConfig.h"
77

8-
namespace MoreGlobal {
8+
namespace lse::api::MoreGlobal {
99
DBStorage* dbStorage;
1010
DefaultDataLoadHelper* helper;
1111
DefaultDataLoadHelper& defaultDataLoadHelper() { return (DefaultDataLoadHelper&)helper; }
@@ -33,4 +33,4 @@ bool onEnable() {
3333
}
3434
return false;
3535
}
36-
} // namespace MoreGlobal
36+
} // namespace lse::api::MoreGlobal

src/lse/api/MoreGlobal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "mc/dataloadhelper/DefaultDataLoadHelper.h"
22
class DBStorage;
3-
namespace MoreGlobal {
3+
namespace lse::api::MoreGlobal {
44
extern DBStorage* dbStorage;
55
extern DefaultDataLoadHelper& defaultDataLoadHelper();
66
extern void onLoad();
77
extern bool onEnable();
8-
}; // namespace MoreGlobal
8+
}; // namespace lse::api::MoreGlobal

0 commit comments

Comments
 (0)