blob: 6c8c1712537f6f1a1b2ea13b8f1d06b613861819 (
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
|
#include "stdafx.h"
#include "net.minecraft.world.h"
#include "net.minecraft.world.item.h"
#include "ColoredTile.h"
ColoredTile::ColoredTile(int id, Material *material) : Tile(id, material)
{
}
Icon *ColoredTile::getTexture(int face, int data)
{
return icons[data % ICON_COUNT];
}
int ColoredTile::getSpawnResourcesAuxValue(int data)
{
return data;
}
int ColoredTile::getTileDataForItemAuxValue(int auxValue)
{
return (~auxValue & 0xf);
}
int ColoredTile::getItemAuxValueForTileData(int data)
{
return (~data & 0xf);
}
void ColoredTile::registerIcons(IconRegister *iconRegister)
{
for (int i = 0; i < ICON_COUNT; i++)
{
icons[i] = iconRegister->registerIcon(getIconName() + L"_" + DyePowderItem::COLOR_TEXTURES[getItemAuxValueForTileData(i)]);
}
}
|