diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
| commit | 119bff351450ea16ffda550b6e0f67379b29f708 (patch) | |
| tree | d9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/CraftingMenu.cpp | |
| parent | 8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff) | |
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/CraftingMenu.cpp')
| -rw-r--r-- | Minecraft.World/CraftingMenu.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/CraftingMenu.cpp b/Minecraft.World/CraftingMenu.cpp index 3a144a5d..eeb2a6e3 100644 --- a/Minecraft.World/CraftingMenu.cpp +++ b/Minecraft.World/CraftingMenu.cpp @@ -17,10 +17,10 @@ const int CraftingMenu::INV_SLOT_END = CraftingMenu::INV_SLOT_START + 9 * 3; const int CraftingMenu::USE_ROW_SLOT_START = CraftingMenu::INV_SLOT_END; const int CraftingMenu::USE_ROW_SLOT_END = CraftingMenu::USE_ROW_SLOT_START + 9; -CraftingMenu::CraftingMenu(std::shared_ptr<Inventory> inventory, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() +CraftingMenu::CraftingMenu(shared_ptr<Inventory> inventory, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() { - craftSlots = std::shared_ptr<CraftingContainer>( new CraftingContainer(this, 3, 3) ); - resultSlots = std::shared_ptr<ResultContainer>( new ResultContainer() ); + craftSlots = shared_ptr<CraftingContainer>( new CraftingContainer(this, 3, 3) ); + resultSlots = shared_ptr<ResultContainer>( new ResultContainer() ); this->level = level; this->x = xt; @@ -51,19 +51,19 @@ CraftingMenu::CraftingMenu(std::shared_ptr<Inventory> inventory, Level *level, i slotsChanged(); // 4J - removed craftSlots parameter, see comment below } -void CraftingMenu::slotsChanged() // 4J used to take a std::shared_ptr<Container> but wasn't using it, so removed to simplify things +void CraftingMenu::slotsChanged() // 4J used to take a shared_ptr<Container> but wasn't using it, so removed to simplify things { resultSlots->setItem(0, Recipes::getInstance()->getItemFor(craftSlots, level)); } -void CraftingMenu::removed(std::shared_ptr<Player> player) +void CraftingMenu::removed(shared_ptr<Player> player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; for (int i = 0; i < 9; i++) { - std::shared_ptr<ItemInstance> item = craftSlots->removeItemNoUpdate(i); + shared_ptr<ItemInstance> item = craftSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -71,20 +71,20 @@ void CraftingMenu::removed(std::shared_ptr<Player> player) } } -bool CraftingMenu::stillValid(std::shared_ptr<Player> player) +bool CraftingMenu::stillValid(shared_ptr<Player> player) { if (level->getTile(x, y, z) != Tile::workBench_Id) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -std::shared_ptr<ItemInstance> CraftingMenu::quickMoveStack(std::shared_ptr<Player> player, int slotIndex) +shared_ptr<ItemInstance> CraftingMenu::quickMoveStack(shared_ptr<Player> player, int slotIndex) { - std::shared_ptr<ItemInstance> clicked = nullptr; + shared_ptr<ItemInstance> clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - std::shared_ptr<ItemInstance> stack = slot->getItem(); + shared_ptr<ItemInstance> stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) |
