LeviLamina
Loading...
Searching...
No Matches
ItemUseInventoryTransaction.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/platform/Result.h"
8#include "mc/util/BidirectionalUnorderedMap.h"
9#include "mc/world/inventory/transaction/ComplexInventoryTransaction.h"
10#include "mc/world/inventory/transaction/InventoryTransactionError.h"
11#include "mc/world/item/NetworkItemStackDescriptor.h"
12#include "mc/world/level/BlockPos.h"
13
14// auto generated forward declare list
15// clang-format off
16class BinaryStream;
17class BlockPalette;
21class ItemStack;
22class Player;
24// clang-format on
25
26class ItemUseInventoryTransaction : public ::ComplexInventoryTransaction {
27public:
28 // ItemUseInventoryTransaction inner types define
29 enum class ActionType : int {
30 Place = 0,
31 Use = 1,
32 Destroy = 2,
33 UseAsAttack = 3,
34 };
35
36 enum class ClientCooldownState : uchar {
37 Off = 0,
38 On = 1,
39 };
40
41 enum class PredictedResult : uchar {
42 Failure = 0,
43 Success = 1,
44 };
45
46 enum class TriggerType : uchar {
47 Unknown = 0,
48 PlayerInput = 1,
49 SimulationTick = 2,
50 };
51
52public:
53 // member variables
54 // NOLINTBEGIN
55 ::ll::TypedStorage<4, 4, ::ItemUseInventoryTransaction::ActionType> mActionType;
56 ::ll::TypedStorage<1, 1, ::ItemUseInventoryTransaction::TriggerType> mTriggerType;
57 ::ll::TypedStorage<4, 12, ::BlockPos> mPos;
58 ::ll::TypedStorage<4, 4, uint> mTargetBlockId;
59 ::ll::TypedStorage<1, 1, uchar> mFace;
60 ::ll::TypedStorage<4, 4, int> mSlot;
61 ::ll::TypedStorage<8, 96, ::NetworkItemStackDescriptor> mItem;
62 ::ll::TypedStorage<4, 12, ::Vec3> mFromPos;
63 ::ll::TypedStorage<4, 12, ::Vec3> mClickPos;
64 ::ll::TypedStorage<1, 1, ::ItemUseInventoryTransaction::PredictedResult> mClientPredictedResult;
65 ::ll::TypedStorage<1, 1, ::ItemUseInventoryTransaction::ClientCooldownState> mClientCooldownState;
66 // NOLINTEND
67
68public:
69 // virtual functions
70 // NOLINTBEGIN
71 virtual ~ItemUseInventoryTransaction() /*override*/;
72
73 virtual ::Bedrock::Result<void> read(::ReadOnlyBinaryStream& stream) /*override*/;
74
75 virtual void write(::BinaryStream& stream) const /*override*/;
76
77 virtual void postLoadItems(::BlockPalette& blockPalette, bool isClientSide) /*override*/;
78
79 virtual void onTransactionError(::Player& player, ::InventoryTransactionError error) const /*override*/;
80
81 virtual ::InventoryTransactionError handle(::Player& player, bool isSenderAuthority) const /*override*/;
82 // NOLINTEND
83
84public:
85 // member functions
86 // NOLINTBEGIN
87 MCAPI ItemUseInventoryTransaction();
88
89 MCAPI ItemUseInventoryTransaction(::ItemUseInventoryTransaction const&);
90
91 MCAPI explicit ItemUseInventoryTransaction(::InventoryTransaction const& transaction);
92
93 MCAPI ::InventoryTransactionError handle(
96 bool isSenderAuthority
97 ) const;
98
99 MCAPI ::ItemUseInventoryTransaction& operator=(::ItemUseInventoryTransaction const&);
100
101 MCAPI ::ItemUseInventoryTransaction& setSelectedItem(::ItemStack const& item);
102 // NOLINTEND
103
104public:
105 // static functions
106 // NOLINTBEGIN
107 MCAPI static void resendBlocksAroundArea(::Player& player, ::BlockPos const& pos, uchar facing);
108
109 MCAPI static void resendPlayerState(::Player& player);
110 // NOLINTEND
111
112public:
113 // static variables
114 // NOLINTBEGIN
115 MCAPI static ::BidirectionalUnorderedMap<::ItemUseInventoryTransaction::ActionType, ::std::string> const&
116 actionTypeMap();
117 // NOLINTEND
118
119public:
120 // constructor thunks
121 // NOLINTBEGIN
122 MCAPI void* $ctor();
123
124 MCAPI void* $ctor(::ItemUseInventoryTransaction const&);
125
126 MCAPI void* $ctor(::InventoryTransaction const& transaction);
127 // NOLINTEND
128
129public:
130 // destructor thunk
131 // NOLINTBEGIN
132 MCAPI void $dtor();
133 // NOLINTEND
134
135public:
136 // virtual function thunks
137 // NOLINTBEGIN
138 MCAPI ::Bedrock::Result<void> $read(::ReadOnlyBinaryStream& stream);
139
140 MCAPI void $write(::BinaryStream& stream) const;
141
142 MCFOLD void $postLoadItems(::BlockPalette& blockPalette, bool isClientSide);
143
144 MCAPI void $onTransactionError(::Player& player, ::InventoryTransactionError error) const;
145
146 MCAPI ::InventoryTransactionError $handle(::Player& player, bool isSenderAuthority) const;
147
148
149 // NOLINTEND
150
151public:
152 // vftables
153 // NOLINTBEGIN
154 MCNAPI static void** $vftable();
155 // NOLINTEND
156};
Definition BinaryStream.h:11
Definition BlockPalette.h:19
Definition BlockPos.h:19
Definition ComplexInventoryTransaction.h:19
Definition IItemUseTransactionSubject.h:22
Definition ILegacyItemUseTransactionSubject.h:10
Definition InventoryTransaction.h:21
Definition ItemStack.h:26
static MCAPI void ** $vftable()
Definition Player.h:129
Definition ReadOnlyBinaryStream.h:8