8 #include "../BlockEntities/ChestEntity.h"
9 #include "../Entities/Player.h"
18 m_World(a_Chest->GetWorld()),
19 m_BlockPos(a_Chest->GetPos()),
20 m_PrimaryChest(a_Chest),
21 m_SecondaryChest(nullptr)
39 cWindow(wtChest, (a_PrimaryChest->GetBlockType() ==
E_BLOCK_CHEST) ?
"Double Chest" :
"Double Trapped Chest"),
40 m_World(a_PrimaryChest->GetWorld()),
41 m_BlockPos(a_PrimaryChest->GetPos()),
42 m_PrimaryChest(a_PrimaryChest),
43 m_SecondaryChest(a_SecondaryChest)
std::vector< cSlotArea * > cSlotAreas
cWorld * GetWorld() const
BLOCKTYPE GetBlockType() const
int GetNumberOfPlayers(void) const
Gets the number of players who currently have this chest open.
void SetNumberOfPlayers(int a_NumActivePlayers)
Sets the number of players who currently have this chest open.
virtual void OpenedByPlayer(cPlayer &a_Player) override
virtual bool ClosedByPlayer(cPlayer &a_Player, bool a_CanRefuse) override
Called when a player closes this window; notifies all slot areas.
cChestWindow(cChestEntity *a_Chest)
cChestEntity * m_PrimaryChest
cChestEntity * m_SecondaryChest
virtual void DistributeStack(cItem &a_ItemStack, int a_Slot, cPlayer &a_Player, cSlotArea *a_ClickedArea, bool a_ShouldApply) override
Called on shift-clicking to distribute the stack into other areas; Modifies a_ItemStack as it is dist...
virtual ~cChestWindow() override
Handles the main inventory of each player, excluding the armor and hotbar.
Handles the hotbar of each player.
virtual void OpenedByPlayer(cPlayer &a_Player)
virtual bool ClosedByPlayer(cPlayer &a_Player, bool a_CanRefuse)
Called when a player closes this window; notifies all slot areas.
void DistributeStackToAreas(cItem &a_ItemStack, cPlayer &a_Player, cSlotAreas &a_AreasInOrder, bool a_ShouldApply, bool a_BackFill)
Called from DistributeStack() to distribute the stack into a_AreasInOrder; Modifies a_ItemStack as it...
virtual void WakeUpSimulators(Vector3i a_Block) override
Wakes up the simulators for the specified block.
virtual void BroadcastBlockAction(Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override