the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.world.item.h"
3#include "net.minecraft.world.level.h"
4#include "net.minecraft.world.h"
5#include "PotatoTile.h"
6
7PotatoTile::PotatoTile(int id) : CropTile(id)
8{
9}
10
11Icon *PotatoTile::getTexture(int face, int data)
12{
13 if (data < 7)
14 {
15 if (data == 6)
16 {
17 data = 5;
18 }
19 return icons[data >> 1];
20 }
21 else
22 {
23 return icons[3];
24 }
25}
26
27int PotatoTile::getBaseSeedId()
28{
29 return Item::potato_Id;
30}
31
32int PotatoTile::getBasePlantId()
33{
34 return Item::potato_Id;
35}
36
37void PotatoTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus)
38{
39 CropTile::spawnResources(level, x, y, z, data, odds, playerBonus);
40
41 if (level->isClientSide)
42 {
43 return;
44 }
45 if (data >= 7)
46 {
47 if (level->random->nextInt(50) == 0)
48 {
49 popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(Item::potatoPoisonous)));
50 }
51 }
52}
53
54void PotatoTile::registerIcons(IconRegister *iconRegister)
55{
56 for (int i = 0; i < 4; i++)
57 {
58 icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + _toString<int>(i) );
59 }
60}