aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/SandStoneTile.cpp
blob: daf42db86deb91cfe80dc142ff6e361650254405 (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
#include "stdafx.h"
#include "net.minecraft.h"
#include "net.minecraft.world.level.material.h"
#include "net.minecraft.world.h"
#include "SandStoneTile.h"

const wstring SandStoneTile::TEXTURE_TOP = L"sandstone_top";
const wstring SandStoneTile::TEXTURE_BOTTOM = L"sandstone_bottom";
const wstring SandStoneTile::TEXTURE_NAMES[] = {L"sandstone_side", L"sandstone_carved", L"sandstone_smooth"};

int SandStoneTile::SANDSTONE_NAMES[SANDSTONE_BLOCK_NAMES] = {
	IDS_TILE_SANDSTONE, IDS_TILE_SANDSTONE_CHISELED, IDS_TILE_SANDSTONE_SMOOTH
};

SandStoneTile::SandStoneTile(int id) : Tile(id, Material::stone)
{
	icons = NULL;
	iconTop = NULL;
	iconBottom = NULL;
}

Icon *SandStoneTile::getTexture(int face, int data)
{
	if (face == Facing::UP || (face == Facing::DOWN && (data == TYPE_HEIROGLYPHS || data == TYPE_SMOOTHSIDE)))
	{
		return iconTop;
	}
	if (face == Facing::DOWN)
	{
		return iconBottom;
	}
	if (data < 0 || data >= SANDSTONE_TILE_TEXTURE_COUNT) data = 0;
	return icons[data];
}

int SandStoneTile::getSpawnResourcesAuxValue(int data)
{
	return data;
}

void SandStoneTile::registerIcons(IconRegister *iconRegister)
{
	icons = new Icon*[SANDSTONE_TILE_TEXTURE_COUNT];

	for (int i = 0; i < SANDSTONE_TILE_TEXTURE_COUNT; i++)
	{
		icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]);
	}

	iconTop = iconRegister->registerIcon(TEXTURE_TOP);
	iconBottom = iconRegister->registerIcon(TEXTURE_BOTTOM);
}