aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/WoodSlabTile.cpp
blob: 574dab932d57fb23969a1ba8d58ba77b89e8171c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#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];
}