the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 60 lines 2.0 kB view raw
1#pragma once 2#include "BaseEntityTile.h" 3#include "Material.h" 4 5class Player; 6class Random; 7 8class ChestTile : public BaseEntityTile 9{ 10 friend class Tile; 11 friend class Minecraft; 12 13public: 14 static const int TYPE_BASIC = 0; 15 static const int TYPE_TRAP = 1; 16 17 static const int EVENT_SET_OPEN_COUNT = 1; 18 19private: 20 Random *random; 21 22public: 23 int type; 24 25protected: 26 ChestTile(int id, int type); 27 ~ChestTile(); 28 29public: 30 virtual bool isSolidRender(bool isServerLevel = false); 31 virtual bool isCubeShaped(); 32 virtual int getRenderShape(); 33 virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); 34 virtual void onPlace(Level *level, int x, int y, int z); 35 virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr<LivingEntity> by, shared_ptr<ItemInstance> itemInstance); 36 void recalcLockDir(Level *level, int x, int y, int z); 37 virtual bool mayPlace(Level *level, int x, int y, int z); 38 39private: 40 bool isFullChest(Level *level, int x, int y, int z); 41 42public: 43 virtual void neighborChanged(Level *level, int x, int y, int z, int type); 44 virtual void onRemove(Level *level, int x, int y, int z, int id, int data); 45 virtual bool TestUse(); 46 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 47 virtual shared_ptr<Container> getContainer(Level *level, int x, int y, int z); 48 virtual shared_ptr<TileEntity> newTileEntity(Level *level); 49 virtual bool isSignalSource(); 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 53private: 54 bool isCatSittingOnChest(Level *level, int x, int y, int z); 55 56public: 57 virtual bool hasAnalogOutputSignal(); 58 virtual int getAnalogOutputSignal(Level *level, int x, int y, int z, int dir); 59 virtual void registerIcons(IconRegister *iconRegister); 60};