refactor: refactoring some api
This commit is contained in:
+1
-1
Submodule SDK-GMLIB updated: 37d92200bd...ae86cc4327
+34
-16
@@ -1,3 +1,6 @@
|
|||||||
|
// LiteLoader-AIDS automatic generated
|
||||||
|
/// <reference path="D:\LiteLoader\VSCode/dts/HelperLib-master/src/index.d.ts"/>
|
||||||
|
|
||||||
const GMLIB_API = {
|
const GMLIB_API = {
|
||||||
createFloatingText: ll.import("GMLIB_API", "createFloatingText"),
|
createFloatingText: ll.import("GMLIB_API", "createFloatingText"),
|
||||||
deleteFloatingText: ll.import("GMLIB_API", "deleteFloatingText"),
|
deleteFloatingText: ll.import("GMLIB_API", "deleteFloatingText"),
|
||||||
@@ -319,18 +322,6 @@ class Minecraft {
|
|||||||
return GMLIB_API.setWorldSpawn(pos);
|
return GMLIB_API.setWorldSpawn(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPlayerSpawnPoint() {
|
|
||||||
return GMLIB_API.getPlayerSpawnPoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
static setPlayerSpawnPoint(pos) {
|
|
||||||
GMLIB_API.setPlayerSpawnPoint(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
static clearPlayerSpawnPoint() {
|
|
||||||
GMLIB_API.clearPlayerSpawnPoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
static setEducationFeatureEnabled() {
|
static setEducationFeatureEnabled() {
|
||||||
return GMLIB_API.setEducationFeatureEnabled();
|
return GMLIB_API.setEducationFeatureEnabled();
|
||||||
}
|
}
|
||||||
@@ -367,10 +358,6 @@ class Minecraft {
|
|||||||
return GMLIB_API.setUnknownBlockCleaner();
|
return GMLIB_API.setUnknownBlockCleaner();
|
||||||
}
|
}
|
||||||
|
|
||||||
static playerToEntity(player) {
|
|
||||||
return GMLIB_API.PlayerToEntity(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
static spawnEntity(pos, name) {
|
static spawnEntity(pos, name) {
|
||||||
return GMLIB_API.spawnEntity(pos, name);
|
return GMLIB_API.spawnEntity(pos, name);
|
||||||
}
|
}
|
||||||
@@ -819,6 +806,31 @@ class JsonI18n {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LLSE_Player.prototype.toEntity = function () {
|
||||||
|
return GMLIB_API.PlayerToEntity(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLSE_Player.prototype.getSpawnPoint = function () {
|
||||||
|
return GMLIB_API.getPlayerSpawnPoint(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLSE_Player.prototype.setSpawnPoint = function (pos) {
|
||||||
|
return GMLIB_API.setPlayerSpawnPoint(this, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLSE_Player.prototype.clearSpawnPoint = function () {
|
||||||
|
return GMLIB_API.clearPlayerSpawnPoint(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLSE_Entity.prototype.shootProjectile = function (proj, speed = 2, offset = 3) {
|
||||||
|
return GMLIB_API.shootProjectile(this, proj, speed, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
LLSE_Entity.prototype.throwEntity = function (proj, speed = 2, offset = 3) {
|
||||||
|
return GMLIB_API.throwEntity(this, proj, speed, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
StaticFloatingText,
|
StaticFloatingText,
|
||||||
DynamicFloatingText,
|
DynamicFloatingText,
|
||||||
@@ -832,3 +844,9 @@ module.exports = {
|
|||||||
JsonI18n,
|
JsonI18n,
|
||||||
Version
|
Version
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -171,10 +171,15 @@ void Export_Compatibility_API() {
|
|||||||
[](std::string key, std::vector<std::string> params) -> std::string { return I18n::get(key, params); }
|
[](std::string key, std::vector<std::string> params) -> std::string { return I18n::get(key, params); }
|
||||||
);
|
);
|
||||||
RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string code) -> void {
|
RemoteCall::exportAs("GMLIB_API", "chooseResourcePackI18nLanguage", [](std::string code) -> void {
|
||||||
I18n::chooseLanguage(code);
|
if (GMLIB_Level::getInstance()) {
|
||||||
|
I18n::chooseLanguage(code);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string {
|
RemoteCall::exportAs("GMLIB_API", "getResourcePackI18nLanguage", []() -> std::string {
|
||||||
return I18n::getCurrentLanguage()->getFullLanguageCode();
|
if (GMLIB_Level::getInstance()) {
|
||||||
|
return I18n::getCurrentLanguage()->getFullLanguageCode();
|
||||||
|
}
|
||||||
|
return "unknown";
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getPlayerPosition", [](std::string uuid) -> std::pair<BlockPos, int> {
|
RemoteCall::exportAs("GMLIB_API", "getPlayerPosition", [](std::string uuid) -> std::pair<BlockPos, int> {
|
||||||
auto uid = mce::UUID::fromString(uuid);
|
auto uid = mce::UUID::fromString(uuid);
|
||||||
|
|||||||
Reference in New Issue
Block a user