blob: 239ef61c4e8dbfa972601958ca273ffa12fdd955 (
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
|
#include "stdafx.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"
#include "net.minecraft.world.h"
const unsigned int WoodTile::WOOD_NAMES[WOOD_NAMES_LENGTH] = { IDS_TILE_OAKWOOD_PLANKS,
IDS_TILE_SPRUCEWOOD_PLANKS,
IDS_TILE_BIRCHWOOD_PLANKS,
IDS_TILE_JUNGLE_PLANKS,
};
const wstring WoodTile::TEXTURE_NAMES[] = {L"oak", L"spruce", L"birch", L"jungle"};
// public static final String[] WOOD_NAMES = {
// "oak", "spruce", "birch", "jungle"
// };
WoodTile::WoodTile(int id) : Tile(id, Material::wood)
{
icons = nullptr;
}
unsigned int WoodTile::getDescriptionId(int iData)
{
if(iData < 0 || iData >= WOOD_NAMES_LENGTH) iData = 0;
return WOOD_NAMES[iData];
}
Icon *WoodTile::getTexture(int face, int data)
{
if (data < 0 || data >= WOOD_NAMES_LENGTH)
{
data = 0;
}
return icons[data];
}
int WoodTile::getSpawnResourcesAuxValue(int data)
{
return data;
}
void WoodTile::registerIcons(IconRegister *iconRegister)
{
icons = new Icon*[WOOD_NAMES_LENGTH];
for (int i = 0; i < WOOD_NAMES_LENGTH; i++)
{
icons[i] = iconRegister->registerIcon(getIconName() + L"_" + TEXTURE_NAMES[i]);
}
}
|