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
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 PredictedResult : uchar {
38 Failure = 0,
39 Success = 1,
40 };
41
42 enum class TriggerType : uchar {
43 Unknown = 0,
44 PlayerInput = 1,
45 SimulationTick = 2,
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 virtual ~ItemUseInventoryTransaction() /*override*/;
67
68 virtual ::Bedrock::Result<void> read(::ReadOnlyBinaryStream& stream) /*override*/;
69
70 virtual void write(::BinaryStream& stream) const /*override*/;
71
72 virtual void postLoadItems(::BlockPalette& blockPalette, bool isClientSide) /*override*/;
73
74 virtual void onTransactionError(::Player& player, ::InventoryTransactionError error) const /*override*/;
75
76 virtual ::InventoryTransactionError handle(::Player& player, bool isSenderAuthority) const /*override*/;
77 // NOLINTEND
78
79public:
80 // member functions
81 // NOLINTBEGIN
82 MCAPI ItemUseInventoryTransaction();
83
84 MCAPI ItemUseInventoryTransaction(::ItemUseInventoryTransaction const&);
85
86 MCAPI explicit ItemUseInventoryTransaction(::InventoryTransaction const& transaction);
87
88 MCAPI ::InventoryTransactionError handle(
91 bool isSenderAuthority
92 ) const;
93
94 MCAPI ::ItemUseInventoryTransaction& operator=(::ItemUseInventoryTransaction const&);
95
96 MCAPI ::ItemUseInventoryTransaction& setSelectedItem(::ItemStack const& item);
97 // NOLINTEND
98
99public:
100 // static functions
101 // NOLINTBEGIN
102 MCAPI static void resendBlocksAroundArea(::Player& player, ::BlockPos const& pos, uchar facing);
103
104 MCAPI static void resendPlayerState(::Player& player);
105 // NOLINTEND
106
107public:
108 // static variables
109 // NOLINTBEGIN
110 MCAPI static ::BidirectionalUnorderedMap<::ItemUseInventoryTransaction::ActionType, ::std::string> const&
111 actionTypeMap();
112 // NOLINTEND
113
114public:
115 // constructor thunks
116 // NOLINTBEGIN
117 MCAPI void* $ctor();
118
119 MCAPI void* $ctor(::ItemUseInventoryTransaction const&);
120
121 MCAPI void* $ctor(::InventoryTransaction const& transaction);
122 // NOLINTEND
123
124public:
125 // destructor thunk
126 // NOLINTBEGIN
127 MCAPI void $dtor();
128 // NOLINTEND
129
130public:
131 // virtual function thunks
132 // NOLINTBEGIN
133 MCAPI ::Bedrock::Result<void> $read(::ReadOnlyBinaryStream& stream);
134
135 MCAPI void $write(::BinaryStream& stream) const;
136
137 MCFOLD void $postLoadItems(::BlockPalette& blockPalette, bool isClientSide);
138
139 MCAPI void $onTransactionError(::Player& player, ::InventoryTransactionError error) const;
140
141 MCAPI ::InventoryTransactionError $handle(::Player& player, bool isSenderAuthority) const;
142
143
144 // NOLINTEND
145
146public:
147 // vftables
148 // NOLINTBEGIN
149 MCNAPI static void** $vftable();
150 // NOLINTEND
151};
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:125
Definition ReadOnlyBinaryStream.h:8