aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/WeighedTreasure.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/WeighedTreasure.cpp
parent8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff)
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/WeighedTreasure.cpp')
-rw-r--r--Minecraft.World/WeighedTreasure.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/WeighedTreasure.cpp b/Minecraft.World/WeighedTreasure.cpp
index 540727e3..d7044644 100644
--- a/Minecraft.World/WeighedTreasure.cpp
+++ b/Minecraft.World/WeighedTreasure.cpp
@@ -6,19 +6,19 @@
WeighedTreasure::WeighedTreasure(int itemId, int auxValue, int minCount, int maxCount, int weight) : WeighedRandomItem(weight)
{
- this->item = std::shared_ptr<ItemInstance>( new ItemInstance(itemId, 1, auxValue) );
+ this->item = shared_ptr<ItemInstance>( new ItemInstance(itemId, 1, auxValue) );
this->minCount = minCount;
this->maxCount = maxCount;
}
-WeighedTreasure::WeighedTreasure(std::shared_ptr<ItemInstance> item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight)
+WeighedTreasure::WeighedTreasure(shared_ptr<ItemInstance> item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight)
{
this->item = item;
this->minCount = minCount;
this->maxCount = maxCount;
}
-void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, std::shared_ptr<ChestTileEntity> dest, int numRolls)
+void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, shared_ptr<ChestTileEntity> dest, int numRolls)
{
for (int r = 0; r < numRolls; r++)
{
@@ -27,7 +27,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items,
int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1);
if (treasure->item->getMaxStackSize() >= count)
{
- std::shared_ptr<ItemInstance> copy = treasure->item->copy();
+ shared_ptr<ItemInstance> copy = treasure->item->copy();
copy->count = count;
dest->setItem(random->nextInt(dest->getContainerSize()), copy);
}
@@ -36,7 +36,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items,
// use multiple slots
for (int c = 0; c < count; c++)
{
- std::shared_ptr<ItemInstance> copy = treasure->item->copy();
+ shared_ptr<ItemInstance> copy = treasure->item->copy();
copy->count = 1;
dest->setItem(random->nextInt(dest->getContainerSize()), copy);
}
@@ -44,7 +44,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items,
}
}
-void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, std::shared_ptr<DispenserTileEntity> dest, int numRolls)
+void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, shared_ptr<DispenserTileEntity> dest, int numRolls)
{
for (int r = 0; r < numRolls; r++)
{
@@ -53,7 +53,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite
int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1);
if (treasure->item->getMaxStackSize() >= count)
{
- std::shared_ptr<ItemInstance> copy = treasure->item->copy();
+ shared_ptr<ItemInstance> copy = treasure->item->copy();
copy->count = count;
dest->setItem(random->nextInt(dest->getContainerSize()), copy);
}
@@ -62,7 +62,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite
// use multiple slots
for (int c = 0; c < count; c++)
{
- std::shared_ptr<ItemInstance> copy = treasure->item->copy();
+ shared_ptr<ItemInstance> copy = treasure->item->copy();
copy->count = 1;
dest->setItem(random->nextInt(dest->getContainerSize()), copy);
}