Files
MinecraftConsoles/Minecraft.World/SmoothStoneBrickTile.cpp
ModMaker101 a9be52c41a Project modernization (#630)
* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
2026-03-08 09:56:03 +07:00

45 lines
1.3 KiB
C++

#include "stdafx.h"
#include "SmoothStoneBrickTile.h"
#include "net.minecraft.world.h"
const wstring SmoothStoneBrickTile::TEXTURE_NAMES[] = {L"", L"mossy", L"cracked", L"carved"};
const unsigned int SmoothStoneBrickTile::SMOOTH_STONE_BRICK_NAMES[SMOOTH_STONE_BRICK_NAMES_LENGTH] = { IDS_TILE_STONE_BRICK_SMOOTH,
IDS_TILE_STONE_BRICK_SMOOTH_MOSSY,
IDS_TILE_STONE_BRICK_SMOOTH_CRACKED,
IDS_TILE_STONE_BRICK_SMOOTH_CHISELED
};
SmoothStoneBrickTile::SmoothStoneBrickTile(int id) : Tile(id, Material::stone)
{
icons = nullptr;
}
Icon *SmoothStoneBrickTile::getTexture(int face, int data)
{
if (data < 0 || data >= SMOOTH_STONE_BRICK_NAMES_LENGTH) data = 0;
return icons[data];
}
int SmoothStoneBrickTile::getSpawnResourcesAuxValue(int data)
{
return data;
}
unsigned int SmoothStoneBrickTile::getDescriptionId(int iData /*= -1*/)
{
if(iData < 0 ) iData = 0;
return SmoothStoneBrickTile::SMOOTH_STONE_BRICK_NAMES[iData];
}
void SmoothStoneBrickTile::registerIcons(IconRegister *iconRegister)
{
icons = new Icon*[SMOOTH_STONE_BRICK_NAMES_LENGTH];
for (int i = 0; i < SMOOTH_STONE_BRICK_NAMES_LENGTH; i++)
{
wstring name = getIconName();
if (!TEXTURE_NAMES[i].empty() ) name += L"_" + TEXTURE_NAMES[i];
icons[i] = iconRegister->registerIcon(name);
}
}