aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/EnchantmentMenu.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
commit119bff351450ea16ffda550b6e0f67379b29f708 (patch)
treed9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/EnchantmentMenu.cpp
parent8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff)
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/EnchantmentMenu.cpp')
-rw-r--r--Minecraft.World/EnchantmentMenu.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/Minecraft.World/EnchantmentMenu.cpp b/Minecraft.World/EnchantmentMenu.cpp
index d64abc47..23b366ce 100644
--- a/Minecraft.World/EnchantmentMenu.cpp
+++ b/Minecraft.World/EnchantmentMenu.cpp
@@ -7,9 +7,9 @@
#include "net.minecraft.world.item.enchantment.h"
#include "EnchantmentMenu.h"
-EnchantmentMenu::EnchantmentMenu(std::shared_ptr<Inventory> inventory, Level *level, int xt, int yt, int zt)
+EnchantmentMenu::EnchantmentMenu(shared_ptr<Inventory> inventory, Level *level, int xt, int yt, int zt)
{
- enchantSlots = std::shared_ptr<EnchantmentContainer>( new EnchantmentContainer(this) );
+ enchantSlots = shared_ptr<EnchantmentContainer>( new EnchantmentContainer(this) );
for(int i = 0; i < 3; ++i)
{
@@ -77,9 +77,9 @@ void EnchantmentMenu::setData(int id, int value)
}
}
-void EnchantmentMenu::slotsChanged() // 4J used to take a std::shared_ptr<Container> container but wasn't using it, so removed to simplify things
+void EnchantmentMenu::slotsChanged() // 4J used to take a shared_ptr<Container> container but wasn't using it, so removed to simplify things
{
- std::shared_ptr<ItemInstance> item = enchantSlots->getItem(0);
+ shared_ptr<ItemInstance> item = enchantSlots->getItem(0);
if (item == NULL || !item->isEnchantable())
{
@@ -150,9 +150,9 @@ void EnchantmentMenu::slotsChanged() // 4J used to take a std::shared_ptr<Contai
}
}
-bool EnchantmentMenu::clickMenuButton(std::shared_ptr<Player> player, int i)
+bool EnchantmentMenu::clickMenuButton(shared_ptr<Player> player, int i)
{
- std::shared_ptr<ItemInstance> item = enchantSlots->getItem(0);
+ shared_ptr<ItemInstance> item = enchantSlots->getItem(0);
if (costs[i] > 0 && item != NULL && (player->experienceLevel >= costs[i] || player->abilities.instabuild) )
{
if (!level->isClientSide)
@@ -194,34 +194,34 @@ bool EnchantmentMenu::clickMenuButton(std::shared_ptr<Player> player, int i)
}
-void EnchantmentMenu::removed(std::shared_ptr<Player> player)
+void EnchantmentMenu::removed(shared_ptr<Player> player)
{
AbstractContainerMenu::removed(player);
if (level->isClientSide) return;
- std::shared_ptr<ItemInstance> item = enchantSlots->removeItemNoUpdate(0);
+ shared_ptr<ItemInstance> item = enchantSlots->removeItemNoUpdate(0);
if (item != NULL)
{
player->drop(item);
}
}
-bool EnchantmentMenu::stillValid(std::shared_ptr<Player> player)
+bool EnchantmentMenu::stillValid(shared_ptr<Player> player)
{
if (level->getTile(x, y, z) != Tile::enchantTable_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> EnchantmentMenu::quickMoveStack(std::shared_ptr<Player> player, int slotIndex)
+shared_ptr<ItemInstance> EnchantmentMenu::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);
if (slot != NULL && slot->hasItem())
{
- std::shared_ptr<ItemInstance> stack = slot->getItem();
+ shared_ptr<ItemInstance> stack = slot->getItem();
clicked = stack->copy();
if (slotIndex == INGREDIENT_SLOT)
@@ -238,8 +238,8 @@ std::shared_ptr<ItemInstance> EnchantmentMenu::quickMoveStack(std::shared_ptr<Pl
else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END)
{
// if the item is an enchantable tool
-
- if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) )
+
+ if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) )
{
if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false))
{
@@ -258,7 +258,7 @@ std::shared_ptr<ItemInstance> EnchantmentMenu::quickMoveStack(std::shared_ptr<Pl
{
// if the item is an enchantable tool
- if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) )
+ if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) )
{
if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false))
{