Files
MinecraftConsoles/Minecraft.World/WoodSlabTile.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

60 lines
1.4 KiB
C++

#include "stdafx.h"
#include "WoodSlabTile.h"
#include "woodtile.h"
#include "treetile.h"
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.level.biome.h"
#include "net.minecraft.world.item.h"
#include "net.minecraft.stats.h"
const unsigned int WoodSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { IDS_TILE_STONESLAB_OAK,
IDS_TILE_STONESLAB_SPRUCE,
IDS_TILE_STONESLAB_BIRCH,
IDS_TILE_STONESLAB_JUNGLE,
};
// public static final String[] WOOD_NAMES = {
// "oak", "spruce", "birch", "jungle"
// };
WoodSlabTile::WoodSlabTile(int id, bool fullSize) : HalfSlabTile(id, fullSize, Material::wood)
{
}
Icon *WoodSlabTile::getTexture(int face, int data)
{
return Tile::wood->getTexture(face, data & TYPE_MASK);
}
int WoodSlabTile::getResource(int data, Random *random, int playerBonusLevel)
{
return Tile::woodSlabHalf_Id;
}
shared_ptr<ItemInstance> WoodSlabTile::getSilkTouchItemInstance(int data)
{
return std::make_shared<ItemInstance>(Tile::woodSlabHalf, 2, data & TYPE_MASK);
}
int WoodSlabTile::getAuxName(int auxValue)
{
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
{
auxValue = 0;
}
return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue];
}
void WoodSlabTile::registerIcons(IconRegister *iconRegister)
{
// None
}
unsigned int WoodSlabTile::getDescriptionId(int iData)
{
if (iData < 0 || iData >= SLAB_NAMES_LENGTH)
{
iData = 0;
}
return SLAB_NAMES[iData];
}