the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 66 lines 2.3 kB view raw
1#pragma once 2#include "Tile.h" 3#include "Definitions.h" 4 5class Player; 6class Random; 7class Level; 8 9class ButtonTile : public Tile 10{ 11 friend class Tile; 12 13private: 14 bool sensitive; 15 16protected: 17 ButtonTile(int id, bool sensitive); 18 19public: 20 Icon *getTexture(int face, int data); 21 virtual AABB *getAABB(Level *level, int x, int y, int z); 22 virtual int getTickDelay(Level *level); 23 virtual bool blocksLight(); 24 virtual bool isSolidRender(bool isServerLevel = false); 25 virtual bool isCubeShaped(); 26 virtual bool mayPlace(Level *level, int x, int y, int z, int face); 27 virtual bool mayPlace(Level *level, int x, int y, int z); 28 virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); 29 30private: 31 int findFace(Level *level, int x, int y, int z); 32 33public: 34 virtual void neighborChanged(Level *level, int x, int y, int z, int type); 35 36private: 37 bool checkCanSurvive(Level *level, int x, int y, int z); 38 39public: 40 virtual 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 41 42private: 43 void updateShape(int data); 44 45public: 46 virtual void attack(Level *level, int x, int y, int z, shared_ptr<Player> player); 47 virtual bool TestUse(); 48 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 49 virtual void onRemove(Level *level, int x, int y, int z, int id, int data); 50 virtual int getSignal(LevelSource *level, int x, int y, int z, int dir); 51 virtual int getDirectSignal(LevelSource *level, int x, int y, int z, int dir); 52 virtual bool isSignalSource(); 53 virtual void tick(Level *level, int x, int y, int z, Random *random); 54 virtual void updateDefaultShape(); 55 void entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity); 56 57private: 58 void checkPressed(Level *level, int x, int y, int z); 59 void updateNeighbours(Level *level, int x, int y, int z, int dir); 60 61public: 62 void registerIcons(IconRegister *iconRegister); 63 64 // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing 65 virtual bool shouldTileTick(Level *level, int x,int y,int z); 66};