the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3using namespace std;
4
5#include "TileEntity.h"
6#include "Container.h"
7
8#include "ListTag.h"
9
10class Player;
11class CompoundTag;
12
13class ChestTileEntity : public TileEntity, public Container
14{
15public:
16 eINSTANCEOF GetType() { return eTYPE_CHESTTILEENTITY; }
17 static TileEntity *create() { return new ChestTileEntity(); }
18
19 int getContainerType(); // 4J-Added;
20
21 using TileEntity::setChanged;
22
23private:
24 void _init(bool isBonusChest);
25
26public:
27 ChestTileEntity(bool isBonusChest = false); // 4J added param
28 ChestTileEntity(int type, bool isBonusChest = false); // 4J added param
29 virtual ~ChestTileEntity();
30
31private:
32 ItemInstanceArray *items;
33
34public:
35 bool isBonusChest; // 4J added
36 bool hasCheckedNeighbors;
37 weak_ptr<ChestTileEntity> n;
38 weak_ptr<ChestTileEntity> e;
39 weak_ptr<ChestTileEntity> w;
40 weak_ptr<ChestTileEntity> s;
41
42 float openness, oOpenness;
43 int openCount;
44private:
45 int tickInterval;
46
47 int type;
48 wstring name;
49
50public:
51 virtual unsigned int getContainerSize();
52 virtual shared_ptr<ItemInstance> getItem(unsigned int slot);
53 virtual shared_ptr<ItemInstance> removeItem(unsigned int slot, int count);
54 virtual shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
55 virtual void setItem(unsigned int slot, shared_ptr<ItemInstance> item);
56 virtual wstring getName();
57 virtual wstring getCustomName();
58 virtual bool hasCustomName();
59 virtual void setCustomName(const wstring &name);
60 virtual void load(CompoundTag *base);
61 virtual void save(CompoundTag *base);
62 virtual int getMaxStackSize() const;
63 virtual bool stillValid(shared_ptr<Player> player);
64 virtual void setChanged();
65 virtual void clearCache();
66
67private:
68 virtual void heyImYourNeighbor(shared_ptr<ChestTileEntity> neighbor, int from);
69
70public:
71 virtual void checkNeighbors();
72
73private:
74 bool isSameChest(int x, int y, int z);
75
76public:
77 virtual void tick();
78 virtual bool triggerEvent(int b0, int b1);
79 virtual void startOpen();
80 virtual void stopOpen();
81 virtual bool canPlaceItem(int slot, shared_ptr<ItemInstance> item);
82 virtual void setRemoved();
83 virtual int getType();
84
85 // 4J Added
86 virtual shared_ptr<TileEntity> clone();
87};