LeviLamina
Loading...
Searching...
No Matches
TrialSpawner.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
8// auto generated forward declare list
9// clang-format off
10class Actor;
11class Block;
12class BlockPos;
13class BlockSource;
14class CompoundTag;
15class Dimension;
16class ItemStack;
17class Level;
18class Mob;
19class Random;
20class SpawnData;
21class Tag;
23class Vec3;
25struct ActorUniqueID;
27// clang-format on
28
30public:
31 // TrialSpawner inner types declare
32 // clang-format off
33 struct Data;
34 struct PlayerScanResult;
35 struct WeightedItemStack;
36 // clang-format on
37
38 // TrialSpawner inner types define
39 enum class SpawningLogicState : int {
40 Inactive = 0,
41 WaitingForPlayers = 1,
42 Active = 2,
43 WaitingForRewardEjection = 3,
44 EjectingRewards = 4,
45 Cooldown = 5,
46 Count = 6,
47 };
48
50 public:
51 // member variables
52 // NOLINTBEGIN
54 // NOLINTEND
55
56 public:
57 // prevent constructor by default
58 WeightedItemStack& operator=(WeightedItemStack const&);
61
62 public:
63 // member functions
64 // NOLINTBEGIN
65 MCAPI ~WeightedItemStack();
66 // NOLINTEND
67
68 public:
69 // destructor thunk
70 // NOLINTBEGIN
71 MCFOLD void $dtor();
72 // NOLINTEND
73 };
74
75 struct Data {
76 public:
77 // member variables
78 // NOLINTBEGIN
94 // NOLINTEND
95
96 public:
97 // prevent constructor by default
98 Data& operator=(Data const&);
99 Data(Data const&);
100 Data();
101
102 public:
103 // member functions
104 // NOLINTBEGIN
105 MCAPI void reset();
106
107 MCAPI ~Data();
108 // NOLINTEND
109
110 public:
111 // destructor thunk
112 // NOLINTBEGIN
113 MCAPI void $dtor();
114 // NOLINTEND
115 };
116
118 public:
119 // member variables
120 // NOLINTBEGIN
123 // NOLINTEND
124
125 public:
126 // prevent constructor by default
127 PlayerScanResult& operator=(PlayerScanResult const&);
130
131 public:
132 // member functions
133 // NOLINTBEGIN
134 MCAPI ~PlayerScanResult();
135 // NOLINTEND
136
137 public:
138 // destructor thunk
139 // NOLINTBEGIN
140 MCFOLD void $dtor();
141 // NOLINTEND
142 };
143
144public:
145 // member variables
146 // NOLINTBEGIN
154 // NOLINTEND
155
156public:
157 // prevent constructor by default
158 TrialSpawner& operator=(TrialSpawner const&);
160 TrialSpawner();
161
162public:
163 // member functions
164 // NOLINTBEGIN
165 MCAPI explicit TrialSpawner(::BlockPos const& pos);
166
167 MCAPI void _becomeOminous(::BlockSource& region, ::Block const& block);
168
169 MCAPI void _dispenseItemAboveRandomCombatant(::BlockSource& region);
170
171 MCAPI ::TrialSpawner::PlayerScanResult _doPlayerScan(::BlockSource& region);
172
173 MCAPI ::std::vector<::TrialSpawner::WeightedItemStack>& _getDispensingItems(::BlockSource& region);
174
175 MCAPI ::std::optional<::Vec3>
176 _getPositionToSpawnItemSpawner(::BlockSource& region, ::std::vector<::ActorUniqueID> const& eligibleActorIds) const;
177
178 MCAPI bool _hasLineOfSight(::BlockSource const& region, ::Vec3 from, ::Vec3 to, float maxRange) const;
179
180 MCAPI void _selectLootTable(::Level& level);
181
182 MCAPI void _sendParticlesForState(::BlockSource& region, ::BlockPos pos, ::TrialSpawner::SpawningLogicState state);
183
184 MCAPI void _sendSmallFlame(::BlockSource& region, ::Vec3 center);
185
186 MCAPI void _spawnItemSpawner(::BlockSource& region, ::Vec3 pos, ::ItemStack const& itemToSpawn);
187
188 MCAPI ::std::optional<::ActorUniqueID> _spawnMob(::BlockSource& region, ::BlockPos blockActorPos, ::Vec3 spawnPos);
189
190 MCAPI void _tryRegisterNewPlayers(::BlockSource& region, ::TrialSpawner::SpawningLogicState currentState);
191
192 MCAPI void _updateStateMachine(::BlockSource& region);
193
194 MCAPI void applyUpdatePacket(::CompoundTag const& tag, ::BlockSource& region);
195
196 MCAPI ::Mob* createAndAddDisplayEntity(::BlockSource& region);
197
198 MCAPI ::SpawnData const* getOrCreateNextSpawnData(::Random& random);
199
200 MCAPI ::TrialSpawner::SpawningLogicState getSpawningLogicState(::BlockSource& region) const;
201
202 MCAPI void load(::CompoundTag const& data, ::TrialSpawnerConfigRegistry const& configRegistry);
203
204 MCAPI void removeDisplayEntity();
205
206 MCAPI void save(::CompoundTag& tag);
207
208 MCAPI void setEntityId(::ActorDefinitionIdentifier const& actorDefId, ::BlockSource& region);
209
210 MCAPI void tick(::BlockSource& region);
211 // NOLINTEND
212
213public:
214 // static functions
215 // NOLINTBEGIN
216 MCAPI static void _ejectItem(::BlockSource& region, ::Vec3 pos, ::ItemStack const& item);
217
218 MCAPI static void _ejectResultItems(
219 ::BlockSource& region,
220 ::BlockPos blockPos,
221 ::std::vector<::ItemStack> const& items,
222 int lootCount
223 );
224
225 MCAPI static ::std::optional<::Vec3>
226 _findFreePositionAbove(::BlockSource const& region, ::Vec3 const& from, int distance);
227
228 MCAPI static ::std::vector<::ItemStack> _getRandomLootTableItems(
229 ::Level& level,
230 ::Random& random,
231 ::DimensionType dimensionType,
232 ::std::string const& lootTableName
233 );
234
235 MCAPI static bool _isAllowedToSpawnInLevel(::Level& level);
236
237 MCAPI static bool _isOminous(::BlockSource& region, ::BlockPos pos);
238
239 MCAPI static void _removeMobByGameplay(::Level& level, ::Actor& mob);
240
241 MCAPI static ::std::unique_ptr<::Tag> _saveConfig(::TrialSpawnerConfig& config);
242 // NOLINTEND
243
244public:
245 // constructor thunks
246 // NOLINTBEGIN
247 MCAPI void* $ctor(::BlockPos const& pos);
248 // NOLINTEND
249};
Definition Actor.h:104
Definition AutomaticID.h:6
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition Block.h:36
Definition CompoundTag.h:13
Definition Dimension.h:83
Definition ItemStack.h:25
Definition Level.h:234
Definition Mob.h:47
Definition Random.h:16
Definition SpawnData.h:13
Definition Tag.h:39
Definition TrialSpawnerConfigRegistry.h:10
Definition TrialSpawner.h:29
Definition Vec3.h:10
Definition ActorDefinitionIdentifier.h:13
Definition ActorUniqueID.h:5
Definition TrialSpawnerConfig.h:10
Definition TrialSpawner.h:75
Definition TrialSpawner.h:117
Definition TrialSpawner.h:49
Definition Alias.h:14