8#if PROTOCOL_VERSION > 451
17#if PROTOCOL_VERSION < 755
18 enum class TransactionState
28 std::shared_ptr<ProtocolCraft::ServerboundContainerClickPacket>
msg;
29#if PROTOCOL_VERSION < 755
30 std::map<short, ProtocolCraft::Slot> changed_slots;
42 std::shared_ptr<Window>
GetWindow(
const short window_id)
const;
50#if PROTOCOL_VERSION < 755
51 TransactionState GetTransactionState(
const short window_id,
const int transaction_id)
const;
62#if PROTOCOL_VERSION > 451
73#if PROTOCOL_VERSION > 754
76#if PROTOCOL_VERSION > 755
77 void SetStateId(
const short window_id,
const int state_id);
84#if PROTOCOL_VERSION < 768
85 virtual void Handle(ProtocolCraft::ClientboundSetCarriedItemPacket& msg)
override;
89#if PROTOCOL_VERSION < 755
90 virtual void Handle(ProtocolCraft::ClientboundContainerAckPacket& msg)
override;
92#if PROTOCOL_VERSION > 451
96#if PROTOCOL_VERSION > 767
110#if PROTOCOL_VERSION < 755
113 std::map<short, std::map<short, InventoryTransaction > > pending_transactions;
115 std::map<short, std::map<short, TransactionState> > transaction_states;
117#if PROTOCOL_VERSION > 451
ProtocolCraft::Slot GetOffHand() const
void SetStateId(const short window_id, const int state_id)
void SetHotbarSelected(const short index)
void AddInventory(const short window_id, const InventoryType window_type)
virtual void Handle(ProtocolCraft::ClientboundContainerSetSlotPacket &msg) override
std::map< short, std::shared_ptr< Window > > inventories
void SynchronizeContainerPlayerInventory(const short window_id)
void SetSlot(const short window_id, const short index, const ProtocolCraft::Slot &slot)
std::vector< ProtocolCraft::MerchantOffer > available_trades
std::vector< ProtocolCraft::MerchantOffer > GetAvailableMerchantOffers() const
std::shared_mutex inventory_manager_mutex
InventoryTransaction PrepareTransaction(const std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > &transaction)
"think" about the changes made by this transaction, filling in the necessary values in the msg
void ApplyTransaction(const InventoryTransaction &transaction)
Apply a given transaction to a container.
short GetIndexHotbarSelected() const
std::shared_ptr< Window > GetWindow(const short window_id) const
ProtocolCraft::Slot GetHotbarSelected() const
void SetCursor(const ProtocolCraft::Slot &c)
void ApplyTransactionImpl(const InventoryTransaction &transaction)
void EraseInventory(const short window_id)
short GetFirstOpenedWindowId() const
ProtocolCraft::Slot GetCursor() const
ProtocolCraft::Slot cursor
std::shared_ptr< Window > GetPlayerInventory() const
short index_hotbar_selected
void IncrementMerchantOfferUse(const int index)
std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > msg