导出canDestroy,playerDestroy,canDestroyInCreative,canDestroySpecial接口

This commit is contained in:
子沐呀
2024-05-28 17:36:43 +08:00
Unverified
parent 8f9447bcdb
commit 78721df3f0
2 changed files with 40 additions and 1 deletions
+21 -1
View File
@@ -117,7 +117,11 @@ const GMLIB_API = {
readNbtFromFile: ll.import("GMLIB_API", "readNbtFromFile"),
saveNbtToFile: ll.import("GMLIB_API", "saveNbtToFile"),
getBlockDestroySpeed: ll.import("GMLIB_API", "getBlockDestroySpeed"),
getDestroyBlockSpeed: ll.import("GMLIB_API", "getDestroyBlockSpeed")
getDestroyBlockSpeed: ll.import("GMLIB_API", "getDestroyBlockSpeed"),
playerDestroyBlock: ll.import("GMLIB_API", "playerDestroyBlock"),
itemCanDestroyBlock: ll.import("GMLIB_API", "itemCanDestroyBlock"),
itemCanDestroyInCreative: ll.import("GMLIB_API", "itemCanDestroyInCreative"),
itemCanDestroySpecial: ll.import("GMLIB_API", "itemCanDestroySpecial")
}
const FloatingTextList = [];
@@ -973,6 +977,22 @@ LLSE_Item.prototype.getDestroyBlockSpeed = function (block) {
return GMLIB_API.getDestroyBlockSpeed(this, block);
}
LLSE_Block.prototype.playerDestroy = function (player) {
GMLIB_API.playerDestroyBlock(this, this.pos, player);
}
LLSE_Item.prototype.canDestroy = function (block) {
return GMLIB_API.itemCanDestroyBlock(this, block);
}
LLSE_Item.prototype.canDestroyInCreative = function () {
return GMLIB_API.itemCanDestroyInCreative(this);
}
LLSE_Item.prototype.canDestroySpecial = function (block) {
return GMLIB_API.itemCanDestroySpecial(this, block);
}
module.exports = {
StaticFloatingText,
DynamicFloatingText,