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/BrewingStandMenu.cpp | |
| parent | 8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff) | |
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/BrewingStandMenu.cpp')
| -rw-r--r-- | Minecraft.World/BrewingStandMenu.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Minecraft.World/BrewingStandMenu.cpp b/Minecraft.World/BrewingStandMenu.cpp index 196b9bf8..af1fac5c 100644 --- a/Minecraft.World/BrewingStandMenu.cpp +++ b/Minecraft.World/BrewingStandMenu.cpp @@ -6,7 +6,7 @@ #include "net.minecraft.stats.h" #include "BrewingStandMenu.h" -BrewingStandMenu::BrewingStandMenu(std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand) +BrewingStandMenu::BrewingStandMenu(shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand) { tc = 0; @@ -57,14 +57,14 @@ void BrewingStandMenu::setData(int id, int value) if (id == 0) brewingStand->setBrewTime(value); } -bool BrewingStandMenu::stillValid(std::shared_ptr<Player> player) +bool BrewingStandMenu::stillValid(shared_ptr<Player> player) { return brewingStand->stillValid(player); } -std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<Player> player, int slotIndex) +shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(shared_ptr<Player> player, int slotIndex) { - std::shared_ptr<ItemInstance> clicked = nullptr; + shared_ptr<ItemInstance> clicked = nullptr; Slot *slot = slots->at(slotIndex); Slot *IngredientSlot = slots->at(INGREDIENT_SLOT); Slot *PotionSlot1 = slots->at(BOTTLE_SLOT_START); @@ -73,7 +73,7 @@ std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<P if (slot != NULL && slot->hasItem()) { - std::shared_ptr<ItemInstance> stack = slot->getItem(); + shared_ptr<ItemInstance> stack = slot->getItem(); clicked = stack->copy(); if ((slotIndex >= BOTTLE_SLOT_START && slotIndex <= BOTTLE_SLOT_END) || (slotIndex == INGREDIENT_SLOT)) @@ -101,7 +101,7 @@ std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<P else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END) { // 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot - if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id) ) && + if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id) ) && (!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) ) ) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) @@ -125,7 +125,7 @@ std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<P else if (slotIndex >= USE_ROW_SLOT_START && slotIndex < USE_ROW_SLOT_END) { // 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot - if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id)) && + if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id)) && (!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) )) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) @@ -140,7 +140,7 @@ std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<P { return nullptr; } - } + } else if (!moveItemStackTo(stack, INV_SLOT_START, INV_SLOT_END, false)) { return nullptr; @@ -173,12 +173,12 @@ std::shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(std::shared_ptr<P return clicked; } -BrewingStandMenu::PotionSlot::PotionSlot(std::shared_ptr<Player> player, std::shared_ptr<Container> container, int slot, int x, int y) : Slot(container, slot, x, y) +BrewingStandMenu::PotionSlot::PotionSlot(shared_ptr<Player> player, shared_ptr<Container> container, int slot, int x, int y) : Slot(container, slot, x, y) { this->player = player; } -bool BrewingStandMenu::PotionSlot::mayPlace(std::shared_ptr<ItemInstance> item) +bool BrewingStandMenu::PotionSlot::mayPlace(shared_ptr<ItemInstance> item) { return mayPlaceItem(item); } @@ -188,7 +188,7 @@ int BrewingStandMenu::PotionSlot::getMaxStackSize() return 1; } -void BrewingStandMenu::PotionSlot::onTake(std::shared_ptr<Player> player, std::shared_ptr<ItemInstance> carried) +void BrewingStandMenu::PotionSlot::onTake(shared_ptr<Player> player, shared_ptr<ItemInstance> carried) { carried->onCraftedBy(this->player->level, dynamic_pointer_cast<Player>( this->player->shared_from_this() ), 1); if (carried->id == Item::potion_Id && carried->getAuxValue() > 0) @@ -196,23 +196,23 @@ void BrewingStandMenu::PotionSlot::onTake(std::shared_ptr<Player> player, std::s Slot::onTake(player, carried); } -bool BrewingStandMenu::PotionSlot::mayCombine(std::shared_ptr<ItemInstance> second) +bool BrewingStandMenu::PotionSlot::mayCombine(shared_ptr<ItemInstance> second) { return false; } -bool BrewingStandMenu::PotionSlot::mayPlaceItem(std::shared_ptr<ItemInstance> item) +bool BrewingStandMenu::PotionSlot::mayPlaceItem(shared_ptr<ItemInstance> item) { return item != NULL && (item->id == Item::potion_Id || item->id == Item::glassBottle_Id); } -BrewingStandMenu::IngredientsSlot::IngredientsSlot(std::shared_ptr<Container> container, int slot, int x, int y) : Slot(container, slot, x ,y) +BrewingStandMenu::IngredientsSlot::IngredientsSlot(shared_ptr<Container> container, int slot, int x, int y) : Slot(container, slot, x ,y) { } -bool BrewingStandMenu::IngredientsSlot::mayPlace(std::shared_ptr<ItemInstance> item) +bool BrewingStandMenu::IngredientsSlot::mayPlace(shared_ptr<ItemInstance> item) { if (item != NULL) { @@ -228,7 +228,7 @@ bool BrewingStandMenu::IngredientsSlot::mayPlace(std::shared_ptr<ItemInstance> i return false; } -bool BrewingStandMenu::IngredientsSlot::mayCombine(std::shared_ptr<ItemInstance> second) +bool BrewingStandMenu::IngredientsSlot::mayCombine(shared_ptr<ItemInstance> second) { return false; } |
