LeviLamina
Loading...
Searching...
No Matches
LootCommand.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/AutomaticID.h"
7#include "mc/deps/shared_types/legacy/EquipmentSlot.h"
8#include "mc/server/commands/Command.h"
9#include "mc/server/commands/CommandPositionFloat.h"
10#include "mc/server/commands/CommandSelector.h"
11#include "mc/world/level/block/BlockSlot.h"
12
13// auto generated forward declare list
14// clang-format off
15class Actor;
16class CommandOrigin;
17class CommandOutput;
18class CommandRegistry;
19class Dimension;
20class ItemRegistryRef;
21class ItemStack;
22class Level;
23class Player;
24namespace Util { struct ReplacementResults; }
25// clang-format on
26
27class LootCommand : public ::Command {
28public:
29 // LootCommand inner types define
30 enum class Source : int {
31 Loot = 0,
32 Kill = 1,
33 Mine = 2,
34 Error = 3,
35 };
36
37 enum class Target : int {
38 Spawn = 0,
39 Give = 1,
40 Insert = 2,
41 Replace = 3,
42 Error = 4,
43 };
44
45 enum class TargetIdentifier : int {
46 Entity = 0,
47 Block = 1,
48 Error = 2,
49 };
50
51public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<4, 16, ::CommandPositionFloat> mPosition;
55 ::ll::TypedStorage<4, 16, ::CommandPositionFloat> mMinePosition;
56 ::ll::TypedStorage<4, 4, ::LootCommand::Target> mTarget;
57 ::ll::TypedStorage<4, 4, ::LootCommand::Source> mSource;
58 ::ll::TypedStorage<4, 4, ::LootCommand::TargetIdentifier> mReplacementIdentifier;
59 ::ll::TypedStorage<8, 32, ::std::string> mLootTable;
60 ::ll::TypedStorage<8, 32, ::std::string> mTool;
61 ::ll::TypedStorage<8, 200, ::CommandSelector<::Actor>> mEntitySource;
62 ::ll::TypedStorage<8, 200, ::CommandSelector<::Actor>> mEntityTarget;
63 ::ll::TypedStorage<8, 200, ::CommandSelector<::Player>> mPlayerTarget;
64 ::ll::TypedStorage<4, 4, ::BlockSlot> mBlockSlot;
65 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::EquipmentSlot> mEquipmentSlot;
66 ::ll::TypedStorage<4, 4, int> mSlotId;
67 ::ll::TypedStorage<4, 4, int> mConsecutiveSlotFillCount;
68 ::ll::TypedStorage<1, 1, bool> mSlotFillCountIsSet;
69 // NOLINTEND
70
71public:
72 // virtual functions
73 // NOLINTBEGIN
74 virtual void execute(::CommandOrigin const& origin, ::CommandOutput& output) const /*override*/;
75
76#ifdef LL_PLAT_S
77 virtual ~LootCommand() /*override*/;
78#else // LL_PLAT_C
79 virtual ~LootCommand() /*override*/ = default;
80#endif
81
82 // NOLINTEND
83
84public:
85 // member functions
86 // NOLINTBEGIN
87 MCAPI LootCommand();
88
89 MCAPI ::std::optional<::std::vector<::ItemStack>> _getItemsFromSource(
90 ::CommandOrigin const& origin,
91 ::CommandOutput& output,
92 ::ItemStack const& tool,
93 ::Level& level,
94 ::DimensionType dimensionId
95 ) const;
96
97 MCAPI void
98 _outputError(::CommandOutput& output, ::Util::ReplacementResults errorDetails, ::Actor const* entity) const;
99
100 MCAPI void _outputSuccess(::CommandOutput& output, int numItemsDropped) const;
101
102 MCAPI void _placeItemsInTarget(
103 ::CommandOrigin const& origin,
104 ::CommandOutput& output,
105 ::std::vector<::ItemStack>& items
106 ) const;
107
108 MCAPI ::ItemStack getToolItemStack(::CommandOrigin const& origin, ::CommandOutput& output) const;
109 // NOLINTEND
110
111public:
112 // static functions
113 // NOLINTBEGIN
114 MCAPI static void setup(::CommandRegistry& registry, ::ItemRegistryRef itemRegistry);
115 // NOLINTEND
116
117public:
118 // constructor thunks
119 // NOLINTBEGIN
120 MCAPI void* $ctor();
121 // NOLINTEND
122
123public:
124 // destructor thunk
125 // NOLINTBEGIN
126 MCAPI void $dtor();
127 // NOLINTEND
128
129public:
130 // virtual function thunks
131 // NOLINTBEGIN
132 MCAPI void $execute(::CommandOrigin const& origin, ::CommandOutput& output) const;
133
134
135 // NOLINTEND
136
137public:
138 // vftables
139 // NOLINTBEGIN
140 MCNAPI static void** $vftable();
141 // NOLINTEND
142};
Definition Actor.h:105
Definition Block.h:43
Definition CommandOrigin.h:32
Definition CommandOutput.h:19
Definition CommandRegistry.h:47
Definition Command.h:17
Definition Dimension.h:85
Definition ItemRegistryRef.h:36
Definition ItemStack.h:26
Definition Level.h:249
static MCAPI void ** $vftable()
Definition Player.h:125
Definition ReplacementResults.h:7