the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "Tile_SPU.h"
4
5class FallingTile;
6
7class AnvilTile_SPU : public Tile_SPU
8{
9public:
10 static const int PART_BASE = 0;
11 static const int PART_JOINT = 1;
12 static const int PART_COLUMN = 2;
13 static const int PART_TOP = 3;
14
15 static const int ANVIL_NAMES_LENGTH = 3;
16
17
18// public:
19 //int part;
20
21 AnvilTile_SPU(int id) : Tile_SPU(id) {}
22
23public:
24 bool isCubeShaped() { return false; }
25 bool isSolidRender(bool isServerLevel = false) { return false; }
26 Icon_SPU *getTexture(int face, int data)
27 {
28 if (ms_pTileData->anvilPart == PART_TOP && face == Facing::UP)
29 {
30 int damage = (data >> 2) % ANVIL_NAMES_LENGTH;
31 return &ms_pTileData->anvil_icons[damage];
32 }
33 return icon();
34 }
35 int getRenderShape() { return Tile_SPU::SHAPE_ANVIL; }
36 void updateShape(ChunkRebuildData *level, int x, int y, int z)
37 {
38 int dir = level->getData(x, y, z) & 3;
39 if (dir == Direction::EAST || dir == Direction::WEST)
40 {
41 setShape(0, 0, 2 / 16.0f, 1, 1, 1 - 2 / 16.0f);
42 }
43 else
44 {
45 setShape(2 / 16.0f, 0, 0, 1 - 2 / 16.0f, 1, 1);
46 }
47 }
48
49 bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face) { return true; }
50};