adapt: adapt GMLIB v0.12.7
This commit is contained in:
+38
-1
@@ -110,7 +110,12 @@ const GMLIB_API = {
|
||||
addFakeList: ll.import("GMLIB_API", "addFakeList"),
|
||||
removeFakeList: ll.import("GMLIB_API", "removeFakeList"),
|
||||
removeAllFakeLists: ll.import("GMLIB_API", "removeAllFakeList"),
|
||||
setFixI18nEnabled: ll.import("GMLib_ModAPI", "setFixI18nEnabled")
|
||||
setFixI18nEnabled: ll.import("GMLib_ModAPI", "setFixI18nEnabled"),
|
||||
getBlockTranslateKey: ll.import("GMLIB_API", "getBlockTranslateKey"),
|
||||
getItemTranslateKey: ll.import("GMLIB_API", "getItemTranslateKey"),
|
||||
getEntityTranslateKey: ll.import("GMLIB_API", "getEntityTranslateKey"),
|
||||
readNbtFromFile: ll.import("GMLIB_API", "readNbtFromFile"),
|
||||
saveNbtToFile: ll.import("GMLIB_API", "saveNbtToFile")
|
||||
}
|
||||
|
||||
const FloatingTextList = [];
|
||||
@@ -427,6 +432,14 @@ class Minecraft {
|
||||
static setFixI18nEnabled() {
|
||||
GMLIB_API.setFixI18nEnabled();
|
||||
}
|
||||
|
||||
static saveNbtToFile(path, nbt, isBinary = true) {
|
||||
return GMLIB_API.saveNbtToFile(path, nbt, isBinary);
|
||||
}
|
||||
|
||||
static readNbtFromFile(path, isBinary = true) {
|
||||
return GMLIB_API.readNbtFromFile(path, isBinary);
|
||||
}
|
||||
}
|
||||
|
||||
class Recipes {
|
||||
@@ -926,6 +939,30 @@ LLSE_Entity.prototype.throwEntity = function (proj, speed = 2, offset = 3) {
|
||||
return GMLIB_API.throwEntity(this, proj, speed, offset);
|
||||
}
|
||||
|
||||
LLSE_Entity.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getEntityTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Entity.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
LLSE_Block.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getBlockTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Block.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getTranslateKey = function () {
|
||||
return GMLIB_API.getItemTranslateKey(this);
|
||||
}
|
||||
|
||||
LLSE_Item.prototype.getTranslateName = function (language) {
|
||||
return I18nAPI.get(this.getTranslateKey(), [], language);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
StaticFloatingText,
|
||||
DynamicFloatingText,
|
||||
|
||||
Reference in New Issue
Block a user