Files
neoLegacy/Minecraft.World/CarrotTile.cpp
T

49 lines
770 B
C++

#include "stdafx.h"
#include "net.minecraft.world.h"
#include "net.minecraft.world.item.h"
#include "CarrotTile.h"
CarrotTile::CarrotTile(int id) : CropTile(id)
{
}
Icon *CarrotTile::getTexture(int face, int data)
{
if (data < 7)
{
if (data == 6)
{
data = 5;
}
return icons[data >> 1];
}
else
{
return icons[3];
}
}
int CarrotTile::getBaseSeedId()
{
return Item::carrot_Id;
}
int CarrotTile::getBasePlantId()
{
return Item::carrot_Id;
}
void CarrotTile::registerIcons(IconRegister *iconRegister)
{
for (int i = 0; i < 4; i++)
{
icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i));
}
}
float CarrotTile::getShapeHeight(int age)
{
if (age < 0) age = 0;
if (age > 7) age = 7;
return (age + 2) / 16.0f;
}