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