Compare commits
2 Commits
+1
-1
Submodule SDK-GMLIB updated: e4f3e2a188...fd8463224f
+3
-10
@@ -280,22 +280,15 @@ class Minecraft {
|
||||
}
|
||||
|
||||
static getPlayerNbt(uuid) {
|
||||
let snbt = GMLIB_API.getPlayerNbt(uuid);
|
||||
if (snbt == "null") {
|
||||
return null;
|
||||
}
|
||||
let nbt = NBT.parseSNBT(snbt);
|
||||
return nbt;
|
||||
return GMLIB_API.getPlayerNbt(uuid);
|
||||
}
|
||||
|
||||
static setPlayerNbt(uuid, nbt, forceCreate = true) {
|
||||
let snbt = nbt.toSNBT();
|
||||
return GMLIB_API.setPlayerNbt(uuid, snbt, forceCreate);
|
||||
return GMLIB_API.setPlayerNbt(uuid, nbt, forceCreate);
|
||||
}
|
||||
|
||||
static setPlayerNbtTags(uuid, nbt, tags) {
|
||||
let snbt = nbt.toSNBT();
|
||||
return GMLIB_API.setPlayerNbtTags(uuid, snbt, tags);
|
||||
return GMLIB_API.setPlayerNbtTags(uuid, nbt, tags);
|
||||
}
|
||||
|
||||
static getPlayerPosition(uuid) {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "${pluginName}",
|
||||
"entry": "${pluginFile}",
|
||||
"version": "0.12.1",
|
||||
"version": "0.12.4",
|
||||
"author": "GroupMountain",
|
||||
"type": "native",
|
||||
"dependencies": [
|
||||
|
||||
@@ -53,25 +53,21 @@ void Export_Compatibility_API() {
|
||||
}
|
||||
return result;
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getPlayerNbt", [](std::string uuid) -> std::string {
|
||||
RemoteCall::exportAs("GMLIB_API", "getPlayerNbt", [](std::string uuid) -> std::unique_ptr<CompoundTag> {
|
||||
auto uid = mce::UUID::fromString(uuid);
|
||||
auto nbt = GMLIB_Player::getPlayerNbt(uid);
|
||||
if (nbt) {
|
||||
return nbt->toSnbt();
|
||||
}
|
||||
return "null";
|
||||
return std::move(GMLIB_Player::getPlayerNbt(uid));
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "setPlayerNbt", [](std::string uuid, std::string snbt, bool forceCreate) -> bool {
|
||||
RemoteCall::exportAs("GMLIB_API", "setPlayerNbt", [](std::string uuid, CompoundTag* nbt, bool forceCreate) -> bool {
|
||||
auto uid = mce::UUID::fromString(uuid);
|
||||
auto nbt = CompoundTag::fromSnbt(snbt);
|
||||
logger.warn(nbt->toSnbt());
|
||||
return GMLIB_Player::setPlayerNbt(uid, *nbt, forceCreate);
|
||||
});
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"setPlayerNbtTags",
|
||||
[](std::string uuid, std::string snbt, std::vector<std::string> tags) -> bool {
|
||||
[](std::string uuid, CompoundTag* nbt, std::vector<std::string> tags) -> bool {
|
||||
auto uid = mce::UUID::fromString(uuid);
|
||||
auto nbt = CompoundTag::fromSnbt(snbt);
|
||||
logger.warn(nbt->toSnbt());
|
||||
return GMLIB_Player::setPlayerNbtTags(uid, *nbt, tags);
|
||||
}
|
||||
);
|
||||
@@ -176,8 +172,8 @@ void Export_Compatibility_API() {
|
||||
}
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string {
|
||||
if (auto result = I18nAPI::getCurrentLanguageCode()) {
|
||||
return result.value();
|
||||
if (GMLIB_Level::getInstance()) {
|
||||
return I18nAPI::getCurrentLanguageCode();
|
||||
}
|
||||
return "unknown";
|
||||
});
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
||||
|
||||
#define LIB_VERSION GMLIB::Version(0, 12, 1)
|
||||
#define LIB_VERSION GMLIB::Version(0, 12, 2)
|
||||
|
||||
extern ll::Logger logger;
|
||||
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
|
||||
void Export_Legacy_GMLib_ServerAPI() {
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void {
|
||||
GMLIB_Level::addEducationEditionRequired();
|
||||
GMLIB_Level::tryEnableEducationEdition();
|
||||
});
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "registerAbilityCommand", []() -> void {
|
||||
GMLIB_Level::forceEnableAbilityCommand();
|
||||
GMLIB_Level::tryRegisterAbilityCommand();
|
||||
});
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "setEnableAchievement", []() -> void {
|
||||
GMLIB_Level::setForceAchievementsEnabled();
|
||||
});
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "setForceTrustSkins", []() -> void { GMLIB_Level::setForceTrustSkin(); });
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "enableCoResourcePack", []() -> void { GMLIB_Level::setCoResourcePack(); });
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "setForceTrustSkins", []() -> void { GMLIB_Level::trustAllSkins(); });
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "enableCoResourcePack", []() -> void {
|
||||
GMLIB_Level::requireServerResourcePackAndAllowClientResourcePack();
|
||||
});
|
||||
RemoteCall::exportAs("GMLib_ServerAPI", "getLevelName", []() -> std::string {
|
||||
auto level = GMLIB_Level::getInstance();
|
||||
if (!level) {
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"format_version": 2,
|
||||
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
|
||||
"version": "0.12.1",
|
||||
"version": "0.12.2",
|
||||
"info": {
|
||||
"name": "GMLIB-LegacyRemoteCallApi",
|
||||
"description": "Legacy RemoteCall API for GMLIB",
|
||||
@@ -14,9 +14,9 @@
|
||||
"library"
|
||||
]
|
||||
},
|
||||
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.12.1/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.12.2/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
|
||||
"dependencies": {
|
||||
"github.com/GroupMountain/GMLIB": ">=0.12.1"
|
||||
"github.com/GroupMountain/GMLIB": ">=0.12.4"
|
||||
},
|
||||
"files": {
|
||||
"place": [
|
||||
|
||||
Reference in New Issue
Block a user