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