refactor: unglob std::shared_ptr

This commit is contained in:
Tropical
2026-03-06 11:20:45 -06:00
parent 0dd1654dec
commit 67ceccf2d4
1065 changed files with 5754 additions and 5749 deletions

View File

@@ -108,18 +108,18 @@ Icon *DyePowderItem::getIcon(int itemAuxValue)
return icons[colorValue];
}
unsigned int DyePowderItem::getDescriptionId(shared_ptr<ItemInstance> itemInstance)
unsigned int DyePowderItem::getDescriptionId(std::shared_ptr<ItemInstance> itemInstance)
{
int colorValue = Mth::clamp(itemInstance->getAuxValue(), 0, 15);
return COLOR_DESCS[colorValue];
}
unsigned int DyePowderItem::getUseDescriptionId(shared_ptr<ItemInstance> itemInstance)
unsigned int DyePowderItem::getUseDescriptionId(std::shared_ptr<ItemInstance> itemInstance)
{
return COLOR_USE_DESCS[itemInstance->getAuxValue()];
}
bool DyePowderItem::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
bool DyePowderItem::useOn(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
{
if (!player->mayBuild(x, y, z)) return false;
@@ -289,11 +289,11 @@ mainloop: continue;
return false;
}
bool DyePowderItem::interactEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Mob> mob)
bool DyePowderItem::interactEnemy(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Mob> mob)
{
if (dynamic_pointer_cast<Sheep>( mob ) != NULL)
{
shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(mob);
std::shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(mob);
// convert to tile-based color value (0 is white instead of black)
int newColor = ClothTile::getTileDataForItemAuxValue(itemInstance->getAuxValue());
if (!sheep->isSheared() && sheep->getColor() != newColor)