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)
40 m_World(a_PrimaryChest->GetWorld()),
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...
Handles the main inventory of each player, excluding the armor and hotbar.
BLOCKTYPE GetBlockType() const
cWorld * GetWorld() const
void SetNumberOfPlayers(int a_NumActivePlayers)
Sets the number of players who currently have this chest open.
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 ~cChestWindow() override
virtual void WakeUpSimulators(Vector3i a_Block) override
Wakes up the simulators for the specified block.
int GetNumberOfPlayers(void) const
Gets the number of players who currently have this chest open.
cChestWindow(cChestEntity *a_Chest)
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override
cChestEntity * m_PrimaryChest
std::vector< cSlotArea * > cSlotAreas
virtual void OpenedByPlayer(cPlayer &a_Player)
virtual void BroadcastBlockAction(Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
cChestEntity * m_SecondaryChest
virtual bool ClosedByPlayer(cPlayer &a_Player, bool a_CanRefuse)
Called when a player closes this window; notifies all slot areas.
virtual bool ClosedByPlayer(cPlayer &a_Player, bool a_CanRefuse) override
Called when a player closes this window; notifies all slot areas.
Handles the hotbar of each player.
virtual void OpenedByPlayer(cPlayer &a_Player) override