38 enum class SpawningLogicState :
int {
40 WaitingForPlayers = 1,
42 WaitingForRewardEjection = 3,
52 ::ll::TypedStorage<1, 1, bool> haveTrialOmen;
53 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> foundPlayers;
73 ::ll::TypedStorage<8, 152, ::ItemStack> itemStack;
93 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mDetectedPlayers;
94 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mCurrentMobs;
95 ::ll::TypedStorage<8, 8, uint64> mCooldownEndsAt;
96 ::ll::TypedStorage<8, 8, uint64> mNextMobSpawnsAt;
97 ::ll::TypedStorage<4, 4, int> mTotalMobsSpawned;
98 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SpawnData>> mNextSpawnData;
99 ::ll::TypedStorage<8, 32, ::std::string> mSelectedLootTableName;
100 ::ll::TypedStorage<8, 24, ::std::vector<::TrialSpawner::WeightedItemStack>> mDispensing;
101 ::ll::TypedStorage<8, 176, ::ActorDefinitionIdentifier> mActorDefId;
102 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mDisplayEntity;
103 ::ll::TypedStorage<4, 4, float> mCurrentSpinSpeed;
104 ::ll::TypedStorage<4, 4, float> mPreviousSpinSpeed;
105 ::ll::TypedStorage<1, 1, bool> mSkipNextMobCleanup;
124 ::ll::TypedStorage<4, 12, ::BlockPos const> mPosition;
125 ::ll::TypedStorage<4, 4, int> mPlayerSearchRange;
126 ::ll::TypedStorage<8, 352, ::TrialSpawner::Data> mData;
127 ::ll::TypedStorage<8, 144, ::TrialSpawnerConfig> mNormalConfig;
128 ::ll::TypedStorage<8, 144, ::TrialSpawnerConfig> mOminousConfig;
129 ::ll::TypedStorage<1, 1, bool> mIsOminous;
130 ::ll::TypedStorage<1, 1, bool> hasSpawnedItemSpawner;
140 MCAPI
explicit TrialSpawner(
::BlockPos const& pos);
144 MCAPI
void _dispenseItemAboveRandomCombatant(
::BlockSource& region);
146 MCAPI ::TrialSpawner::PlayerScanResult _doPlayerScan(
::BlockSource& region);
150 MCAPI ::std::vector<::TrialSpawner::WeightedItemStack>& _getDispensingItems(
::BlockSource& region);
152 MCAPI ::std::optional<::Vec3>
153 _getPositionToSpawnItemSpawner(
::BlockSource& region, ::std::vector<::ActorUniqueID>
const& eligibleActorIds)
const;
157 MCAPI
void _selectLootTable(
::Level& level);
159 MCAPI
void _sendParticlesForState(
::BlockSource& region,
::BlockPos pos, ::TrialSpawner::SpawningLogicState state);
171 MCAPI
void _tryRegisterNewPlayers(
::BlockSource& region, ::TrialSpawner::SpawningLogicState currentState);
177 MCAPI ::Mob* createAndAddDisplayEntity(
::BlockSource& region);
179 MCAPI ::CompoundTag createUpdatePacket();
182 MCAPI
float getCurrentSpinSpeed()
const;
185 MCAPI ::SpawnData
const* getOrCreateNextSpawnData(
::Random& random);
188 MCAPI
float getPreviousSpinSpeed()
const;
191 MCAPI ::TrialSpawner::SpawningLogicState getSpawningLogicState(
::BlockSource& region)
const;
195 MCAPI
void removeDisplayEntity();
204 MCAPI ::Mob* tryGetOrCreateDisplayEntity(
::BlockSource& region);
207 MCAPI ~TrialSpawner();
215 MCAPI
static void _ejectResultItems(
218 ::std::vector<::ItemStack>
const& items,
222 MCAPI static ::std::optional<::Vec3>
225 MCAPI static ::std::vector<::ItemStack> _getRandomLootTableItems(
229 ::std::string
const& lootTableName
232 MCAPI
static void _removeMobByGameplay(
::Level& level,
::Actor& mob);
235 MCAPI
static void addSpawnParticles(
::Level& level,
::Vec3 pos,
bool isOminous);
237 MCAPI
static void sendEjectItemParticles(
::Level& level,
::BlockPos pos,
bool isOminous);