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/ecs/WeakEntityRef.h"
7#include "mc/world/actor/ActorDefinitionIdentifier.h"
8#include "mc/world/item/ItemStack.h"
9#include "mc/world/level/BlockPos.h"
10#include "mc/world/level/block/registry/TrialSpawnerConfig.h"
11
12// auto generated forward declare list
13// clang-format off
14class BlockSource;
15class CompoundTag;
16class Level;
17class Mob;
18class Random;
19class SpawnData;
21class Vec3;
22struct ActorUniqueID;
23struct DimensionType;
24// clang-format on
25
27public:
28 // TrialSpawner inner types declare
29 // clang-format off
30 struct PlayerScanResult;
31 struct WeightedItemStack;
32 struct Data;
33 // clang-format on
34
35 // TrialSpawner inner types define
36 enum class SpawningLogicState : int {
37 Inactive = 0,
38 WaitingForPlayers = 1,
39 Active = 2,
40 WaitingForRewardEjection = 3,
41 EjectingRewards = 4,
42 Cooldown = 5,
43 Count = 6,
44 };
45
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<1, 1, bool> haveTrialOmen;
51 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> foundPlayers;
52 // NOLINTEND
53 };
54
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 152, ::ItemStack> itemStack;
60 // NOLINTEND
61 };
62
63 struct Data {
64 public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mDetectedPlayers;
68 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mCurrentMobs;
69 ::ll::TypedStorage<8, 8, uint64> mCooldownEndsAt;
70 ::ll::TypedStorage<8, 8, uint64> mNextMobSpawnsAt;
71 ::ll::TypedStorage<4, 4, int> mTotalMobsSpawned;
72 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SpawnData>> mNextSpawnData;
73 ::ll::TypedStorage<8, 32, ::std::string> mSelectedLootTableName;
74 ::ll::TypedStorage<8, 24, ::std::vector<::TrialSpawner::WeightedItemStack>> mDispensing;
75 ::ll::TypedStorage<8, 176, ::ActorDefinitionIdentifier> mActorDefId;
76 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mDisplayEntity;
77 ::ll::TypedStorage<4, 4, float> mCurrentSpinSpeed;
78 ::ll::TypedStorage<4, 4, float> mPreviousSpinSpeed;
79 ::ll::TypedStorage<1, 1, bool> mSkipNextMobCleanup;
80 // NOLINTEND
81
82 public:
83 // member functions
84 // NOLINTBEGIN
85 MCAPI ~Data();
86 // NOLINTEND
87
88 public:
89 // destructor thunk
90 // NOLINTBEGIN
91 MCAPI void $dtor();
92 // NOLINTEND
93 };
94
95public:
96 // member variables
97 // NOLINTBEGIN
98 ::ll::TypedStorage<4, 12, ::BlockPos const> mPosition;
99 ::ll::TypedStorage<4, 4, int> mPlayerSearchRange;
100 ::ll::TypedStorage<8, 352, ::TrialSpawner::Data> mData;
101 ::ll::TypedStorage<8, 144, ::TrialSpawnerConfig> mNormalConfig;
102 ::ll::TypedStorage<8, 144, ::TrialSpawnerConfig> mOminousConfig;
103 ::ll::TypedStorage<1, 1, bool> mIsOminous;
104 ::ll::TypedStorage<1, 1, bool> hasSpawnedItemSpawner;
105 // NOLINTEND
106
107public:
108 // member functions
109 // NOLINTBEGIN
110 MCAPI ::std::vector<::TrialSpawner::WeightedItemStack>& _getDispensingItems(::BlockSource& region);
111
112 MCAPI ::std::optional<::Vec3>
113 _getPositionToSpawnItemSpawner(::BlockSource& region, ::std::vector<::ActorUniqueID> const& eligibleActorIds) const;
114
115 MCAPI bool
116 _hasLineOfSight(::BlockSource const& region, ::Vec3 const from, ::Vec3 const to, float const maxRange) const;
117
118 MCAPI void _sendSmallFlame(::BlockSource& region, ::Vec3 const center);
119
120 MCAPI void _setUpdated(::BlockSource& region);
121
122 MCAPI void _spawnItemSpawner(::BlockSource& region, ::Vec3 pos, ::ItemStack const& itemToSpawn);
123
124 MCAPI ::std::optional<::ActorUniqueID> _spawnMob(::BlockSource& region, ::BlockPos blockActorPos);
125
126 MCAPI void _tryRegisterNewPlayers(::BlockSource& region, ::TrialSpawner::SpawningLogicState currentState);
127
128 MCAPI void applyUpdatePacket(::CompoundTag const& tag, ::BlockSource& region);
129
130 MCAPI ::Mob* createAndAddDisplayEntity(::BlockSource& region);
131
132 MCAPI ::CompoundTag createUpdatePacket();
133
134 MCAPI ::SpawnData const* getOrCreateNextSpawnData(::Random& random);
135
136 MCAPI ::TrialSpawner::SpawningLogicState getSpawningLogicState(::BlockSource& region) const;
137
138 MCAPI void load(::CompoundTag const& data, ::TrialSpawnerConfigRegistry const& configRegistry);
139
140 MCAPI void removeDisplayEntity();
141
142 MCAPI void save(::CompoundTag& tag);
143
144 MCAPI void setEntityId(::ActorDefinitionIdentifier const& actorDefId, ::BlockSource& region);
145
146 MCAPI void tick(::BlockSource& region);
147
148#ifdef LL_PLAT_C
149 MCAPI ::Mob* tryGetOrCreateDisplayEntity(::BlockSource& region);
150#endif
151 // NOLINTEND
152
153public:
154 // static functions
155 // NOLINTBEGIN
156 MCAPI static ::std::vector<::ItemStack> _getRandomLootTableItems(
157 ::Level& level,
158 ::Random& random,
159 ::DimensionType dimensionType,
160 ::std::string const& lootTableName
161 );
162
163#ifdef LL_PLAT_C
164 MCAPI static void addSpawnParticles(::Level& level, ::Vec3 pos, bool isOminous);
165
166 MCAPI static void sendEjectItemParticles(::Level& level, ::BlockPos pos, bool isOminous);
167#endif
168 // NOLINTEND
169};
Definition BlockPos.h:21
Definition BlockSource.h:71
Definition CompoundTag.h:18
Definition ItemStack.h:24
Definition Level.h:253
Definition Mob.h:55
Definition Random.h:10
Definition SpawnData.h:15
Definition TrialSpawnerConfigRegistry.h:10
Definition TrialSpawner.h:26
Definition Vec3.h:10
Definition ActorDefinitionIdentifier.h:15
Definition ActorUniqueID.h:5
Definition DimensionType.h:5
Definition TrialSpawner.h:63
Definition TrialSpawner.h:46
Definition TrialSpawner.h:55