导出canDestroy,playerDestroy,canDestroyInCreative,canDestroySpecial接口
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#include "Global.h"
|
||||
#include "mc/world/Pos.h"
|
||||
#include "mc/world/level/BlockPos.h"
|
||||
#include "mc/world/level/BlockSource.h"
|
||||
#include <regex>
|
||||
|
||||
bool isInteger(const std::string& str) {
|
||||
@@ -636,4 +639,20 @@ void Export_Compatibility_API() {
|
||||
RemoteCall::exportAs("GMLIB_API", "getDestroyBlockSpeed", [](ItemStack const* item, Block const* block) -> float {
|
||||
return item->getDestroySpeed(*block);
|
||||
});
|
||||
RemoteCall::exportAs(
|
||||
"GMLIB_API",
|
||||
"playerDestroyBlock",
|
||||
[](Block const* block, std::pair<BlockPos, int> pos, Player* player) -> void {
|
||||
return block->playerDestroy(*player, pos.first);
|
||||
}
|
||||
);
|
||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyBlock", [](ItemStack const* item, Block const* block) -> bool {
|
||||
return item->canDestroy(block);
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyInCreative", [](ItemStack const* item) -> bool {
|
||||
return item->getItem()->canDestroyInCreative();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroySpecial", [](ItemStack const* item, Block const* block) -> bool {
|
||||
return item->canDestroySpecial(*block);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user