mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 04:03:37 +00:00
32 lines
827 B
C++
32 lines
827 B
C++
#include "CarrotTile.h"
|
|
|
|
#include <string>
|
|
|
|
#include "util/StringHelpers.h"
|
|
#include "minecraft/world/IconRegister.h"
|
|
#include "minecraft/world/item/Item.h"
|
|
#include "minecraft/world/level/tile/CropTile.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::carrots_Id; }
|
|
|
|
int CarrotTile::getBasePlantId() { return Item::carrots_Id; }
|
|
|
|
void CarrotTile::registerIcons(IconRegister* iconRegister) {
|
|
for (int i = 0; i < 4; i++) {
|
|
icons[i] = iconRegister->registerIcon(getIconName() + "_stage_" +
|
|
toWString(i));
|
|
}
|
|
} |