Compare commits

..

2 Commits

13 changed files with 641 additions and 661 deletions
+156 -156
View File
@@ -1,182 +1,182 @@
// const getNextCallbackId = ll.import("GMLIB_FormAPI", "getNextFormCallbackId"); // // const getNextCallbackId = ll.import("GMLIB_FormAPI", "getNextFormCallbackId");
class ServerSettingForm { // class ServerSettingForm {
constructor() { // constructor() {
throw new Error("Static class cannot be instantiated"); // throw new Error("Static class cannot be instantiated");
} // }
static getDefaultPriority() { // static getDefaultPriority() {
return ll.import("GMLIB_ServerSettingForm", "getDefaultPriority")(); // return ll.import("GMLIB_ServerSettingForm", "getDefaultPriority")();
} // }
static hasTitle() { // static hasTitle() {
return ll.import("GMLIB_ServerSettingForm", "hasTitle")(); // return ll.import("GMLIB_ServerSettingForm", "hasTitle")();
} // }
static getTitle() { // static getTitle() {
return ll.import("GMLIB_ServerSettingForm", "getTitle")(); // return ll.import("GMLIB_ServerSettingForm", "getTitle")();
} // }
static setTitle(title, forceModify = false) { // static setTitle(title, forceModify = false) {
return ll.import("GMLIB_ServerSettingForm", "setTitle")(title, forceModify); // return ll.import("GMLIB_ServerSettingForm", "setTitle")(title, forceModify);
} // }
static hasIcon() { // static hasIcon() {
return ll.import("GMLIB_ServerSettingForm", "hasIcon")(); // return ll.import("GMLIB_ServerSettingForm", "hasIcon")();
} // }
static getIconData() { // static getIconData() {
return hasIcon() ? ll.import("GMLIB_ServerSettingForm", "getIconData")() : null; // return hasIcon() ? ll.import("GMLIB_ServerSettingForm", "getIconData")() : null;
} // }
static getIconType() { // static getIconType() {
return ll.import("GMLIB_ServerSettingForm", "getIconType")(); // return ll.import("GMLIB_ServerSettingForm", "getIconType")();
} // }
static setIcon(data, type = 0, forceModify = false) { // static setIcon(data, type = 0, forceModify = false) {
return ll.import("GMLIB_ServerSettingForm", "setIcon")(data, type, forceModify); // return ll.import("GMLIB_ServerSettingForm", "setIcon")(data, type, forceModify);
} // }
static addLabel( // static addLabel(
text, // text,
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addLabel")(text, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addLabel")(text, detectorId, priority);
} // }
static addInput( // static addInput(
text, // text,
placeholder, // placeholder,
defaultVal, // defaultVal,
callback = (pl, input) => { }, // callback = (pl, input) => { },
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addInput")(text, placeholder, defaultVal, callbackId, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addInput")(text, placeholder, defaultVal, callbackId, detectorId, priority);
} // }
static addToggle( // static addToggle(
text, // text,
defaultVal = false, // defaultVal = false,
callback = (pl, input) => { }, // callback = (pl, input) => { },
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addToggle")(text, defaultVal, callbackId, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addToggle")(text, defaultVal, callbackId, detectorId, priority);
} // }
static addDropdown( // static addDropdown(
text, // text,
options, // options,
defaultVal = 0, // defaultVal = 0,
callback = (pl, input) => { }, // callback = (pl, input) => { },
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addDropdown")(text, options, defaultVal, callbackId, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addDropdown")(text, options, defaultVal, callbackId, detectorId, priority);
} // }
static addSlider( // static addSlider(
text, // text,
min, // min,
max, // max,
step = 0.0, // step = 0.0,
defaultVal = 0.0, // defaultVal = 0.0,
callback = (pl, input) => { }, // callback = (pl, input) => { },
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addSlider")(text, min, max, step, defaultVal, callbackId, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addSlider")(text, min, max, step, defaultVal, callbackId, detectorId, priority);
} // }
static addStepSlider( // static addStepSlider(
text, // text,
steps, // steps,
defaultVal = 0, // defaultVal = 0,
callback = (pl, input) => { }, // callback = (pl, input) => { },
playerDetector = (pl) => { return true; }, // playerDetector = (pl) => { return true; },
priority = this.getDefaultPriority() // priority = this.getDefaultPriority()
) { // ) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
let detectorId = getNextCallbackId(); // let detectorId = getNextCallbackId();
ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId); // ll.export(playerDetector, "GMLIB_FORM_CALLBACK", detectorId);
return ll.import("GMLIB_ServerSettingForm", "addStepSlider")(text, steps, defaultVal, callbackId, detectorId, priority); // return ll.import("GMLIB_ServerSettingForm", "addStepSlider")(text, steps, defaultVal, callbackId, detectorId, priority);
} // }
static removeElement(id) { // static removeElement(id) {
return ll.import("GMLIB_ServerSettingForm", "removeElement")(id); // return ll.import("GMLIB_ServerSettingForm", "removeElement")(id);
} // }
} // }
class NpcDialogueForm { // class NpcDialogueForm {
constructor(npcName, sceneName, dialogue) { // constructor(npcName, sceneName, dialogue) {
this.mFormId = ll.import("GMLIB_NpcDialogueForm", "createForm")(npcName, sceneName, dialogue); // this.mFormId = ll.import("GMLIB_NpcDialogueForm", "createForm")(npcName, sceneName, dialogue);
} // }
addButton(button) { // addButton(button) {
return ll.import("GMLIB_NpcDialogueForm", "addButton")(this.mFormId, button); // return ll.import("GMLIB_NpcDialogueForm", "addButton")(this.mFormId, button);
} // }
sendTo(pl, callback = (pl, index, type) => { }, free = true) { // sendTo(pl, callback = (pl, index, type) => { }, free = true) {
let callbackId = getNextCallbackId(); // let callbackId = getNextCallbackId();
ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
ll.import("GMLIB_NpcDialogueForm", "sendTo")(this.mFormId, pl, callbackId); // ll.import("GMLIB_NpcDialogueForm", "sendTo")(this.mFormId, pl, callbackId);
if (free) { // if (free) {
this.destroy(); // this.destroy();
} // }
} // }
destroy() { // destroy() {
ll.import("GMLIB_NpcDialogueForm", "destroyForm")(this.mFormId); // ll.import("GMLIB_NpcDialogueForm", "destroyForm")(this.mFormId);
} // }
} // }
class ChestForm { // class ChestForm {
constructor(npcName, sceneName, dialogue) { // constructor(npcName, sceneName, dialogue) {
this.mFormId = ll.import("GMLIB_NpcDialogueForm", "createForm")(npcName, sceneName, dialogue); // this.mFormId = ll.import("GMLIB_NpcDialogueForm", "createForm")(npcName, sceneName, dialogue);
} // }
addButton(button) { // addButton(button) {
return ll.import("GMLIB_NpcDialogueForm", "addButton")(this.mFormId, button); // return ll.import("GMLIB_NpcDialogueForm", "addButton")(this.mFormId, button);
} // }
sendTo(pl, free = true) { // sendTo(pl, free = true) {
//let callbackId = getNextCallbackId(); // //let callbackId = getNextCallbackId();
//ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId); // //ll.export(callback, "GMLIB_FORM_CALLBACK", callbackId);
//ll.import("GMLIB_NpcDialogueForm", "sendTo")(this.mFormId, pl, callbackId); // //ll.import("GMLIB_NpcDialogueForm", "sendTo")(this.mFormId, pl, callbackId);
//if (free) { // //if (free) {
// this.destroy(); // // this.destroy();
//} // //}
} // }
destroy() { // destroy() {
//ll.import("GMLIB_NpcDialogueForm", "destroyForm")(this.mFormId); // //ll.import("GMLIB_NpcDialogueForm", "destroyForm")(this.mFormId);
} // }
} // }
module.exports = { // module.exports = {
ServerSettingForm, // ServerSettingForm,
NpcDialogueForm, // NpcDialogueForm,
ChestForm // ChestForm
}; // };
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "${pluginName}", "name": "${pluginName}",
"entry": "${pluginFile}", "entry": "${pluginFile}",
"version": "0.13.3", "version": "0.13.4",
"author": "GroupMountain", "author": "GroupMountain",
"type": "native", "type": "native",
"passive": true, "passive": true,
+4 -4
View File
@@ -4,16 +4,16 @@ using namespace ll::hash_utils;
class LegacyScriptBinaryStreamManager { class LegacyScriptBinaryStreamManager {
private: private:
int64 mNextBinaryStreamId = 0; int64 mNextBinaryStreamId = 0;
std::unordered_map<uint64, std::shared_ptr<gmlib::network::BinaryStream>> mBinaryStream; std::unordered_map<uint64, std::shared_ptr<GMLIB_BinaryStream>> mBinaryStream;
public: public:
uint getNextId() { return mNextBinaryStreamId++; } uint getNextId() { return mNextBinaryStreamId++; }
void cretateBinaryStream(uint id) { mBinaryStream[id] = std::make_shared<gmlib::network::BinaryStream>(); } void cretateBinaryStream(uint id) { mBinaryStream[id] = std::make_shared<GMLIB_BinaryStream>(); }
void removeBinaryStream(uint64 id) { mBinaryStream.erase(id); } void removeBinaryStream(uint64 id) { mBinaryStream.erase(id); }
std::shared_ptr<gmlib::network::BinaryStream> getBinaryStream(uint64 id) { std::shared_ptr<GMLIB_BinaryStream> getBinaryStream(uint64 id) {
return mBinaryStream.contains(id) ? mBinaryStream.at(id) : nullptr; return mBinaryStream.contains(id) ? mBinaryStream.at(id) : nullptr;
} }
@@ -38,7 +38,7 @@ template <typename T, typename R, typename A, typename... AS>
struct Info<R (T::*)(A, AS...)> { struct Info<R (T::*)(A, AS...)> {
using ArgT = A; using ArgT = A;
}; };
#define EXPORTAPI2(T) EXPORTAPI(#T, Info<decltype(&gmlib::network::BinaryStream::T)>::ArgT, bs->T(value)) #define EXPORTAPI2(T) EXPORTAPI(#T, Info<decltype(&GMLIB_BinaryStream::T)>::ArgT, bs->T(value))
void Export_BinaryStream_API() { void Export_BinaryStream_API() {
RemoteCall::exportAs("GMLIB_BinaryStream_API", "create", []() -> uint64 { RemoteCall::exportAs("GMLIB_BinaryStream_API", "create", []() -> uint64 {
+121 -129
View File
@@ -12,64 +12,56 @@ ActorUniqueID parseScriptUniqueID(std::string const& uniqueId) {
void Export_Compatibility_API() { void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "unregisterRecipe", [](std::string const& id) -> bool { RemoteCall::exportAs("GMLIB_API", "unregisterRecipe", [](std::string const& id) -> bool {
return gmlib::world::Level::getInstance().has_value() ? gmlib::mod::recipe::RecipeRegistry::unregisterRecipe(id) : false; return GMLIB_Level::getInstance().has_value() ? GMLIB::Mod::CustomRecipe::unregisterRecipe(id) : false;
}); });
RemoteCall::exportAs("GMLIB_API", "setCustomPackPath", [](std::string const& path) -> void { RemoteCall::exportAs("GMLIB_API", "setCustomPackPath", [](std::string const& path) -> void {
gmlib::tools::AddonsLoader::addCustomPackPath(path); GMLIB::Mod::CustomPacks::addCustomPackPath(path);
}); });
RemoteCall::exportAs("GMLIB_API", "getServerMspt", []() -> double { RemoteCall::exportAs("GMLIB_API", "getServerMspt", []() -> double {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance().transform(
.transform([](gmlib::world::Level& level) -> double { return level.getServerMspt(); }) [](GMLIB_Level& level) -> double { return level.getServerMspt(); }
.value_or(0.0); ).value_or(0.0);
}); });
RemoteCall::exportAs("GMLIB_API", "getServerCurrentTps", []() -> float { RemoteCall::exportAs("GMLIB_API", "getServerCurrentTps", []() -> float {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance()
.transform([](gmlib::world::Level& level) -> float { return level.getServerCurrentTps(); }) .transform([](GMLIB_Level& level) -> float { return level.getServerCurrentTps(); })
.value_or(0.0); .value_or(0.0);
}); });
RemoteCall::exportAs("GMLIB_API", "getServerAverageTps", []() -> double { RemoteCall::exportAs("GMLIB_API", "getServerAverageTps", []() -> double {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance()
.transform([](gmlib::world::Level& level) -> double { return level.getServerAverageTps(); }) .transform([](GMLIB_Level& level) -> double { return level.getServerAverageTps(); })
.value_or(0.0); .value_or(0.0);
}); });
RemoteCall::exportAs("GMLIB_API", "getAllPlayerUuids", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getAllPlayerUuids", []() -> std::vector<std::string> {
std::vector<std::string> result; std::vector<std::string> result;
for (auto& uuid : gmlib::world::Player::getAllUuids()) { for (auto& uuid : GMLIB_Player::getAllUuids()) {
result.push_back(uuid.asString()); result.push_back(uuid.asString());
} }
return result; return result;
}); });
RemoteCall::exportAs("GMLIB_API", "getPlayerNbt", [](std::string const& uuid) -> std::unique_ptr<CompoundTag> { RemoteCall::exportAs("GMLIB_API", "getPlayerNbt", [](std::string const& uuid) -> std::unique_ptr<CompoundTag> {
return std::move(gmlib::world::Player::getPlayerNbt(mce::UUID::fromString(uuid))); return std::move(GMLIB_Player::getPlayerNbt(mce::UUID::fromString(uuid)));
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setPlayerNbt", "setPlayerNbt",
[](std::string const& uuid, CompoundTag* nbt, bool forceCreate) -> bool { [](std::string const& uuid, CompoundTag* nbt, bool forceCreate) -> bool {
return gmlib::world::Player::setPlayerNbt( return GMLIB_Player::setPlayerNbt(mce::UUID::fromString(uuid), (GMLIB_CompoundTag&)*nbt, forceCreate);
mce::UUID::fromString(uuid),
(gmlib::world::CompoundTag&)*nbt,
forceCreate
);
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setPlayerNbtTags", "setPlayerNbtTags",
[](std::string const& uuid, CompoundTag* nbt, std::vector<std::string> tags) -> bool { [](std::string const& uuid, CompoundTag* nbt, std::vector<std::string> tags) -> bool {
return gmlib::world::Player::setPlayerNbtTags( return GMLIB_Player::setPlayerNbtTags(mce::UUID::fromString(uuid), (GMLIB_CompoundTag&)*nbt, tags);
mce::UUID::fromString(uuid),
(gmlib::world::CompoundTag&)*nbt,
tags
);
} }
); );
RemoteCall::exportAs("GMLIB_API", "deletePlayerNbt", [](std::string const& uuid) -> bool { RemoteCall::exportAs("GMLIB_API", "deletePlayerNbt", [](std::string const& uuid) -> bool {
return gmlib::world::Player::deletePlayerNbt(mce::UUID::fromString(uuid)); return GMLIB_Player::deletePlayerNbt(mce::UUID::fromString(uuid));
}); });
RemoteCall::exportAs("GMLIB_API", "getAllExperiments", []() -> std::vector<int> { RemoteCall::exportAs("GMLIB_API", "getAllExperiments", []() -> std::vector<int> {
std::vector<int> result; std::vector<int> result;
for (auto& key : gmlib::world::Level::getAllExperiments()) { for (auto& key : GMLIB_Level::getAllExperiments()) {
result.push_back((int)key); result.push_back((int)key);
} }
return result; return result;
@@ -85,113 +77,110 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"createFloatingText", "createFloatingText",
[](std::pair<Vec3, int> pos, std::string const& text, bool papi) -> int { [](std::pair<Vec3, int> pos, std::string const& text, bool papi) -> int {
auto ft = gmlib::tools::FloatingTextManager::createStatic(text, pos.first, pos.second, papi); auto ft = GMLIB::Server::FloatingTextManager::createStatic(text, pos.first, pos.second, papi);
gmlib::tools::FloatingTextManager::getInstance().add(ft); GMLIB::Server::FloatingTextManager::getInstance().add(ft);
return ft->getRuntimeID(); return ft->getRuntimeID();
} }
); );
RemoteCall::exportAs("GMLIB_API", "setFloatingTextData", [](int id, std::string const& text) -> bool { RemoteCall::exportAs("GMLIB_API", "setFloatingTextData", [](int id, std::string const& text) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([&text](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([&text](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.setText(text); ft.setText(text);
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "deleteFloatingText", [](int id) -> bool { RemoteCall::exportAs("GMLIB_API", "deleteFloatingText", [](int id) -> bool {
return gmlib::tools::FloatingTextManager::getInstance().remove(id); return GMLIB::Server::FloatingTextManager::getInstance().remove(id);
}); });
RemoteCall::exportAs("GMLIB_API", "sendFloatingTextToPlayer", [](int id, Player* pl) -> bool { RemoteCall::exportAs("GMLIB_API", "sendFloatingTextToPlayer", [](int id, Player* pl) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([&pl](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([&pl](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.sendTo(*pl); ft.sendTo(*pl);
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "sendFloatingText", [](int id) -> bool { RemoteCall::exportAs("GMLIB_API", "sendFloatingText", [](int id) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.sendToClients(); ft.sendToClients();
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "removeFloatingTextFromPlayer", [](int id, Player* pl) -> bool { RemoteCall::exportAs("GMLIB_API", "removeFloatingTextFromPlayer", [](int id, Player* pl) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([&pl](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([&pl](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.removeFrom(*pl); ft.removeFrom(*pl);
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "removeFloatingText", [](int id) -> bool { RemoteCall::exportAs("GMLIB_API", "removeFloatingText", [](int id) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.removeFromClients(); ft.removeFromClients();
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "updateClientFloatingTextData", [](int id, Player* pl) -> bool { RemoteCall::exportAs("GMLIB_API", "updateClientFloatingTextData", [](int id, Player* pl) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([&pl](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([&pl](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.update(*pl); ft.update(*pl);
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "updateAllClientsFloatingTextData", [](int id) -> bool { RemoteCall::exportAs("GMLIB_API", "updateAllClientsFloatingTextData", [](int id) -> bool {
return gmlib::tools::FloatingTextManager::getInstance() return GMLIB::Server::FloatingTextManager::getInstance()
.getFloatingText(id) .getFloatingText(id)
.transform([](gmlib::tools::FloatingTextBase& ft) -> bool { .transform([](GMLIB::Server::FloatingTextBase& ft) -> bool {
ft.updateClients(); ft.updateClients();
return true; return true;
}) })
.has_value(); .has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "isVersionMatched", [](int a, int b, int c) -> bool { RemoteCall::exportAs("GMLIB_API", "isVersionMatched", [](int a, int b, int c) -> bool {
return LIB_VERSION >= gmlib::Version(a, b, c, "", ""); return LIB_VERSION >= GMLIB::Version(a, b, c, "", "");
}); });
RemoteCall::exportAs("GMLIB_API", "getVersion_LRCA", []() -> std::string { return LIB_VERSION.asString(); }); RemoteCall::exportAs("GMLIB_API", "getVersion_LRCA", []() -> std::string { return LIB_VERSION.asString(); });
RemoteCall::exportAs("GMLIB_API", "getVersion_GMLIB", []() -> std::string { RemoteCall::exportAs("GMLIB_API", "getVersion_GMLIB", []() -> std::string {
return gmlib::Version::getLibVersionString(); return GMLIB::Version::getLibVersionString();
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"resourcePackDefaultTranslate", "resourcePackDefaultTranslate",
[](std::string const& key, std::vector<std::string> params) -> std::string { [](std::string const& key, std::vector<std::string> params) -> std::string { return I18nAPI::get(key, params); }
return gmlib::world::I18nAPI::get(key, params);
}
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"resourcePackTranslate", "resourcePackTranslate",
[](std::string const& key, std::vector<std::string> params, std::string const& code) -> std::string { [](std::string const& key, std::vector<std::string> params, std::string const& code) -> std::string {
return gmlib::world::I18nAPI::get(key, params, code); return I18nAPI::get(key, params, code);
} }
); );
RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string const& code) -> void { RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string const& code) -> void {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
gmlib::world::I18nAPI::chooseLanguage(code); I18nAPI::chooseLanguage(code);
} }
}); });
RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string { RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string {
return gmlib::world::Level::getInstance().has_value() ? gmlib::world::I18nAPI::getCurrentLanguageCode() : "unknown"; return GMLIB_Level::getInstance().has_value() ? I18nAPI::getCurrentLanguageCode() : "unknown";
}); });
RemoteCall::exportAs("GMLIB_API", "getSupportedLanguages", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getSupportedLanguages", []() -> std::vector<std::string> {
return gmlib::world::Level::getInstance() ? gmlib::world::I18nAPI::getSupportedLanguageCodes() return GMLIB_Level::getInstance() ? I18nAPI::getSupportedLanguageCodes() : std::vector<std::string>();
: std::vector<std::string>();
}); });
RemoteCall::exportAs("GMLIB_API", "loadLanguage", [](std::string const& code, std::string const& lang) -> void { RemoteCall::exportAs("GMLIB_API", "loadLanguage", [](std::string const& code, std::string const& lang) -> void {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
gmlib::world::I18nAPI::loadLanguage(code, lang); I18nAPI::loadLanguage(code, lang);
} }
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
@@ -199,43 +188,38 @@ void Export_Compatibility_API() {
"updateOrCreateLanguageFile", "updateOrCreateLanguageFile",
[](std::string const& code, std::unordered_map<std::string, std::string> lang, std::string const& path [](std::string const& code, std::unordered_map<std::string, std::string> lang, std::string const& path
) -> void { ) -> void {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
gmlib::world::I18nAPI::updateOrCreateLanguageFile(path, code, lang); I18nAPI::updateOrCreateLanguageFile(path, code, lang);
} }
} }
); );
RemoteCall::exportAs("GMLIB_API", "loadLanguagePath", [](std::string const& path) -> void { RemoteCall::exportAs("GMLIB_API", "loadLanguagePath", [](std::string const& path) -> void {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
gmlib::world::I18nAPI::loadLanguagesFromDirectory(path); I18nAPI::loadLanguagesFromDirectory(path);
} }
}); });
RemoteCall::exportAs("GMLIB_API", "getPlayerPosition", [](std::string const& uuid) -> std::pair<BlockPos, int> { RemoteCall::exportAs("GMLIB_API", "getPlayerPosition", [](std::string const& uuid) -> std::pair<BlockPos, int> {
return gmlib::world::Player::getPlayerPosition(mce::UUID::fromString(uuid)) return GMLIB_Player::getPlayerPosition(mce::UUID::fromString(uuid))
.value_or(std::pair<BlockPos, int>({0, 0, 0}, -1)); .value_or(std::pair<BlockPos, int>({0, 0, 0}, -1));
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setPlayerPosition", "setPlayerPosition",
[](std::string const& uuid, std::pair<BlockPos, int> pos) -> bool { [](std::string const& uuid, std::pair<BlockPos, int> pos) -> bool {
return gmlib::world::Player::setPlayerPosition(mce::UUID::fromString(uuid), pos.first, pos.second); return GMLIB_Player::setPlayerPosition(mce::UUID::fromString(uuid), pos.first, pos.second);
} }
); );
RemoteCall::exportAs("GMLIB_API", "playerHasScore", [](std::string const& uuid, std::string const& obj) -> bool { RemoteCall::exportAs("GMLIB_API", "playerHasScore", [](std::string const& uuid, std::string const& obj) -> bool {
return gmlib::world::Player::getPlayerScore(mce::UUID::fromString(uuid), obj).has_value(); return GMLIB_Player::getPlayerScore(mce::UUID::fromString(uuid), obj).has_value();
}); });
RemoteCall::exportAs("GMLIB_API", "getPlayerScore", [](std::string const& uuid, std::string const& obj) -> int { RemoteCall::exportAs("GMLIB_API", "getPlayerScore", [](std::string const& uuid, std::string const& obj) -> int {
return gmlib::world::Player::getPlayerScore(mce::UUID::fromString(uuid), obj).value_or(0); return GMLIB_Player::getPlayerScore(mce::UUID::fromString(uuid), obj).value_or(0);
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"addPlayerScore", "addPlayerScore",
[](std::string const& uuid, std::string const& obj, int value) -> bool { [](std::string const& uuid, std::string const& obj, int value) -> bool {
return gmlib::world::Player::setPlayerScore( return GMLIB_Player::setPlayerScore(mce::UUID::fromString(uuid), obj, value, PlayerScoreSetFunction::Add)
mce::UUID::fromString(uuid),
obj,
value,
PlayerScoreSetFunction::Add
)
.has_value(); .has_value();
} }
); );
@@ -243,37 +227,43 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"reducePlayerScore", "reducePlayerScore",
[](std::string const& uuid, std::string const& obj, int value) -> bool { [](std::string const& uuid, std::string const& obj, int value) -> bool {
return gmlib::world::Player::setPlayerScore(mce::UUID::fromString(uuid), obj, value, PlayerScoreSetFunction::Subtract).has_value(); return GMLIB_Player::setPlayerScore(
mce::UUID::fromString(uuid),
obj,
value,
PlayerScoreSetFunction::Subtract
)
.has_value();
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setPlayerScore", "setPlayerScore",
[](std::string const& uuid, std::string const& obj, int value) -> bool { [](std::string const& uuid, std::string const& obj, int value) -> bool {
return gmlib::world::Player::setPlayerScore(mce::UUID::fromString(uuid), obj, value).has_value(); return GMLIB_Player::setPlayerScore(mce::UUID::fromString(uuid), obj, value).has_value();
} }
); );
RemoteCall::exportAs("GMLIB_API", "resetPlayerScore", [](std::string const& uuid, std::string const& obj) -> bool { RemoteCall::exportAs("GMLIB_API", "resetPlayerScore", [](std::string const& uuid, std::string const& obj) -> bool {
return gmlib::world::Player::resetPlayerScore(mce::UUID::fromString(uuid), obj); return GMLIB_Player::resetPlayerScore(mce::UUID::fromString(uuid), obj);
}); });
RemoteCall::exportAs("GMLIB_API", "resetPlayerScores", [](std::string const& uuid) -> bool { RemoteCall::exportAs("GMLIB_API", "resetPlayerScores", [](std::string const& uuid) -> bool {
return gmlib::world::Player::resetPlayerScore(mce::UUID::fromString(uuid)); return GMLIB_Player::resetPlayerScore(mce::UUID::fromString(uuid));
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"entityHasScore", "entityHasScore",
[](std::string const& uniqueId, std::string const& obj) -> bool { [](std::string const& uniqueId, std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->getScore(obj, parseScriptUniqueID(uniqueId)).has_value(); return GMLIB_Scoreboard::getInstance()->getScore(obj, parseScriptUniqueID(uniqueId)).has_value();
} }
); );
RemoteCall::exportAs("GMLIB_API", "getEntityScore", [](std::string const& uniqueId, std::string const& obj) -> int { RemoteCall::exportAs("GMLIB_API", "getEntityScore", [](std::string const& uniqueId, std::string const& obj) -> int {
return gmlib::world::Scoreboard::getInstance()->getScore(obj, parseScriptUniqueID(uniqueId)).value_or(0); return GMLIB_Scoreboard::getInstance()->getScore(obj, parseScriptUniqueID(uniqueId)).value_or(0);
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"addEntityScore", "addEntityScore",
[](std::string const& uniqueId, std::string const& obj, int value) -> bool { [](std::string const& uniqueId, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance() return GMLIB_Scoreboard::getInstance()
->setScore(obj, parseScriptUniqueID(uniqueId), value, PlayerScoreSetFunction::Add) ->setScore(obj, parseScriptUniqueID(uniqueId), value, PlayerScoreSetFunction::Add)
.has_value(); .has_value();
} }
@@ -282,7 +272,7 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"reduceEntityScore", "reduceEntityScore",
[](std::string const& uniqueId, std::string const& obj, int value) -> bool { [](std::string const& uniqueId, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance() return GMLIB_Scoreboard::getInstance()
->setScore(obj, parseScriptUniqueID(uniqueId), value, PlayerScoreSetFunction::Subtract) ->setScore(obj, parseScriptUniqueID(uniqueId), value, PlayerScoreSetFunction::Subtract)
.has_value(); .has_value();
} }
@@ -291,41 +281,41 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"setEntityScore", "setEntityScore",
[](std::string const& uniqueId, std::string const& obj, int value) -> bool { [](std::string const& uniqueId, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance()->setScore(obj, parseScriptUniqueID(uniqueId), value).has_value(); return GMLIB_Scoreboard::getInstance()->setScore(obj, parseScriptUniqueID(uniqueId), value).has_value();
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"resetEntityScore", "resetEntityScore",
[](std::string const& uniqueId, std::string const& obj) -> bool { [](std::string const& uniqueId, std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->resetScore(obj, parseScriptUniqueID(uniqueId)); return GMLIB_Scoreboard::getInstance()->resetScore(obj, parseScriptUniqueID(uniqueId));
} }
); );
RemoteCall::exportAs("GMLIB_API", "resetEntityScores", [](std::string const& uniqueId) -> bool { RemoteCall::exportAs("GMLIB_API", "resetEntityScores", [](std::string const& uniqueId) -> bool {
return gmlib::world::Scoreboard::getInstance()->resetScore(parseScriptUniqueID(uniqueId)); return GMLIB_Scoreboard::getInstance()->resetScore(parseScriptUniqueID(uniqueId));
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"fakePlayerHasScore", "fakePlayerHasScore",
[](std::string const& name, std::string const& obj) -> bool { [](std::string const& name, std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->getScore(obj, name).has_value(); return GMLIB_Scoreboard::getInstance()->getScore(obj, name).has_value();
} }
); );
RemoteCall::exportAs("GMLIB_API", "getFakePlayerScore", [](std::string const& name, std::string const& obj) -> int { RemoteCall::exportAs("GMLIB_API", "getFakePlayerScore", [](std::string const& name, std::string const& obj) -> int {
return gmlib::world::Scoreboard::getInstance()->getScore(obj, name).value_or(0); return GMLIB_Scoreboard::getInstance()->getScore(obj, name).value_or(0);
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"addFakePlayerScore", "addFakePlayerScore",
[](std::string const& name, std::string const& obj, int value) -> bool { [](std::string const& name, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance()->setScore(obj, name, value, PlayerScoreSetFunction::Add).has_value(); return GMLIB_Scoreboard::getInstance()->setScore(obj, name, value, PlayerScoreSetFunction::Add).has_value();
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"reduceFakePlayerScore", "reduceFakePlayerScore",
[](std::string const& name, std::string const& obj, int value) -> bool { [](std::string const& name, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance() return GMLIB_Scoreboard::getInstance()
->setScore(obj, name, value, PlayerScoreSetFunction::Subtract) ->setScore(obj, name, value, PlayerScoreSetFunction::Subtract)
.has_value(); .has_value();
} }
@@ -334,76 +324,76 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"setFakePlayerScore", "setFakePlayerScore",
[](std::string const& name, std::string const& obj, int value) -> bool { [](std::string const& name, std::string const& obj, int value) -> bool {
return gmlib::world::Scoreboard::getInstance()->setScore(obj, name, value).has_value(); return GMLIB_Scoreboard::getInstance()->setScore(obj, name, value).has_value();
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"resetFakePlayerScore", "resetFakePlayerScore",
[](std::string const& name, std::string const& obj) -> bool { [](std::string const& name, std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->resetScore(obj, name); return GMLIB_Scoreboard::getInstance()->resetScore(obj, name);
} }
); );
RemoteCall::exportAs("GMLIB_API", "resetFakePlayerScores", [](std::string const& name) -> bool { RemoteCall::exportAs("GMLIB_API", "resetFakePlayerScores", [](std::string const& name) -> bool {
return gmlib::world::Scoreboard::getInstance()->resetScore(name); return GMLIB_Scoreboard::getInstance()->resetScore(name);
}); });
RemoteCall::exportAs("GMLIB_API", "addObjective", [](std::string const& obj) -> bool { RemoteCall::exportAs("GMLIB_API", "addObjective", [](std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->addObjective(obj).has_value(); return GMLIB_Scoreboard::getInstance()->addObjective(obj).has_value();
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"addObjectiveWithDisplayName", "addObjectiveWithDisplayName",
[](std::string const& obj, std::string const& displayName) -> bool { [](std::string const& obj, std::string const& displayName) -> bool {
return gmlib::world::Scoreboard::getInstance()->addObjective(obj, displayName).has_value(); return GMLIB_Scoreboard::getInstance()->addObjective(obj, displayName).has_value();
} }
); );
RemoteCall::exportAs("GMLIB_API", "getDisplayName", [](std::string const& obj) -> std::string { RemoteCall::exportAs("GMLIB_API", "getDisplayName", [](std::string const& obj) -> std::string {
return gmlib::world::Scoreboard::getInstance()->getObjectiveDisplayName(obj).value_or(""); return GMLIB_Scoreboard::getInstance()->getObjectiveDisplayName(obj).value_or("");
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setDisplayName", "setDisplayName",
[](std::string const& obj, std::string const& displayName) -> bool { [](std::string const& obj, std::string const& displayName) -> bool {
return gmlib::world::Scoreboard::getInstance()->setObjectiveDisplayName(obj, displayName); return GMLIB_Scoreboard::getInstance()->setObjectiveDisplayName(obj, displayName);
} }
); );
RemoteCall::exportAs("GMLIB_API", "removeObjective", [](std::string const& obj) -> bool { RemoteCall::exportAs("GMLIB_API", "removeObjective", [](std::string const& obj) -> bool {
return gmlib::world::Scoreboard::getInstance()->removeObjective(obj); return GMLIB_Scoreboard::getInstance()->removeObjective(obj);
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
"setDisplayObjective", "setDisplayObjective",
[](std::string const& obj, std::string const& slot, int order) -> void { [](std::string const& obj, std::string const& slot, int order) -> void {
return gmlib::world::Scoreboard::getInstance()->setObjectiveDisplay(obj, slot, (ObjectiveSortOrder)order); return GMLIB_Scoreboard::getInstance()->setObjectiveDisplay(obj, slot, (ObjectiveSortOrder)order);
} }
); );
RemoteCall::exportAs("GMLIB_API", "clearDisplayObjective", [](std::string const& slot) -> void { RemoteCall::exportAs("GMLIB_API", "clearDisplayObjective", [](std::string const& slot) -> void {
return gmlib::world::Scoreboard::getInstance()->clearObjectiveDisplay(slot); return GMLIB_Scoreboard::getInstance()->clearObjectiveDisplay(slot);
}); });
RemoteCall::exportAs("GMLIB_API", "getAllObjectives", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getAllObjectives", []() -> std::vector<std::string> {
std::vector<std::string> result; std::vector<std::string> result;
for (auto& obj : gmlib::world::Scoreboard::getInstance()->getObjectives()) { for (auto& obj : GMLIB_Scoreboard::getInstance()->getObjectives()) {
result.push_back(obj->getName()); result.push_back(obj->getName());
} }
return result; return result;
}); });
RemoteCall::exportAs("GMLIB_API", "getAllScoreboardPlayers", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getAllScoreboardPlayers", []() -> std::vector<std::string> {
std::vector<std::string> result; std::vector<std::string> result;
for (auto& uuid : gmlib::world::Scoreboard::getInstance()->getAllPlayerUuids()) { for (auto& uuid : GMLIB_Scoreboard::getInstance()->getAllPlayerUuids()) {
result.push_back(uuid.asString()); result.push_back(uuid.asString());
} }
return result; return result;
}); });
RemoteCall::exportAs("GMLIB_API", "getAllScoreboardFakePlayers", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getAllScoreboardFakePlayers", []() -> std::vector<std::string> {
std::vector<std::string> result; std::vector<std::string> result;
for (auto& name : gmlib::world::Scoreboard::getInstance()->getAllFakePlayers()) { for (auto& name : GMLIB_Scoreboard::getInstance()->getAllFakePlayers()) {
result.push_back(name); result.push_back(name);
} }
return result; return result;
}); });
RemoteCall::exportAs("GMLIB_API", "getAllScoreboardEntities", []() -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getAllScoreboardEntities", []() -> std::vector<std::string> {
std::vector<std::string> result; std::vector<std::string> result;
for (auto& uniqueId : gmlib::world::Scoreboard::getInstance()->getAllEntities()) { for (auto& uniqueId : GMLIB_Scoreboard::getInstance()->getAllEntities()) {
result.push_back(std::to_string(uniqueId.id)); result.push_back(std::to_string(uniqueId.id));
} }
return result; return result;
@@ -413,19 +403,19 @@ void Export_Compatibility_API() {
"getAllTrackedTargets", "getAllTrackedTargets",
[]() -> std::vector<std::unordered_map<std::string, std::string>> { []() -> std::vector<std::unordered_map<std::string, std::string>> {
std::vector<std::unordered_map<std::string, std::string>> result; std::vector<std::unordered_map<std::string, std::string>> result;
for (auto& uuid : gmlib::world::Scoreboard::getInstance()->getAllPlayerUuids()) { for (auto& uuid : GMLIB_Scoreboard::getInstance()->getAllPlayerUuids()) {
result.push_back({ result.push_back({
{"Type", "Player" }, {"Type", "Player" },
{"Uuid", uuid.asString()} {"Uuid", uuid.asString()}
}); });
} }
for (auto& name : gmlib::world::Scoreboard::getInstance()->getAllFakePlayers()) { for (auto& name : GMLIB_Scoreboard::getInstance()->getAllFakePlayers()) {
result.push_back({ result.push_back({
{"Type", "FakePlayer"}, {"Type", "FakePlayer"},
{"Name", name } {"Name", name }
}); });
} }
for (auto& uniqueId : gmlib::world::Scoreboard::getInstance()->getAllEntities()) { for (auto& uniqueId : GMLIB_Scoreboard::getInstance()->getAllEntities()) {
result.push_back({ result.push_back({
{"Type", "Entity" }, {"Type", "Entity" },
{"UniqueId", std::to_string(uniqueId.id)} {"UniqueId", std::to_string(uniqueId.id)}
@@ -444,22 +434,22 @@ void Export_Compatibility_API() {
return ll::service::getLevel()->fetchEntity(parseScriptUniqueID(uniqueId)); return ll::service::getLevel()->fetchEntity(parseScriptUniqueID(uniqueId));
}); });
RemoteCall::exportAs("GMLIB_API", "getWorldSpawn", []() -> std::pair<BlockPos, int> { RemoteCall::exportAs("GMLIB_API", "getWorldSpawn", []() -> std::pair<BlockPos, int> {
return {gmlib::world::Level::getInstance()->getWorldSpawn(), 0}; return {GMLIB_Level::getInstance()->getWorldSpawn(), 0};
}); });
RemoteCall::exportAs("GMLIB_API", "setWorldSpawn", [](std::pair<BlockPos, int> pos) -> bool { RemoteCall::exportAs("GMLIB_API", "setWorldSpawn", [](std::pair<BlockPos, int> pos) -> bool {
if (pos.second != 0) return false; if (pos.second != 0) return false;
gmlib::world::Level::getInstance()->setWorldSpawn(pos.first); GMLIB_Level::getInstance()->setWorldSpawn(pos.first);
return true; return true;
}); });
RemoteCall::exportAs("GMLIB_API", "getPlayerSpawnPoint", [](Player* pl) -> std::pair<BlockPos, int> { RemoteCall::exportAs("GMLIB_API", "getPlayerSpawnPoint", [](Player* pl) -> std::pair<BlockPos, int> {
auto res = ((gmlib::world::Player*)pl)->getSpawnPoint(); auto res = ((GMLIB_Player*)pl)->getSpawnPoint();
return {res.first, res.second}; return {res.first, res.second};
}); });
RemoteCall::exportAs("GMLIB_API", "setPlayerSpawnPoint", [](Player* pl, std::pair<BlockPos, int> pos) -> void { RemoteCall::exportAs("GMLIB_API", "setPlayerSpawnPoint", [](Player* pl, std::pair<BlockPos, int> pos) -> void {
((gmlib::world::Player*)pl)->setSpawnPoint(pos.first, pos.second); ((GMLIB_Player*)pl)->setSpawnPoint(pos.first, pos.second);
}); });
RemoteCall::exportAs("GMLIB_API", "clearPlayerSpawnPoint", [](Player* pl) -> void { RemoteCall::exportAs("GMLIB_API", "clearPlayerSpawnPoint", [](Player* pl) -> void {
((gmlib::world::Player*)pl)->clearSpawnPoint(); ((GMLIB_Player*)pl)->clearSpawnPoint();
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLIB_API", "GMLIB_API",
@@ -472,24 +462,24 @@ void Export_Compatibility_API() {
} }
); );
RemoteCall::exportAs("GMLIB_API", "getXuidByUuid", [](std::string const& uuid) -> std::string { RemoteCall::exportAs("GMLIB_API", "getXuidByUuid", [](std::string const& uuid) -> std::string {
return gmlib::tools::UserCache::getXuidByUuid(mce::UUID::fromString(uuid)).value_or(""); return GMLIB::UserCache::getXuidByUuid(mce::UUID::fromString(uuid)).value_or("");
}); });
RemoteCall::exportAs("GMLIB_API", "getXuidByName", [](std::string const& name) -> std::string { RemoteCall::exportAs("GMLIB_API", "getXuidByName", [](std::string const& name) -> std::string {
return gmlib::tools::UserCache::getXuidByName(name).value_or(""); return GMLIB::UserCache::getXuidByName(name).value_or("");
}); });
RemoteCall::exportAs("GMLIB_API", "getNameByUuid", [](std::string const& uuid) -> std::string { RemoteCall::exportAs("GMLIB_API", "getNameByUuid", [](std::string const& uuid) -> std::string {
return gmlib::tools::UserCache::getNameByUuid(mce::UUID::fromString(uuid)).value_or(""); return GMLIB::UserCache::getNameByUuid(mce::UUID::fromString(uuid)).value_or("");
}); });
RemoteCall::exportAs("GMLIB_API", "getNameByXuid", [](std::string const& xuid) -> std::string { RemoteCall::exportAs("GMLIB_API", "getNameByXuid", [](std::string const& xuid) -> std::string {
return gmlib::tools::UserCache::getNameByXuid(xuid).value_or(""); return GMLIB::UserCache::getNameByXuid(xuid).value_or("");
}); });
RemoteCall::exportAs("GMLIB_API", "getUuidByXuid", [](std::string const& xuid) -> std::string { RemoteCall::exportAs("GMLIB_API", "getUuidByXuid", [](std::string const& xuid) -> std::string {
return gmlib::tools::UserCache::getUuidByXuid(xuid) return GMLIB::UserCache::getUuidByXuid(xuid)
.transform([](mce::UUID&& uuid) -> std::string { return uuid.asString(); }) .transform([](mce::UUID&& uuid) -> std::string { return uuid.asString(); })
.value_or(""); .value_or("");
}); });
RemoteCall::exportAs("GMLIB_API", "getUuidByName", [](std::string const& name) -> std::string { RemoteCall::exportAs("GMLIB_API", "getUuidByName", [](std::string const& name) -> std::string {
return gmlib::tools::UserCache::getUuidByName(name) return GMLIB::UserCache::getUuidByName(name)
.transform([](mce::UUID&& uuid) -> std::string { return uuid.asString(); }) .transform([](mce::UUID&& uuid) -> std::string { return uuid.asString(); })
.value_or(""); .value_or("");
}); });
@@ -498,7 +488,7 @@ void Export_Compatibility_API() {
"getAllPlayerInfo", "getAllPlayerInfo",
[]() -> std::vector<std::unordered_map<std::string, std::string>> { []() -> std::vector<std::unordered_map<std::string, std::string>> {
std::vector<std::unordered_map<std::string, std::string>> result; std::vector<std::unordered_map<std::string, std::string>> result;
gmlib::tools::UserCache::forEach([&result](const gmlib::tools::UserCache::UserCacheEntry& entry) -> void { GMLIB::UserCache::forEach([&result](const GMLIB::UserCache::UserCacheEntry& entry) -> void {
result.push_back({ result.push_back({
{"Name", entry.mName }, {"Name", entry.mName },
{"Xuid", entry.mXuid }, {"Xuid", entry.mXuid },
@@ -526,7 +516,7 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"readNbtFromFile", "readNbtFromFile",
[](std::string const& path, bool isBinary) -> std::unique_ptr<CompoundTag> { [](std::string const& path, bool isBinary) -> std::unique_ptr<CompoundTag> {
if (auto nbt = gmlib::world::CompoundTag::readFromFile(path, isBinary)) { if (auto nbt = GMLIB_CompoundTag::readFromFile(path, isBinary)) {
return std::make_unique<CompoundTag>(nbt.value()); return std::make_unique<CompoundTag>(nbt.value());
} }
return nullptr; return nullptr;
@@ -536,7 +526,7 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"saveNbtToFile", "saveNbtToFile",
[](std::string const& path, CompoundTag* nbt, bool isBinary) -> bool { [](std::string const& path, CompoundTag* nbt, bool isBinary) -> bool {
return gmlib::world::CompoundTag::saveToFile(path, *nbt, isBinary); return GMLIB_CompoundTag::saveToFile(path, *nbt, isBinary);
} }
); );
RemoteCall::exportAs("GMLIB_API", "getBlockDestroySpeed", [](Block const* block) -> float { RemoteCall::exportAs("GMLIB_API", "getBlockDestroySpeed", [](Block const* block) -> float {
@@ -688,22 +678,22 @@ void Export_Compatibility_API() {
return entity->getNameTag(); return entity->getNameTag();
}); });
RemoteCall::exportAs("GMLIB_API", "ItemisUnbreakable", [](ItemStack const* item) -> bool { RemoteCall::exportAs("GMLIB_API", "ItemisUnbreakable", [](ItemStack const* item) -> bool {
return ((gmlib::world::ItemStack*)item)->isUnbreakable(); return ((GMLIB_ItemStack*)item)->isUnbreakable();
}); });
RemoteCall::exportAs("GMLIB_API", "setItemUnbreakable", [](ItemStack const* item, bool value) -> void { RemoteCall::exportAs("GMLIB_API", "setItemUnbreakable", [](ItemStack const* item, bool value) -> void {
((gmlib::world::ItemStack*)item)->setUnbreakable(value); ((GMLIB_ItemStack*)item)->setUnbreakable(value);
}); });
RemoteCall::exportAs("GMLIB_API", "getItemShouldKeepOnDeath", [](ItemStack const* item) -> bool { RemoteCall::exportAs("GMLIB_API", "getItemShouldKeepOnDeath", [](ItemStack const* item) -> bool {
return ((gmlib::world::ItemStack*)item)->getShouldKeepOnDeath(); return ((GMLIB_ItemStack*)item)->getShouldKeepOnDeath();
}); });
RemoteCall::exportAs("GMLIB_API", "setItemShouldKeepOnDeath", [](ItemStack const* item, bool value) -> void { RemoteCall::exportAs("GMLIB_API", "setItemShouldKeepOnDeath", [](ItemStack const* item, bool value) -> void {
((gmlib::world::ItemStack*)item)->setShouldKeepOnDeath(value); ((GMLIB_ItemStack*)item)->setShouldKeepOnDeath(value);
}); });
RemoteCall::exportAs("GMLIB_API", "getItemLockMode", [](ItemStack const* item) -> int { RemoteCall::exportAs("GMLIB_API", "getItemLockMode", [](ItemStack const* item) -> int {
return (int)((gmlib::world::ItemStack*)item)->getItemLockMode(); return (int)((GMLIB_ItemStack*)item)->getItemLockMode();
}); });
RemoteCall::exportAs("GMLIB_API", "setItemLockMode", [](ItemStack const* item, int value) -> void { RemoteCall::exportAs("GMLIB_API", "setItemLockMode", [](ItemStack const* item, int value) -> void {
((gmlib::world::ItemStack*)item)->setItemLockMode((ItemLockMode)value); ((GMLIB_ItemStack*)item)->setItemLockMode((ItemLockMode)value);
}); });
RemoteCall::exportAs("GMLIB_API", "getItemRepairCost", [](ItemStack const* item) -> int { RemoteCall::exportAs("GMLIB_API", "getItemRepairCost", [](ItemStack const* item) -> int {
return item->getBaseRepairCost(); return item->getBaseRepairCost();
@@ -713,7 +703,7 @@ void Export_Compatibility_API() {
}); });
RemoteCall::exportAs("GMLIB_API", "getItemCanDestroy", [](ItemStack const* item) -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getItemCanDestroy", [](ItemStack const* item) -> std::vector<std::string> {
std::vector<std::string> result = {}; std::vector<std::string> result = {};
for (auto& block : ((gmlib::world::ItemStack*)item)->getCanDestroy()) { for (auto& block : ((GMLIB_ItemStack*)item)->getCanDestroy()) {
result.push_back(block->getTypeName()); result.push_back(block->getTypeName());
} }
return result; return result;
@@ -722,12 +712,12 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"setItemCanDestroy", "setItemCanDestroy",
[](ItemStack const* item, std::vector<std::string> blocks) -> void { [](ItemStack const* item, std::vector<std::string> blocks) -> void {
((gmlib::world::ItemStack*)item)->setCanDestroy(blocks); ((GMLIB_ItemStack*)item)->setCanDestroy(blocks);
} }
); );
RemoteCall::exportAs("GMLIB_API", "getItemCanPlaceOn", [](ItemStack const* item) -> std::vector<std::string> { RemoteCall::exportAs("GMLIB_API", "getItemCanPlaceOn", [](ItemStack const* item) -> std::vector<std::string> {
std::vector<std::string> result = {}; std::vector<std::string> result = {};
for (auto& block : ((gmlib::world::ItemStack*)item)->getCanPlaceOn()) { for (auto& block : ((GMLIB_ItemStack*)item)->getCanPlaceOn()) {
result.push_back(block->getTypeName()); result.push_back(block->getTypeName());
} }
return result; return result;
@@ -736,7 +726,7 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"setItemCanPlaceOn", "setItemCanPlaceOn",
[](ItemStack const* item, std::vector<std::string> blocks) -> void { [](ItemStack const* item, std::vector<std::string> blocks) -> void {
((gmlib::world::ItemStack*)item)->setCanPlaceOn(blocks); ((GMLIB_ItemStack*)item)->setCanPlaceOn(blocks);
} }
); );
RemoteCall::exportAs("GMLIB_API", "getPlayerHungry", [](Player* player) -> float { RemoteCall::exportAs("GMLIB_API", "getPlayerHungry", [](Player* player) -> float {
@@ -783,7 +773,7 @@ void Export_Compatibility_API() {
return magic_enum::enum_name(container->getContainerType()).data(); return magic_enum::enum_name(container->getContainerType()).data();
}); });
RemoteCall::exportAs("GMLIB_API", "hasPlayerNbt", [](std::string const& uuid) -> bool { RemoteCall::exportAs("GMLIB_API", "hasPlayerNbt", [](std::string const& uuid) -> bool {
return gmlib::world::Player::getPlayerNbt(mce::UUID::fromString(uuid)) != nullptr; return GMLIB_Player::getPlayerNbt(mce::UUID::fromString(uuid)) != nullptr;
}); });
RemoteCall::exportAs("GMLIB_API", "getItemMaxCount", [](ItemStack const* item) -> int { RemoteCall::exportAs("GMLIB_API", "getItemMaxCount", [](ItemStack const* item) -> int {
return item->getMaxStackSize(); return item->getMaxStackSize();
@@ -850,7 +840,9 @@ void Export_Compatibility_API() {
} }
}); });
RemoteCall::exportAs("GMLIB_API", "getDefaultGameMode", []() -> int { RemoteCall::exportAs("GMLIB_API", "getDefaultGameMode", []() -> int {
return ll::service::getLevel().transform([](Level& level) -> int { return (int)level.getDefaultGameType(); }).value_or(-1); return ll::service::getLevel().transform(
[](Level& level) -> int { return (int)level.getDefaultGameType(); }
).value_or(-1);
}); });
RemoteCall::exportAs("GMLIB_API", "setDefaultGameMode", [](int gameMode) -> void { RemoteCall::exportAs("GMLIB_API", "setDefaultGameMode", [](int gameMode) -> void {
if (auto level = ll::service::getLevel()) { if (auto level = ll::service::getLevel()) {
@@ -861,13 +853,13 @@ void Export_Compatibility_API() {
"GMLIB_API", "GMLIB_API",
"registerCustomShapelessRecipe", "registerCustomShapelessRecipe",
[](std::string const& recipe_id, std::vector<std::string> ingredients, ItemStack* result) -> void { [](std::string const& recipe_id, std::vector<std::string> ingredients, ItemStack* result) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
std::vector<Recipes::Type> types; std::vector<Recipes::Type> types;
char rt = 'A'; char rt = 'A';
for (auto& ing : ingredients) { for (auto& ing : ingredients) {
types.emplace_back(ing, rt++, 1, 0); types.emplace_back(ing, rt++, 1, 0);
} }
gmlib::mod::recipe::RecipeRegistry::registerShapelessCraftingTableRecipe(recipe_id, types, *result); GMLIB::Mod::CustomRecipe::registerShapelessCraftingTableRecipe(recipe_id, types, *result);
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
@@ -877,13 +869,13 @@ void Export_Compatibility_API() {
std::vector<std::string> shape, std::vector<std::string> shape,
std::vector<std::string> ingredients, std::vector<std::string> ingredients,
ItemStack* result) -> void { ItemStack* result) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
std::vector<Recipes::Type> types; std::vector<Recipes::Type> types;
char rt = 'A'; char rt = 'A';
for (auto& ing : ingredients) { for (auto& ing : ingredients) {
types.emplace_back(ing, rt++, 1, 0); types.emplace_back(ing, rt++, 1, 0);
} }
gmlib::mod::recipe::RecipeRegistry::registerShapedCraftingTableRecipe(recipe_id, shape, types, *result); GMLIB::Mod::CustomRecipe::registerShapedCraftingTableRecipe(recipe_id, shape, types, *result);
} }
); );
} }
+2 -2
View File
@@ -17,11 +17,11 @@ bool LegacyRemoteCallApi::load() {
ExportPAPI(); ExportPAPI();
Export_Event_API(); Export_Event_API();
Export_BinaryStream_API(); Export_BinaryStream_API();
Export_Form_API(); // Export_Form_API();
logger.info("GMLIB-LegacyRemoteCallApi Loaded!"); logger.info("GMLIB-LegacyRemoteCallApi Loaded!");
logger.info( logger.info(
"Loaded Version: {} with {}", "Loaded Version: {} with {}",
fmt::format(fg(fmt::color::pink), "GMLIB-" + gmlib::Version::getLibVersionString()), fmt::format(fg(fmt::color::pink), "GMLIB-" + GMLIB::Version::getLibVersionString()),
fmt::format(fg(fmt::color::light_green), "GMLIB-LegacyRemoteCallApi-" + LIB_VERSION.asString()) fmt::format(fg(fmt::color::light_green), "GMLIB-LegacyRemoteCallApi-" + LIB_VERSION.asString())
); );
logger.info("Author: GroupMountain"); logger.info("Author: GroupMountain");
+17 -17
View File
@@ -63,7 +63,7 @@ void Export_Event_API() {
switch (doHash(eventName)) { switch (doHash(eventName)) {
case doHash("onClientLogin"): { case doHash("onClientLogin"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::packet::ClientLoginAfterEvent, GMLIB::Event::PacketEvent::ClientLoginAfterEvent,
(std::string const& realName, (std::string const& realName,
std::string const& uuid, std::string const& uuid,
std::string const& serverXuid, std::string const& serverXuid,
@@ -74,7 +74,7 @@ void Export_Event_API() {
} }
case doHash("onWeatherChange"): { case doHash("onWeatherChange"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::level::WeatherUpdateBeforeEvent, GMLIB::Event::LevelEvent::WeatherUpdateBeforeEvent,
(int lightningLevel, int rainLevel, int lightningLast, int rainLast), (int lightningLevel, int rainLevel, int lightningLast, int rainLast),
(ev.getLightningLevel(), ev.getRainLevel(), ev.getLightningLastTick(), ev.getRainingLastTick()), (ev.getLightningLevel(), ev.getRainLevel(), ev.getLightningLastTick(), ev.getRainingLastTick()),
ev.cancel(), ev.cancel(),
@@ -82,7 +82,7 @@ void Export_Event_API() {
} }
case doHash("onMobPick"): { case doHash("onMobPick"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::MobPickupItemBeforeEvent, GMLIB::Event::EntityEvent::MobPickupItemBeforeEvent,
(Actor * mob, Actor * item), (Actor * mob, Actor * item),
(&ev.self(), (Actor*)&ev.getItemActor()), (&ev.self(), (Actor*)&ev.getItemActor()),
ev.cancel(), ev.cancel(),
@@ -90,7 +90,7 @@ void Export_Event_API() {
} }
case doHash("onItemTrySpawn"): { case doHash("onItemTrySpawn"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ItemActorSpawnBeforeEvent, GMLIB::Event::EntityEvent::ItemActorSpawnBeforeEvent,
(const ItemStack* item, std::pair<Vec3, int> position, int64 spawnerUniqueId), (const ItemStack* item, std::pair<Vec3, int> position, int64 spawnerUniqueId),
(&ev.getItem(), (&ev.getItem(),
{ev.getPosition(), ev.getBlockSource().getDimensionId().id}, {ev.getPosition(), ev.getBlockSource().getDimensionId().id},
@@ -100,7 +100,7 @@ void Export_Event_API() {
} }
case doHash("onItemSpawned"): { case doHash("onItemSpawned"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ItemActorSpawnAfterEvent, GMLIB::Event::EntityEvent::ItemActorSpawnAfterEvent,
(const ItemStack* item, Actor* itemActor, std::pair<Vec3, int> position, int64 spawnerUniqueId), (const ItemStack* item, Actor* itemActor, std::pair<Vec3, int> position, int64 spawnerUniqueId),
(&ev.getItem(), (&ev.getItem(),
(Actor*)&ev.getItemActor(), (Actor*)&ev.getItemActor(),
@@ -111,7 +111,7 @@ void Export_Event_API() {
} }
case doHash("onEntityTryChangeDim"): { case doHash("onEntityTryChangeDim"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ActorChangeDimensionBeforeEvent, GMLIB::Event::EntityEvent::ActorChangeDimensionBeforeEvent,
(Actor * entity, int toDimId), (Actor * entity, int toDimId),
(&ev.self(), ev.getToDimensionId()), (&ev.self(), ev.getToDimensionId()),
ev.cancel(), ev.cancel(),
@@ -119,7 +119,7 @@ void Export_Event_API() {
} }
case doHash("onLeaveBed"): { case doHash("onLeaveBed"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::player::PlayerStopSleepBeforeEvent, GMLIB::Event::PlayerEvent::PlayerStopSleepBeforeEvent,
(Player * pl), (Player * pl),
(&ev.self()), (&ev.self()),
ev.cancel(), ev.cancel(),
@@ -127,7 +127,7 @@ void Export_Event_API() {
} }
case doHash("onDeathMessage"): { case doHash("onDeathMessage"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::DeathMessageAfterEvent, GMLIB::Event::EntityEvent::DeathMessageAfterEvent,
(std::string const& message, std::vector<std::string>, Actor* dead), (std::string const& message, std::vector<std::string>, Actor* dead),
(ev.getDeathMessage().first, ev.getDeathMessage().second, &ev.self()), (ev.getDeathMessage().first, ev.getDeathMessage().second, &ev.self()),
logger.error("Event \"onDeathMessage\" cannot be intercepted"), logger.error("Event \"onDeathMessage\" cannot be intercepted"),
@@ -135,7 +135,7 @@ void Export_Event_API() {
} }
case doHash("onMobHurted"): { case doHash("onMobHurted"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::MobHurtAfterEvent, GMLIB::Event::EntityEvent::MobHurtAfterEvent,
(Actor * mob, Actor * source, float damage, int cause), (Actor * mob, Actor * source, float damage, int cause),
(&ev.self(), source, ev.getDamage(), (int)damageSource.getCause()), (&ev.self(), source, ev.getDamage(), (int)damageSource.getCause()),
logger.error("Event \"onMobHurted\" cannot be intercepted"), logger.error("Event \"onMobHurted\" cannot be intercepted"),
@@ -150,7 +150,7 @@ void Export_Event_API() {
} }
case doHash("onEndermanTake"): { case doHash("onEndermanTake"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::EndermanTakeBlockBeforeEvent, GMLIB::Event::EntityEvent::EndermanTakeBlockBeforeEvent,
(Actor * mob), (Actor * mob),
(&ev.self()), (&ev.self()),
ev.cancel(), ev.cancel(),
@@ -158,7 +158,7 @@ void Export_Event_API() {
} }
case doHash("onEntityChangeDim"): { case doHash("onEntityChangeDim"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ActorChangeDimensionAfterEvent, GMLIB::Event::EntityEvent::ActorChangeDimensionAfterEvent,
(Actor * mob, int fromDimId), (Actor * mob, int fromDimId),
(&ev.self(), ev.getFromDimensionId()), (&ev.self(), ev.getFromDimensionId()),
logger.error("Event \"onEntityChangeDim\" cannot be intercepted"), logger.error("Event \"onEntityChangeDim\" cannot be intercepted"),
@@ -166,7 +166,7 @@ void Export_Event_API() {
} }
case doHash("onDragonRespawn"): { case doHash("onDragonRespawn"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::DragonRespawnBeforeEvent, GMLIB::Event::EntityEvent::DragonRespawnBeforeEvent,
(int64 enderDragonUniqueID), (int64 enderDragonUniqueID),
(ev.getEnderDragon().id), (ev.getEnderDragon().id),
ev.cancel(), ev.cancel(),
@@ -174,7 +174,7 @@ void Export_Event_API() {
} }
case doHash("onProjectileTryCreate"): { case doHash("onProjectileTryCreate"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ProjectileCreateBeforeEvent, GMLIB::Event::EntityEvent::ProjectileCreateBeforeEvent,
(Actor * mob, int64 uniqueId), (Actor * mob, int64 uniqueId),
(&ev.self(), ev.getShooter() ? ev.getShooter()->getOrCreateUniqueID().id : -1), (&ev.self(), ev.getShooter() ? ev.getShooter()->getOrCreateUniqueID().id : -1),
ev.cancel(), ev.cancel(),
@@ -182,7 +182,7 @@ void Export_Event_API() {
} }
case doHash("onProjectileCreate"): { case doHash("onProjectileCreate"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::ProjectileCreateAfterEvent, GMLIB::Event::EntityEvent::ProjectileCreateAfterEvent,
(Actor * mob, int64 uniqueId), (Actor * mob, int64 uniqueId),
(&ev.self(), ev.getShooter() ? ev.getShooter()->getOrCreateUniqueID().id : -1), (&ev.self(), ev.getShooter() ? ev.getShooter()->getOrCreateUniqueID().id : -1),
logger.error("Event \"onProjectileCreate\" cannot be intercepted"), logger.error("Event \"onProjectileCreate\" cannot be intercepted"),
@@ -190,7 +190,7 @@ void Export_Event_API() {
} }
case doHash("onSpawnWanderingTrader"): { case doHash("onSpawnWanderingTrader"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::entity::SpawnWanderingTraderBeforeEvent, GMLIB::Event::EntityEvent::SpawnWanderingTraderBeforeEvent,
(std::pair<BlockPos, int> pos), (std::pair<BlockPos, int> pos),
({ev.getPos(), ev.getRegion().getDimensionId()}), ({ev.getPos(), ev.getRegion().getDimensionId()}),
ev.cancel(), ev.cancel(),
@@ -199,7 +199,7 @@ void Export_Event_API() {
case doHash("onHandleRequestAction"): { case doHash("onHandleRequestAction"): {
// clang-format off // clang-format off
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::player::HandleRequestActionBeforeEvent, GMLIB::Event::PlayerEvent::HandleRequestActionBeforeEvent,
( (
Player * player, Player * player,
std::string const& actionType, std::string const& actionType,
@@ -225,7 +225,7 @@ void Export_Event_API() {
} }
case doHash("onSendContainerClosePacket"): { case doHash("onSendContainerClosePacket"): {
REGISTER_EVENT_LISTEN( REGISTER_EVENT_LISTEN(
gmlib::event::packet::ContainerClosePacketSendAfterEvent, GMLIB::Event::PacketEvent::ContainerClosePacketSendAfterEvent,
(Player * player, int ContainerNetId), (Player * player, int ContainerNetId),
(ev.getServerNetworkHandler() (ev.getServerNetworkHandler()
.getServerPlayer(ev.getNetworkIdentifier(), ev.getPacket().mClientSubId), .getServerPlayer(ev.getNetworkIdentifier(), ev.getPacket().mClientSubId),
+272 -272
View File
@@ -1,288 +1,288 @@
#include "Global.h" // #include "Global.h"
using namespace ll::hash_utils; // using namespace ll::hash_utils;
class LegacyScriptFormManager { // class LegacyScriptFormManager {
private: // private:
int64 mNextFormCallbackId = 0; // int64 mNextFormCallbackId = 0;
int64 mNextFormId = 0; // int64 mNextFormId = 0;
std::unordered_map<int64, std::unique_ptr<gmlib::form::NpcDialogueForm>> mNpcDialogueForms; // std::unordered_map<int64, std::unique_ptr<gmlib::form::NpcDialogueForm>> mNpcDialogueForms;
// std::unordered_map<int64, std::unique_ptr<ChestForm>> mChestForms; // // std::unordered_map<int64, std::unique_ptr<ChestForm>> mChestForms;
public: // public:
// std::string getNextFormCallbackId() { // // std::string getNextFormCallbackId() {
// return "GMLIB_FormApi_" + std::to_string(mNextFormCallbackId++); // // return "GMLIB_FormApi_" + std::to_string(mNextFormCallbackId++);
// } // // }
int64 getNextFormId() { // int64 getNextFormId() {
mNextFormId++; // mNextFormId++;
return mNextFormId; // return mNextFormId;
} // }
int64 createNpcDialogueForm(std::string const& npcName, std::string const& sceneName, std::string const& dialogue) { // int64 createNpcDialogueForm(std::string const& npcName, std::string const& sceneName, std::string const& dialogue) {
auto formId = LegacyScriptFormManager::getInstance().getNextFormId(); // auto formId = LegacyScriptFormManager::getInstance().getNextFormId();
auto formPtr = std::make_unique<gmlib::form::NpcDialogueForm>(npcName, sceneName, dialogue); // auto formPtr = std::make_unique<gmlib::form::NpcDialogueForm>(npcName, sceneName, dialogue);
mNpcDialogueForms[formId] = std::move(formPtr); // mNpcDialogueForms[formId] = std::move(formPtr);
return formId; // return formId;
} // }
bool destroyNpcDialogueForm(int64 formId) { // bool destroyNpcDialogueForm(int64 formId) {
if (mNpcDialogueForms.contains(formId)) { // if (mNpcDialogueForms.contains(formId)) {
mNpcDialogueForms.erase(formId); // mNpcDialogueForms.erase(formId);
return true; // return true;
} // }
return false; // return false;
} // }
optional_ref<gmlib::form::NpcDialogueForm> getNpcDialogueForm(int64 formId) { // optional_ref<gmlib::form::NpcDialogueForm> getNpcDialogueForm(int64 formId) {
if (mNpcDialogueForms.contains(formId)) { // if (mNpcDialogueForms.contains(formId)) {
return mNpcDialogueForms[formId].get(); // return mNpcDialogueForms[formId].get();
} // }
return {}; // return {};
} // }
/* // /*
int64 createChestForm(std::string const& npcName, std::string const& sceneName, std::string const& dialogue) { // int64 createChestForm(std::string const& npcName, std::string const& sceneName, std::string const& dialogue) {
auto formId = LegacyScriptFormManager::getInstance().getNextFormId(); // auto formId = LegacyScriptFormManager::getInstance().getNextFormId();
auto formPtr = std::make_unique<ChestForm>(npcName, sceneName, dialogue); // auto formPtr = std::make_unique<ChestForm>(npcName, sceneName, dialogue);
mChestForms[formId] = std::move(formPtr); // mChestForms[formId] = std::move(formPtr);
return formId; // return formId;
} // }
bool destroyChestForm(int64 formId) { // bool destroyChestForm(int64 formId) {
if (mChestForms.contains(formId)) { // if (mChestForms.contains(formId)) {
mChestForms.erase(formId); // mChestForms.erase(formId);
return true; // return true;
} // }
return false; // return false;
} // }
optional_ref<ChestForm> getChestForm(int64 formId) { // optional_ref<ChestForm> getChestForm(int64 formId) {
if (mChestForms.contains(formId)) { // if (mChestForms.contains(formId)) {
return mChestForms[formId].get(); // return mChestForms[formId].get();
} // }
return {}; // return {};
} // }
*/ // */
public: // public:
static LegacyScriptFormManager& getInstance() { // static LegacyScriptFormManager& getInstance() {
static std::unique_ptr<LegacyScriptFormManager> instance; // static std::unique_ptr<LegacyScriptFormManager> instance;
if (!instance) { // if (!instance) {
instance = std::make_unique<LegacyScriptFormManager>(); // instance = std::make_unique<LegacyScriptFormManager>();
} // }
return *instance; // return *instance;
} // }
}; // };
#define PLAYER_DETECROR \ // #define PLAYER_DETECROR \
[detectorId, result](::Player& pl) -> bool { \ // [detectorId, result](::Player& pl) -> bool { \
try { \ // try { \
if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", detectorId)) { \ // if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", detectorId)) { \
auto const& detector = RemoteCall::importAs<bool(::Player*)>("GMLIB_FORM_CALLBACK", detectorId); \ // auto const& detector = RemoteCall::importAs<bool(::Player*)>("GMLIB_FORM_CALLBACK", detectorId); \
return detector(&pl); \ // return detector(&pl); \
} else { \ // } else { \
gmlib::form::ServerSettingForm::removeElement(result); \ // gmlib::form::ServerSettingForm::removeElement(result); \
} \ // } \
} catch (...) {} \ // } catch (...) {} \
return false; \ // return false; \
} // }
#define CALLBACK_TYPE(type) \ // #define CALLBACK_TYPE(type) \
[callbackId, result](Player& pl, type data) { \ // [callbackId, result](Player& pl, type data) { \
try { \ // try { \
if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", callbackId)) { \ // if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", callbackId)) { \
auto const& callback = RemoteCall::importAs<void(Player*, type)>("GMLIB_FORM_CALLBACK", callbackId); \ // auto const& callback = RemoteCall::importAs<void(Player*, type)>("GMLIB_FORM_CALLBACK", callbackId); \
callback(&pl, data); \ // callback(&pl, data); \
} else { \ // } else { \
gmlib::form::ServerSettingForm::removeElement(result); \ // gmlib::form::ServerSettingForm::removeElement(result); \
} \ // } \
} catch (...) {} \ // } catch (...) {} \
} // }
#define CALLBACK_TYPE_NORMAL \ // #define CALLBACK_TYPE_NORMAL \
[callbackId](::Player& pl) { \ // [callbackId](::Player& pl) { \
try { \ // try { \
if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", callbackId)) { \ // if (RemoteCall::hasFunc("GMLIB_FORM_CALLBACK", callbackId)) { \
auto const& callback = RemoteCall::importAs<void(::Player*)>("GMLIB_FORM_CALLBACK", callbackId); \ // auto const& callback = RemoteCall::importAs<void(::Player*)>("GMLIB_FORM_CALLBACK", callbackId); \
callback(&pl); \ // callback(&pl); \
} \ // } \
} catch (...) {} \ // } catch (...) {} \
} // }
void Export_Form_API() { // void Export_Form_API() {
//////////////////////////////// Form Manager ///////////////////////////////// // //////////////////////////////// Form Manager /////////////////////////////////
// RemoteCall::exportAs("GMLIB_FormAPI", "getNextFormCallbackId", []() -> std::string { // // RemoteCall::exportAs("GMLIB_FormAPI", "getNextFormCallbackId", []() -> std::string {
// return LegacyScriptFormManager::getInstance().getNextFormCallbackId(); // // return LegacyScriptFormManager::getInstance().getNextFormCallbackId();
// }); // // });
////////////////////////////// ServerSettingForm ////////////////////////////// // ////////////////////////////// ServerSettingForm //////////////////////////////
RemoteCall::exportAs("GMLIB_ServerSettingForm", "getDefaultPriority", []() -> int { // RemoteCall::exportAs("GMLIB_ServerSettingForm", "getDefaultPriority", []() -> int {
return gmlib::form::ServerSettingForm::getDefaultPriority(); // return gmlib::form::ServerSettingForm::getDefaultPriority();
}); // });
RemoteCall::exportAs("GMLIB_ServerSettingForm", "hasTitle", []() -> bool { return gmlib::form::ServerSettingForm::hasTitle(); }); // RemoteCall::exportAs("GMLIB_ServerSettingForm", "hasTitle", []() -> bool { return gmlib::form::ServerSettingForm::hasTitle(); });
RemoteCall::exportAs("GMLIB_ServerSettingForm", "getTitle", []() -> std::string { // RemoteCall::exportAs("GMLIB_ServerSettingForm", "getTitle", []() -> std::string {
return gmlib::form::ServerSettingForm::getTitle(); // return gmlib::form::ServerSettingForm::getTitle();
}); // });
RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "setTitle", [](std::string const& title, bool forceModify) -> bool { // RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "setTitle", [](std::string const& title, bool forceModify) -> bool {
return gmlib::form::ServerSettingForm::setTitle(title, forceModify); // return gmlib::form::ServerSettingForm::setTitle(title, forceModify);
}); // });
RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "hasIcon", []() -> bool { return gmlib::form::ServerSettingForm::hasIcon(); }); // RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "hasIcon", []() -> bool { return gmlib::form::ServerSettingForm::hasIcon(); });
RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "getIconData", []() -> std::string { // RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "getIconData", []() -> std::string {
return gmlib::form::ServerSettingForm::getIconData().value_or(""); // return gmlib::form::ServerSettingForm::getIconData().value_or("");
}); // });
RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "getIconType", []() -> int { // RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "getIconType", []() -> int {
return gmlib::form::ServerSettingForm::getIconType() // return gmlib::form::ServerSettingForm::getIconType()
.transform([](gmlib::form::IconType&& type) -> int { return (int)type; }) // .transform([](gmlib::form::IconType&& type) -> int { return (int)type; })
.value_or(-1); // .value_or(-1);
}); // });
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"setIcon", // "setIcon",
[](std::string const& title, uchar type, bool forceModify) -> bool { // [](std::string const& title, uchar type, bool forceModify) -> bool {
return gmlib::form::ServerSettingForm::setIcon(title, gmlib::form::IconType(type), forceModify); // return gmlib::form::ServerSettingForm::setIcon(title, gmlib::form::IconType(type), forceModify);
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addLabel", // "addLabel",
[](std::string const& text, std::string const& detectorId, int priority) -> uint { // [](std::string const& text, std::string const& detectorId, int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addLabel(text, PLAYER_DETECROR, priority); // uint result = gmlib::form::ServerSettingForm::addLabel(text, PLAYER_DETECROR, priority);
return result; // return result;
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addInput", // "addInput",
[](std::string const& text, // [](std::string const& text,
std::string const& placeholder, // std::string const& placeholder,
std::string const& defaultVal, // std::string const& defaultVal,
std::string const& callbackId, // std::string const& callbackId,
std::string const& detectorId, // std::string const& detectorId,
int priority) -> uint { // int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addInput( // uint result = gmlib::form::ServerSettingForm::addInput(
text, // text,
placeholder, // placeholder,
defaultVal, // defaultVal,
CALLBACK_TYPE(std::string const&), // CALLBACK_TYPE(std::string const&),
PLAYER_DETECROR, // PLAYER_DETECROR,
priority // priority
); // );
return result; // return result;
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addToggle", // "addToggle",
[](std::string const& text, // [](std::string const& text,
bool defaultVal, // bool defaultVal,
std::string const& callbackId, // std::string const& callbackId,
std::string const& detectorId, // std::string const& detectorId,
int priority) -> uint { // int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addToggle(text, defaultVal, CALLBACK_TYPE(bool), PLAYER_DETECROR, priority); // uint result = gmlib::form::ServerSettingForm::addToggle(text, defaultVal, CALLBACK_TYPE(bool), PLAYER_DETECROR, priority);
return result; // return result;
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addDropdown", // "addDropdown",
[](std::string const& text, // [](std::string const& text,
std::vector<std::string> options, // std::vector<std::string> options,
int64 defaultVal, // int64 defaultVal,
std::string const& callbackId, // std::string const& callbackId,
std::string const& detectorId, // std::string const& detectorId,
int priority) -> uint { // int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addDropdown( // uint result = gmlib::form::ServerSettingForm::addDropdown(
text, // text,
options, // options,
defaultVal, // defaultVal,
CALLBACK_TYPE(int64), // CALLBACK_TYPE(int64),
PLAYER_DETECROR, // PLAYER_DETECROR,
priority // priority
); // );
return result; // return result;
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addSlider", // "addSlider",
[](std::string const& text, // [](std::string const& text,
double min, // double min,
double max, // double max,
double step, // double step,
double defaultVal, // double defaultVal,
std::string const& callbackId, // std::string const& callbackId,
std::string const& detectorId, // std::string const& detectorId,
int priority) -> uint { // int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addSlider( // uint result = gmlib::form::ServerSettingForm::addSlider(
text, // text,
min, // min,
max, // max,
step, // step,
defaultVal, // defaultVal,
CALLBACK_TYPE(double), // CALLBACK_TYPE(double),
PLAYER_DETECROR, // PLAYER_DETECROR,
priority // priority
); // );
return result; // return result;
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_gmlib::form::ServerSettingForm", // "GMLIB_gmlib::form::ServerSettingForm",
"addStepSlider", // "addStepSlider",
[](std::string const& text, // [](std::string const& text,
std::vector<std::string> steps, // std::vector<std::string> steps,
int64 defaultVal, // int64 defaultVal,
std::string const& callbackId, // std::string const& callbackId,
std::string const& detectorId, // std::string const& detectorId,
int priority) -> uint { // int priority) -> uint {
uint result = gmlib::form::ServerSettingForm::addStepSlider( // uint result = gmlib::form::ServerSettingForm::addStepSlider(
text, // text,
steps, // steps,
defaultVal, // defaultVal,
CALLBACK_TYPE(int64), // CALLBACK_TYPE(int64),
PLAYER_DETECROR, // PLAYER_DETECROR,
priority // priority
); // );
return result; // return result;
} // }
); // );
RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "removeElement", [](uint id) -> bool { // RemoteCall::exportAs("GMLIB_gmlib::form::ServerSettingForm", "removeElement", [](uint id) -> bool {
return gmlib::form::ServerSettingForm::removeElement(id); // return gmlib::form::ServerSettingForm::removeElement(id);
}); // });
////////////////////////////// NpcDialogueForm ////////////////////////////// // ////////////////////////////// NpcDialogueForm //////////////////////////////
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_NpcDialogueForm", // "GMLIB_NpcDialogueForm",
"createForm", // "createForm",
[](std::string const& npcName, std::string const& sceneName, std::string const& dialogue) -> int64 { // [](std::string const& npcName, std::string const& sceneName, std::string const& dialogue) -> int64 {
return LegacyScriptFormManager::getInstance().createNpcDialogueForm(npcName, sceneName, dialogue); // return LegacyScriptFormManager::getInstance().createNpcDialogueForm(npcName, sceneName, dialogue);
} // }
); // );
RemoteCall::exportAs("GMLIB_NpcDialogueForm", "destroyForm", [](int64 formId) -> bool { // RemoteCall::exportAs("GMLIB_NpcDialogueForm", "destroyForm", [](int64 formId) -> bool {
return LegacyScriptFormManager::getInstance().destroyNpcDialogueForm(formId); // return LegacyScriptFormManager::getInstance().destroyNpcDialogueForm(formId);
}); // });
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_NpcDialogueForm", // "GMLIB_NpcDialogueForm",
"addButton", // "addButton",
[](int64 formId, std::string const& button, std::string const& callbackId) -> void { // [](int64 formId, std::string const& button, std::string const& callbackId) -> void {
if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) { // if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) {
formPtr->addButton(button, CALLBACK_TYPE_NORMAL); // formPtr->addButton(button, CALLBACK_TYPE_NORMAL);
} // }
} // }
); // );
RemoteCall::exportAs( // RemoteCall::exportAs(
"GMLIB_NpcDialogueForm", // "GMLIB_NpcDialogueForm",
"onPlayerClose", // "onPlayerClose",
[](int64 formId, std::string const& callbackId) -> void { // [](int64 formId, std::string const& callbackId) -> void {
if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) { // if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) {
formPtr->onPlayerClose(CALLBACK_TYPE_NORMAL); // formPtr->onPlayerClose(CALLBACK_TYPE_NORMAL);
} // }
} // }
); // );
RemoteCall::exportAs("GMLIB_NpcDialogueForm", "sendTo", [](int64 formId, ::Player* pl) -> void { // RemoteCall::exportAs("GMLIB_NpcDialogueForm", "sendTo", [](int64 formId, ::Player* pl) -> void {
if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) { // if (auto formPtr = LegacyScriptFormManager::getInstance().getNpcDialogueForm(formId)) {
formPtr->sendTo(*pl); // formPtr->sendTo(*pl);
} // }
}); // });
////////////////////////////// ChestForm ////////////////////////////// // ////////////////////////////// ChestForm //////////////////////////////
} // }
+4 -4
View File
@@ -1,5 +1,5 @@
#pragma once #pragma once
#include <headers/include_all.h> #include <include_all.h>
#include <RemoteCallAPI.h> #include <RemoteCallAPI.h>
@@ -7,9 +7,9 @@
#define LIB_VERSION_MAJOR 0 #define LIB_VERSION_MAJOR 0
#define LIB_VERSION_MINOR 13 #define LIB_VERSION_MINOR 13
#define LIB_VERSION_PATCH 3 #define LIB_VERSION_PATCH 4
#define LIB_VERSION gmlib::Version(LIB_VERSION_MAJOR, LIB_VERSION_MINOR, LIB_VERSION_PATCH) #define LIB_VERSION GMLIB::Version(LIB_VERSION_MAJOR, LIB_VERSION_MINOR, LIB_VERSION_PATCH)
extern ll::Logger logger; extern ll::Logger logger;
@@ -19,4 +19,4 @@ extern void Export_Compatibility_API();
extern void ExportPAPI(); extern void ExportPAPI();
extern void Export_Event_API(); extern void Export_Event_API();
extern void Export_BinaryStream_API(); extern void Export_BinaryStream_API();
extern void Export_Form_API(); // extern void Export_Form_API();
+26 -36
View File
@@ -17,12 +17,12 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& result, std::string const& result,
int count, int count,
std::string const& unlock) -> void { std::string const& unlock) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
std::vector<RecipeIngredient> types; std::vector<RecipeIngredient> types;
for (auto ing : ingredients) { for (auto ing : ingredients) {
types.emplace_back(ing, 0, 1); types.emplace_back(ing, 0, 1);
} }
gmlib::mod::recipe::JsonRecipeRegistry::registerShapelessCraftingTableRecipe( GMLIB::Mod::JsonRecipe::registerShapelessCraftingTableRecipe(
recipe_id, recipe_id,
types, types,
RecipeIngredient(result, 0, count), RecipeIngredient(result, 0, count),
@@ -39,12 +39,12 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& result, std::string const& result,
int count, int count,
std::string const& unlock) -> void { std::string const& unlock) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
std::vector<RecipeIngredient> types; std::vector<RecipeIngredient> types;
for (auto ing : ingredients) { for (auto ing : ingredients) {
types.push_back(RecipeIngredient(ing, 0, 1)); types.push_back(RecipeIngredient(ing, 0, 1));
} }
gmlib::mod::recipe::JsonRecipeRegistry::registerShapedCraftingTableRecipe( GMLIB::Mod::JsonRecipe::registerShapedCraftingTableRecipe(
recipe_id, recipe_id,
shape, shape,
types, types,
@@ -60,8 +60,8 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& input, std::string const& input,
std::string const& output, std::string const& output,
std::vector<std::string> tags) -> void { std::vector<std::string> tags) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerFurnaceRecipe( GMLIB::Mod::JsonRecipe::registerFurnaceRecipe(
recipe_id, recipe_id,
RecipeIngredient(input, 0, 1), RecipeIngredient(input, 0, 1),
RecipeIngredient(output, 0, 1), RecipeIngredient(output, 0, 1),
@@ -74,13 +74,8 @@ void Export_Legacy_GMLib_ModAPI() {
"registerBrewingMixRecipe", "registerBrewingMixRecipe",
[](std::string const& recipe_id, std::string const& input, std::string const& output, std::string const& reagent [](std::string const& recipe_id, std::string const& input, std::string const& output, std::string const& reagent
) -> void { ) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerBrewingMixRecipe( GMLIB::Mod::JsonRecipe::registerBrewingMixRecipe(recipe_id, input, output, RecipeIngredient(reagent, 0, 1));
recipe_id,
input,
output,
RecipeIngredient(reagent, 0, 1)
);
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
@@ -88,8 +83,8 @@ void Export_Legacy_GMLib_ModAPI() {
"registerBrewingContainerRecipe", "registerBrewingContainerRecipe",
[](std::string const& recipe_id, std::string const& input, std::string const& output, std::string const& reagent [](std::string const& recipe_id, std::string const& input, std::string const& output, std::string const& reagent
) -> void { ) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerBrewingContainerRecipe( GMLIB::Mod::JsonRecipe::registerBrewingContainerRecipe(
recipe_id, recipe_id,
RecipeIngredient(input, 0, 1), RecipeIngredient(input, 0, 1),
RecipeIngredient(output, 0, 1), RecipeIngredient(output, 0, 1),
@@ -105,8 +100,8 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& base, std::string const& base,
std::string const& addition, std::string const& addition,
std::string const& result) -> void { std::string const& result) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerSmithingTransformRecipe( GMLIB::Mod::JsonRecipe::registerSmithingTransformRecipe(
recipe_id, recipe_id,
smithing_template, smithing_template,
base, base,
@@ -122,13 +117,8 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& smithing_template, std::string const& smithing_template,
std::string const& base, std::string const& base,
std::string const& addition) -> void { std::string const& addition) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerSmithingTrimRecipe( GMLIB::Mod::JsonRecipe::registerSmithingTrimRecipe(recipe_id, smithing_template, base, addition);
recipe_id,
smithing_template,
base,
addition
);
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
@@ -140,8 +130,8 @@ void Export_Legacy_GMLib_ModAPI() {
std::string const& output, std::string const& output,
int output_data, int output_data,
int output_count) -> void { int output_count) -> void {
if (!gmlib::world::Level::getInstance().has_value()) return; if (!GMLIB_Level::getInstance().has_value()) return;
gmlib::mod::recipe::JsonRecipeRegistry::registerStoneCutterRecipe( GMLIB::Mod::JsonRecipe::registerStoneCutterRecipe(
recipe_id, recipe_id,
RecipeIngredient(input, 0, 1), RecipeIngredient(input, 0, 1),
RecipeIngredient(output, 0, 1) RecipeIngredient(output, 0, 1)
@@ -150,39 +140,39 @@ void Export_Legacy_GMLib_ModAPI() {
); );
// 错误方块清理 // 错误方块清理
RemoteCall::exportAs("GMLib_ModAPI", "setUnknownBlockCleaner", []() -> void { RemoteCall::exportAs("GMLib_ModAPI", "setUnknownBlockCleaner", []() -> void {
gmlib::tools::VanillaFix::setAutoCleanUnknownBlockEnabled(); GMLIB::Mod::VanillaFix::setAutoCleanUnknownBlockEnabled();
}); });
// 实验性 // 实验性
RemoteCall::exportAs("GMLib_ModAPI", "registerExperimentsRequire", [](int experiment_id) -> void { RemoteCall::exportAs("GMLib_ModAPI", "registerExperimentsRequire", [](int experiment_id) -> void {
auto list = gmlib::world::Level::getAllExperiments(); auto list = GMLIB_Level::getAllExperiments();
std::unordered_set<AllExperiments> set(list.begin(), list.end()); std::unordered_set<AllExperiments> set(list.begin(), list.end());
if (set.contains((AllExperiments)experiment_id)) { if (set.contains((AllExperiments)experiment_id)) {
gmlib::world::Level::addExperimentsRequire((AllExperiments)experiment_id); GMLIB_Level::addExperimentsRequire((AllExperiments)experiment_id);
} else { } else {
ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id); ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id);
} }
}); });
RemoteCall::exportAs("GMLib_ModAPI", "setExperimentEnabled", [](int experiment_id, bool value) -> void { RemoteCall::exportAs("GMLib_ModAPI", "setExperimentEnabled", [](int experiment_id, bool value) -> void {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
auto list = gmlib::world::Level::getAllExperiments(); auto list = GMLIB_Level::getAllExperiments();
std::unordered_set<AllExperiments> set(list.begin(), list.end()); std::unordered_set<AllExperiments> set(list.begin(), list.end());
if (set.contains((AllExperiments)experiment_id)) { if (set.contains((AllExperiments)experiment_id)) {
gmlib::world::Level::getInstance()->setExperimentEnabled(((AllExperiments)experiment_id), value); GMLIB_Level::getInstance()->setExperimentEnabled(((AllExperiments)experiment_id), value);
} else ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id); } else ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id);
} }
}); });
RemoteCall::exportAs("GMLib_ModAPI", "getExperimentEnabled", [](int experiment_id) -> bool { RemoteCall::exportAs("GMLib_ModAPI", "getExperimentEnabled", [](int experiment_id) -> bool {
if (gmlib::world::Level::getInstance()) { if (GMLIB_Level::getInstance()) {
auto list = gmlib::world::Level::getAllExperiments(); auto list = GMLIB_Level::getAllExperiments();
std::unordered_set<AllExperiments> set(list.begin(), list.end()); std::unordered_set<AllExperiments> set(list.begin(), list.end());
if (set.contains((AllExperiments)experiment_id)) { if (set.contains((AllExperiments)experiment_id)) {
return gmlib::world::Level::getInstance()->getExperimentEnabled(((AllExperiments)experiment_id)); return GMLIB_Level::getInstance()->getExperimentEnabled(((AllExperiments)experiment_id));
} }
ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id); ll::Logger("Server").error("Experiment ID '{}' does not exist!", experiment_id);
} }
return false; return false;
}); });
RemoteCall::exportAs("GMLib_ModAPI", "setFixI18nEnabled", []() -> void { RemoteCall::exportAs("GMLib_ModAPI", "setFixI18nEnabled", []() -> void {
gmlib::tools::VanillaFix::setFixI18nEnabled(); GMLIB::Mod::VanillaFix::setFixI18nEnabled();
}); });
} }
+20 -22
View File
@@ -2,50 +2,48 @@
void Export_Legacy_GMLib_ServerAPI() { void Export_Legacy_GMLib_ServerAPI() {
RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void { RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void {
gmlib::world::Level::tryEnableEducationEdition(); GMLIB_Level::tryEnableEducationEdition();
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "registerAbilityCommand", []() -> void { RemoteCall::exportAs("GMLib_ServerAPI", "registerAbilityCommand", []() -> void {
gmlib::world::Level::tryRegisterAbilityCommand(); GMLIB_Level::tryRegisterAbilityCommand();
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "setEnableAchievement", []() -> void { RemoteCall::exportAs("GMLib_ServerAPI", "setEnableAchievement", []() -> void {
gmlib::world::Level::setForceAchievementsEnabled(); GMLIB_Level::setForceAchievementsEnabled();
});
RemoteCall::exportAs("GMLib_ServerAPI", "setForceTrustSkins", []() -> void {
gmlib::world::Level::trustAllSkins();
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "setForceTrustSkins", []() -> void { GMLIB_Level::trustAllSkins(); });
RemoteCall::exportAs("GMLib_ServerAPI", "enableCoResourcePack", []() -> void { RemoteCall::exportAs("GMLib_ServerAPI", "enableCoResourcePack", []() -> void {
gmlib::world::Level::requireServerResourcePackAndAllowClientResourcePack(); GMLIB_Level::requireServerResourcePackAndAllowClientResourcePack();
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "getLevelName", []() -> std::string { RemoteCall::exportAs("GMLib_ServerAPI", "getLevelName", []() -> std::string {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance()
.transform([](gmlib::world::Level& level) -> std::string { return level.getLevelName(); }) .transform([](GMLIB_Level& level) -> std::string { return level.getLevelName(); })
.value_or(""); .value_or("");
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "setLevelName", [](std::string const& name) -> void { RemoteCall::exportAs("GMLib_ServerAPI", "setLevelName", [](std::string const& name) -> void {
if (auto level = gmlib::world::Level::getInstance()) { if (auto level = GMLIB_Level::getInstance()) {
level->setLevelName(name); level->setLevelName(name);
} }
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "getLevelSeed", []() -> std::string { RemoteCall::exportAs("GMLib_ServerAPI", "getLevelSeed", []() -> std::string {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance()
.transform([](gmlib::world::Level& level) -> std::string { return std::to_string(level.getSeed()); }) .transform([](GMLIB_Level& level) -> std::string { return std::to_string(level.getSeed()); })
.value_or(""); .value_or("");
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "setFakeSeed", [](int64_t seed) -> void { RemoteCall::exportAs("GMLib_ServerAPI", "setFakeSeed", [](int64_t seed) -> void {
return gmlib::world::Level::setFakeSeed(seed); return GMLIB_Level::setFakeSeed(seed);
}); });
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLib_ServerAPI", "GMLib_ServerAPI",
"spawnEntity", "spawnEntity",
[](std::pair<Vec3, int> pos, std::string const& name) -> Actor* { [](std::pair<Vec3, int> pos, std::string const& name) -> Actor* {
return gmlib::world::Spawner::spawnEntity(pos.first, pos.second, name).as_ptr(); return GMLIB_Spawner::spawnEntity(pos.first, pos.second, name).as_ptr();
} }
); );
RemoteCall::exportAs( RemoteCall::exportAs(
"GMLib_ServerAPI", "GMLib_ServerAPI",
"shootProjectile", "shootProjectile",
[](Actor* owner, std::string const& name, float speed, float offset) -> Actor* { [](Actor* owner, std::string const& name, float speed, float offset) -> Actor* {
auto ac = (gmlib::world::Actor*)owner; auto ac = (GMLIB_Actor*)owner;
return ac->shootProjectile(name, speed, offset).as_ptr(); return ac->shootProjectile(name, speed, offset).as_ptr();
} }
); );
@@ -53,7 +51,7 @@ void Export_Legacy_GMLib_ServerAPI() {
"GMLib_ServerAPI", "GMLib_ServerAPI",
"throwEntity", "throwEntity",
[](Actor* owner, Actor* actor, float speed, float offset) -> bool { [](Actor* owner, Actor* actor, float speed, float offset) -> bool {
auto ac = (gmlib::world::Actor*)owner; auto ac = (GMLIB_Actor*)owner;
return ac->throwEntity(*actor, speed, offset); return ac->throwEntity(*actor, speed, offset);
} }
); );
@@ -62,18 +60,18 @@ void Export_Legacy_GMLib_ServerAPI() {
"GMLib_ServerAPI", "GMLib_ServerAPI",
"addFakeList", "addFakeList",
[](const std::string& name, const std::string& xuid) -> bool { [](const std::string& name, const std::string& xuid) -> bool {
return gmlib::tools::FakeList::addFakeList(name, xuid, ActorUniqueID(-1)); return GMLIB::Server::FakeList::addFakeList(name, xuid, ActorUniqueID(-1));
} }
); );
RemoteCall::exportAs("GMLib_ServerAPI", "removeFakeList", [](const std::string& nameOrXuid) -> bool { RemoteCall::exportAs("GMLib_ServerAPI", "removeFakeList", [](const std::string& nameOrXuid) -> bool {
return gmlib::tools::FakeList::removeFakeList(nameOrXuid); return GMLIB::Server::FakeList::removeFakeList(nameOrXuid);
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "removeAllFakeList", []() -> void { RemoteCall::exportAs("GMLib_ServerAPI", "removeAllFakeList", []() -> void {
return gmlib::tools::FakeList::removeAllFakeLists(); return GMLIB::Server::FakeList::removeAllFakeLists();
}); });
RemoteCall::exportAs("GMLib_ServerAPI", "getMaxPlayers", []() -> int { RemoteCall::exportAs("GMLib_ServerAPI", "getMaxPlayers", []() -> int {
return gmlib::world::Level::getInstance() return GMLIB_Level::getInstance().transform(
.transform([](gmlib::world::Level& level) -> int { return level.getMaxPlayerCount(); }) [](GMLIB_Level& level) -> int { return level.getMaxPlayerCount(); }
.value_or(0); ).value_or(0);
}); });
} }
+15 -15
View File
@@ -13,10 +13,10 @@ bool isParameters(std::string const& str) {
return std::regex_search(removeBrackets(str), reg); return std::regex_search(removeBrackets(str), reg);
} }
std::string GetValue(std::string const& from) { return gmlib::tools::PlaceholderAPI::getValue(from); } std::string GetValue(std::string const& from) { return GMLIB::Server::PlaceholderAPI::getValue(from); }
std::string GetValueWithPlayer(std::string const& key, Player* player) { std::string GetValueWithPlayer(std::string const& key, Player* player) {
return gmlib::tools::PlaceholderAPI::getValue(key, player); return GMLIB::Server::PlaceholderAPI::getValue(key, player);
} }
bool registerPlayerPlaceholder( bool registerPlayerPlaceholder(
@@ -25,20 +25,20 @@ bool registerPlayerPlaceholder(
std::string const& PAPIName std::string const& PAPIName
) { ) {
if (RemoteCall::hasFunc(PluginName, FuncName)) { if (RemoteCall::hasFunc(PluginName, FuncName)) {
gmlib::tools::PlaceholderAPI::unregisterPlaceholder(PAPIName); GMLIB::Server::PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) { if (isParameters(PAPIName)) {
auto Call = RemoteCall::importAs<std::string(Player * pl, std::unordered_map<std::string, std::string>)>( auto Call = RemoteCall::importAs<std::string(Player * pl, std::unordered_map<std::string, std::string>)>(
PluginName, PluginName,
FuncName FuncName
); );
gmlib::tools::PlaceholderAPI::registerPlayerPlaceholder( GMLIB::Server::PlaceholderAPI::registerPlayerPlaceholder(
PAPIName, PAPIName,
[Call](Player* sp, std::unordered_map<std::string, std::string> map) { return Call(sp, map); }, [Call](Player* sp, std::unordered_map<std::string, std::string> map) { return Call(sp, map); },
PluginName PluginName
); );
} else { } else {
auto Call = RemoteCall::importAs<std::string(Player * pl)>(PluginName, FuncName); auto Call = RemoteCall::importAs<std::string(Player * pl)>(PluginName, FuncName);
gmlib::tools::PlaceholderAPI::registerPlayerPlaceholder( GMLIB::Server::PlaceholderAPI::registerPlayerPlaceholder(
PAPIName, PAPIName,
[Call](Player* sp) { return Call(sp); }, [Call](Player* sp) { return Call(sp); },
PluginName PluginName
@@ -55,18 +55,18 @@ bool registerServerPlaceholder(
std::string const& PAPIName std::string const& PAPIName
) { ) {
if (RemoteCall::hasFunc(PluginName, FuncName)) { if (RemoteCall::hasFunc(PluginName, FuncName)) {
gmlib::tools::PlaceholderAPI::unregisterPlaceholder(PAPIName); GMLIB::Server::PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) { if (isParameters(PAPIName)) {
auto Call = auto Call =
RemoteCall::importAs<std::string(std::unordered_map<std::string, std::string>)>(PluginName, FuncName); RemoteCall::importAs<std::string(std::unordered_map<std::string, std::string>)>(PluginName, FuncName);
gmlib::tools::PlaceholderAPI::registerServerPlaceholder( GMLIB::Server::PlaceholderAPI::registerServerPlaceholder(
PAPIName, PAPIName,
[Call](std::unordered_map<std::string, std::string> map) { return Call(map); }, [Call](std::unordered_map<std::string, std::string> map) { return Call(map); },
PluginName PluginName
); );
} else { } else {
auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName); auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName);
gmlib::tools::PlaceholderAPI::registerServerPlaceholder(PAPIName, [Call]() { return Call(); }, PluginName); GMLIB::Server::PlaceholderAPI::registerServerPlaceholder(PAPIName, [Call]() { return Call(); }, PluginName);
} }
return true; return true;
} }
@@ -80,17 +80,17 @@ bool registerStaticPlaceholder(
int num int num
) { ) {
if (RemoteCall::hasFunc(PluginName, FuncName)) { if (RemoteCall::hasFunc(PluginName, FuncName)) {
gmlib::tools::PlaceholderAPI::unregisterPlaceholder(PAPIName); GMLIB::Server::PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) { if (isParameters(PAPIName)) {
auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName); auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName);
if (num == -1) { if (num == -1) {
gmlib::tools::PlaceholderAPI::registerStaticPlaceholder( GMLIB::Server::PlaceholderAPI::registerStaticPlaceholder(
PAPIName, PAPIName,
[Call] { return Call(); }, [Call] { return Call(); },
PluginName PluginName
); );
} else { } else {
gmlib::tools::PlaceholderAPI::registerStaticPlaceholder( GMLIB::Server::PlaceholderAPI::registerStaticPlaceholder(
PAPIName, PAPIName,
num, num,
[Call] { return Call(); }, [Call] { return Call(); },
@@ -104,14 +104,14 @@ bool registerStaticPlaceholder(
} }
std::string translateStringWithPlayer(std::string const& str, Player* pl) { std::string translateStringWithPlayer(std::string const& str, Player* pl) {
return gmlib::tools::PlaceholderAPI::translateString(str, pl); return GMLIB::Server::PlaceholderAPI::translateString(str, pl);
} }
std::string translateString(std::string const& str) { return gmlib::tools::PlaceholderAPI::translateString(str); } std::string translateString(std::string const& str) { return GMLIB::Server::PlaceholderAPI::translateString(str); }
bool unRegisterPlaceholder(std::string const& str) { return gmlib::tools::PlaceholderAPI::unregisterPlaceholder(str); } bool unRegisterPlaceholder(std::string const& str) { return GMLIB::Server::PlaceholderAPI::unregisterPlaceholder(str); }
std::vector<std::string> getAllPAPI() { return gmlib::tools::PlaceholderAPI::getAllPAPI(); } std::vector<std::string> getAllPAPI() { return GMLIB::Server::PlaceholderAPI::getAllPAPI(); }
} // namespace PAPIRemoteCall } // namespace PAPIRemoteCall
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"format_version": 2, "format_version": 2,
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi", "tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
"version": "0.13.3", "version": "0.13.4",
"info": { "info": {
"name": "GMLIB-LegacyRemoteCallApi", "name": "GMLIB-LegacyRemoteCallApi",
"description": "Legacy RemoteCall API for GMLIB", "description": "Legacy RemoteCall API for GMLIB",
@@ -14,7 +14,7 @@
"library" "library"
] ]
}, },
"asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.13.3/GMLIB-LegacyRemoteCallApi-windows-x64.zip", "asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.13.4/GMLIB-LegacyRemoteCallApi-windows-x64.zip",
"dependencies": { "dependencies": {
"github.com/GroupMountain/GMLIB": ">=0.13.0" "github.com/GroupMountain/GMLIB": ">=0.13.0"
}, },
+1 -1
View File
@@ -10,7 +10,7 @@ end
-- Option 1: Use the latest version of LeviLamina released on GitHub. -- Option 1: Use the latest version of LeviLamina released on GitHub.
add_requires("levilaminalibrary") add_requires("levilaminalibrary")
add_requires("legacyremotecall") add_requires("legacyremotecall")
add_requires("gmlib") add_requires("gmlib 0.13.7")
-- Option 2: Use a specific version of LeviLamina released on GitHub. -- Option 2: Use a specific version of LeviLamina released on GitHub.
-- add_requires("levilamina x.x.x") -- add_requires("levilamina x.x.x")