the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "Tile_SPU.h"
3
4class FenceGateTile_SPU : public Tile_SPU
5{
6private:
7 static const int DIRECTION_MASK = 3;
8 static const int OPEN_BIT = 4;
9
10public:
11 FenceGateTile_SPU(int id) : Tile_SPU(id) {}
12 Icon_SPU *getTexture(int face, int data) { return TileRef_SPU(wood_Id)->getTexture(face); }
13 static int getDirection(int data) { return (data & DIRECTION_MASK); }
14
15 virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param // Brought forward from 1.2.3
16 {
17 int data = getDirection(level->getData(x, y, z));
18 if (data == Direction::NORTH || data == Direction::SOUTH)
19 {
20 setShape(0, 0, 6.0f / 16.0f, 1, 1.0f, 10.0f / 16.0f);
21 }
22 else
23 {
24 setShape(6.0f / 16.0f, 0, 0, 10.0f / 16.0f, 1.0f, 1);
25 }
26 }
27 virtual bool blocksLight() { return false; }
28 virtual bool isSolidRender(bool isServerLevel = false) { return false; }
29 virtual int getRenderShape() { return Tile_SPU::SHAPE_FENCE_GATE; }
30 virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face){ return true; }
31 static bool isOpen(int data) { return (data & OPEN_BIT) != 0; }
32};