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.h"
4
5class Mob;
6class Player;
7
8class StairTile : public Tile
9{
10 friend class Tile;
11
12private:
13 static const int DEAD_SPACE_COLUMN_COUNT = 2;
14 static int DEAD_SPACES[8][DEAD_SPACE_COLUMN_COUNT];
15
16public:
17 static const int UPSIDEDOWN_BIT = 4;
18
19 // the direction is the way going up (for normal non-upsidedown stairs)
20 static const int DIR_EAST = 0;
21 static const int DIR_WEST = 1;
22 static const int DIR_SOUTH = 2;
23 static const int DIR_NORTH = 3;
24
25private:
26 Tile *base;
27 int basedata;
28 bool isClipping;
29 int clipStep;
30
31protected:
32 StairTile(int id, Tile *base, int basedata);
33
34public:
35 void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param
36 bool isSolidRender(bool isServerLevel = false);
37 bool isCubeShaped();
38 int getRenderShape();
39 void setBaseShape(LevelSource *level, int x, int y, int z);
40 static bool isStairs(int id);
41
42private:
43 bool isLockAttached(LevelSource *level, int x, int y, int z, int data);
44
45public:
46 bool setStepShape(LevelSource *level, int x, int y, int z);
47 bool setInnerPieceShape(LevelSource *level, int x, int y, int z);
48 void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source);
49
50
51 /** DELEGATES: **/
52public:
53 virtual void addLights(Level *level, int x, int y, int z);
54 virtual void animateTick(Level *level, int x, int y, int z, Random *random);
55 virtual void attack(Level *level, int x, int y, int z, shared_ptr<Player> player);
56 virtual void destroy(Level *level, int x, int y, int z, int data);
57 virtual int getLightColor(LevelSource *level, int x, int y, int z, int tileId = -1);
58 virtual float getBrightness(LevelSource *level, int x, int y, int z);
59 virtual float getExplosionResistance(shared_ptr<Entity> source);
60 virtual int getRenderLayer();
61 virtual Icon *getTexture(int face, int data);
62 virtual int getTickDelay(Level *level);
63 virtual AABB *getTileAABB(Level *level, int x, int y, int z);
64 virtual void handleEntityInside(Level *level, int x, int y, int z, shared_ptr<Entity> e, Vec3 *current);
65 virtual bool mayPick();
66 virtual bool mayPick(int data, bool liquid);
67 virtual bool mayPlace(Level *level, int x, int y, int z);
68 virtual void onPlace(Level *level, int x, int y, int z);
69 virtual void onRemove(Level *level, int x, int y, int z, int id, int data);
70 virtual void prepareRender(Level *level, int x, int y, int z);
71 virtual void stepOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity);
72 virtual void tick(Level *level, int x, int y, int z, Random *random);
73 virtual bool use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param
74 virtual void wasExploded(Level *level, int x, int y, int z, Explosion *explosion);
75 virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr<LivingEntity> by, shared_ptr<ItemInstance> itemInstance);
76 virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue);
77 virtual HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b);
78 virtual void registerIcons(IconRegister *iconRegister);
79};