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