Fix bucket pickup with scale-aware aiming and build-local Botcraft patches

This commit is contained in:
cantyonion committed 2026-11-24 15:31:16 +08:00
1 parent 0a6193f68e
commit 12c7332337
10 files changed
+416 -40

No files matched your search

+23
View File
@@ -2,6 +2,7 @@
#include <gtest/gtest.h>
#include "botcraft/Game/AssetsManager.hpp"
#include "botcraft/Game/Inventory/InventoryManager.hpp"
#include "botcraft/Game/Inventory/Window.hpp"
@@ -44,6 +45,28 @@ class InventorySync : public testing::Test
}
};
TEST_F(InventorySync, FilledBucketConfirmationCountsServerUpdatesAcrossInventory)
{
Full();
auto &assets = Botcraft::AssetsManager::getInstance();
auto emptyBuckets = Item(2);
emptyBuckets.SetItemId(assets.GetItemID("minecraft:bucket"));
auto filled = Item(1);
filled.SetItemId(assets.GetItemID("minecraft:water_bucket"));
PlayerSlot(0, emptyBuckets);
PlayerSlot(1, filled);
const auto window = inventory.GetPlayerInventory();
const auto before = Bilicraft::CountWaterBuckets(*window);
ASSERT_EQ(before, 1);
emptyBuckets.SetItemCount(1);
PlayerSlot(0, emptyBuckets);
EXPECT_EQ(Bilicraft::CountWaterBuckets(*window), before);
PlayerSlot(9, filled);
EXPECT_EQ(Bilicraft::CountWaterBuckets(*window), before + 1);
PlayerSlot(0, filled);
EXPECT_EQ(Bilicraft::CountWaterBuckets(*window), before + 2);
}
TEST_F(InventorySync, EmptyHotbarUpdateClearsHeldItemInsteadOfCraftingOutput)
{
Full();