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