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.h"
3#include "RotatedPillarTile.h"
4
5RotatedPillarTile::RotatedPillarTile(int id, Material *material) : Tile(id, material)
6{
7}
8
9int RotatedPillarTile::getRenderShape()
10{
11 return Tile::SHAPE_TREE;
12}
13
14int RotatedPillarTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue)
15{
16 int type = itemValue & MASK_TYPE;
17 int facing = 0;
18
19 switch (face)
20 {
21 case Facing::NORTH:
22 case Facing::SOUTH:
23 facing = FACING_Z;
24 break;
25 case Facing::EAST:
26 case Facing::WEST:
27 facing = FACING_X;
28 break;
29 case Facing::UP:
30 case Facing::DOWN:
31 facing = FACING_Y;
32 break;
33 }
34
35 return type | facing;
36}
37
38Icon *RotatedPillarTile::getTexture(int face, int data)
39{
40 int dir = data & MASK_FACING;
41 int type = data & MASK_TYPE;
42
43 if (dir == FACING_Y && (face == Facing::UP || face == Facing::DOWN))
44 {
45 return getTopTexture(type);
46 }
47 else if (dir == FACING_X && (face == Facing::EAST || face == Facing::WEST))
48 {
49 return getTopTexture(type);
50 }
51 else if (dir == FACING_Z && (face == Facing::NORTH || face == Facing::SOUTH))
52 {
53 return getTopTexture(type);
54 }
55
56 return getTypeTexture(type);
57}
58
59Icon *RotatedPillarTile::getTopTexture(int type)
60{
61 return iconTop;
62}
63
64int RotatedPillarTile::getSpawnResourcesAuxValue(int data)
65{
66 return data & MASK_TYPE;
67}
68
69int RotatedPillarTile::getType(int data)
70{
71 return data & MASK_TYPE;
72}
73
74shared_ptr<ItemInstance> RotatedPillarTile::getSilkTouchItemInstance(int data)
75{
76 return shared_ptr<ItemInstance>( new ItemInstance(id, 1, getType(data)) );
77}