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