添加getItemMaxCount接口

This commit is contained in:
子沐呀
2024-07-29 14:34:40 +08:00
Unverified
parent 3b8a463b62
commit a01ba9655d
3 changed files with 20 additions and 2 deletions
+4 -1
View File
@@ -870,7 +870,7 @@ void Export_Compatibility_API() {
RemoteCall::exportAs(
"GMLIB_API",
"sendInventorySlotPacket",
[](Player* player, int containerId, int slot, ItemStack* item) -> void {
[](Player* player, int containerId, int slot, ItemStack const* item) -> void {
InventorySlotPacket((ContainerID)containerId, slot, *item).sendTo(*player);
}
);
@@ -881,4 +881,7 @@ void Export_Compatibility_API() {
auto uid = mce::UUID::fromString(uuid);
return GMLIB_Player::getPlayerNbt(uid) ? true : false;
});
RemoteCall::exportAs("GMLIB_API", "getItemMaxCount", [](ItemStack const* item) -> int {
return item->getMaxStackSize();
});
}