From 119bff351450ea16ffda550b6e0f67379b29f708 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:37:16 +0700 Subject: Revert "shared_ptr -> std::shared_ptr" This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5. --- Minecraft.World/CraftingMenu.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/CraftingMenu.cpp') 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, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() +CraftingMenu::CraftingMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() { - craftSlots = std::shared_ptr( new CraftingContainer(this, 3, 3) ); - resultSlots = std::shared_ptr( new ResultContainer() ); + craftSlots = shared_ptr( new CraftingContainer(this, 3, 3) ); + resultSlots = shared_ptr( new ResultContainer() ); this->level = level; this->x = xt; @@ -51,19 +51,19 @@ CraftingMenu::CraftingMenu(std::shared_ptr inventory, Level *level, i slotsChanged(); // 4J - removed craftSlots parameter, see comment below } -void CraftingMenu::slotsChanged() // 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things +void CraftingMenu::slotsChanged() // 4J used to take a shared_ptr 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) +void CraftingMenu::removed(shared_ptr player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; for (int i = 0; i < 9; i++) { - std::shared_ptr item = craftSlots->removeItemNoUpdate(i); + shared_ptr item = craftSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -71,20 +71,20 @@ void CraftingMenu::removed(std::shared_ptr player) } } -bool CraftingMenu::stillValid(std::shared_ptr player) +bool CraftingMenu::stillValid(shared_ptr 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 CraftingMenu::quickMoveStack(std::shared_ptr player, int slotIndex) +shared_ptr CraftingMenu::quickMoveStack(shared_ptr player, int slotIndex) { - std::shared_ptr clicked = nullptr; + shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - std::shared_ptr stack = slot->getItem(); + shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) -- cgit v1.2.3