导出canDropWithAnyTool接口和删除多余include
This commit is contained in:
+6
-1
@@ -121,7 +121,8 @@ const GMLIB_API = {
|
|||||||
playerDestroyBlock: ll.import("GMLIB_API", "playerDestroyBlock"),
|
playerDestroyBlock: ll.import("GMLIB_API", "playerDestroyBlock"),
|
||||||
itemCanDestroyBlock: ll.import("GMLIB_API", "itemCanDestroyBlock"),
|
itemCanDestroyBlock: ll.import("GMLIB_API", "itemCanDestroyBlock"),
|
||||||
itemCanDestroyInCreative: ll.import("GMLIB_API", "itemCanDestroyInCreative"),
|
itemCanDestroyInCreative: ll.import("GMLIB_API", "itemCanDestroyInCreative"),
|
||||||
itemCanDestroySpecial: ll.import("GMLIB_API", "itemCanDestroySpecial")
|
itemCanDestroySpecial: ll.import("GMLIB_API", "itemCanDestroySpecial"),
|
||||||
|
blockCanDropWithAnyTool: ll.import("GMLIB_API", "blockCanDropWithAnyTool")
|
||||||
}
|
}
|
||||||
|
|
||||||
const FloatingTextList = [];
|
const FloatingTextList = [];
|
||||||
@@ -993,6 +994,10 @@ LLSE_Item.prototype.canDestroySpecial = function (block) {
|
|||||||
return GMLIB_API.itemCanDestroySpecial(this, block);
|
return GMLIB_API.itemCanDestroySpecial(this, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLSE_Block.prototype.canDropWithAnyTool = function () {
|
||||||
|
return GMLIB_API.blockCanDropWithAnyTool(this);
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
StaticFloatingText,
|
StaticFloatingText,
|
||||||
DynamicFloatingText,
|
DynamicFloatingText,
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
#include "mc/world/Pos.h"
|
|
||||||
#include "mc/world/level/BlockPos.h"
|
|
||||||
#include "mc/world/level/BlockSource.h"
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
bool isInteger(const std::string& str) {
|
bool isInteger(const std::string& str) {
|
||||||
@@ -655,4 +652,7 @@ void Export_Compatibility_API() {
|
|||||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroySpecial", [](ItemStack const* item, Block const* block) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "itemCanDestroySpecial", [](ItemStack const* item, Block const* block) -> bool {
|
||||||
return item->canDestroySpecial(*block);
|
return item->canDestroySpecial(*block);
|
||||||
});
|
});
|
||||||
|
RemoteCall::exportAs("GMLIB_API", "blockCanDropWithAnyTool", [](Block const* block) -> bool {
|
||||||
|
return block->canDropWithAnyTool();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user