导出isAlwaysDestroyable

This commit is contained in:
子沐呀
2024-05-30 19:44:39 +08:00
Unverified
parent ade132c8b2
commit 28be308aba
2 changed files with 9 additions and 1 deletions
+6 -1
View File
@@ -122,7 +122,8 @@ const GMLIB_API = {
itemCanDestroyBlock: ll.import("GMLIB_API", "itemCanDestroyBlock"),
itemCanDestroyInCreative: ll.import("GMLIB_API", "itemCanDestroyInCreative"),
itemCanDestroySpecial: ll.import("GMLIB_API", "itemCanDestroySpecial"),
blockCanDropWithAnyTool: ll.import("GMLIB_API", "blockCanDropWithAnyTool")
blockCanDropWithAnyTool: ll.import("GMLIB_API", "blockCanDropWithAnyTool"),
blockIsAlwaysDestroyable: ll.import("GMLIB_API", "blockIsAlwaysDestroyable")
}
const FloatingTextList = [];
@@ -998,6 +999,10 @@ LLSE_Block.prototype.canDropWithAnyTool = function () {
return GMLIB_API.blockCanDropWithAnyTool(this);
}
LLSE_Block.prototype.isAlwaysDestroyable = function () {
return GMLIB_API.blockIsAlwaysDestroyable(this);
}
module.exports = {
StaticFloatingText,
DynamicFloatingText,
+3
View File
@@ -655,4 +655,7 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "blockCanDropWithAnyTool", [](Block const* block) -> bool {
return block->canDropWithAnyTool();
});
RemoteCall::exportAs("GMLIB_API", "blockIsAlwaysDestroyable", [](Block const* block) -> bool {
return block->getMaterial().isAlwaysDestroyable();
});
}