LeviLamina
Loading...
Searching...
No Matches
BedrockSpawner.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/SpawnSettings.h"
7#include "mc/world/level/Spawner.h"
8#include "mc/world/level/spawn/SpawnPlacements.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
14class BlockPos;
15class BlockSource;
16class ChunkPos;
17class HashedString;
20class ItemActor;
21class ItemStack;
22class Level;
24class Mob;
25class MobSpawnRules;
26class MobSpawnerData;
27class Random;
28class Randomize;
30class SpawnConditions;
32class Vec3;
34struct ActorUniqueID;
35struct MobSpawnHerdInfo;
36namespace br::spawn { class EntityTypeCache; }
37// clang-format on
38
39class BedrockSpawner : public ::Spawner {
40public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<8, 8, ::Level&> mLevel;
44 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
45 ::ll::TypedStorage<8, 48, ::SpawnSettings> mSpawnSettings;
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ActorSpawnRuleGroup>> mActorSpawnRules;
47 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SpawnGroupRegistry>> mSpawnGroupRegistry;
48 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::br::spawn::EntityTypeCache>> mEntityTypeCache;
49 ::ll::TypedStorage<8, 272, ::br::spawn::SpawnPlacements> mSpawnPlacements;
50 ::ll::TypedStorage<4, 56, int[2][7]> mBaseTypeCount;
51 ::ll::TypedStorage<8, 128, ::std::unordered_map<::HashedString, int>[2]> mEntityTypeCount;
52 ::ll::TypedStorage<4, 4, int> mTotalEntityCount;
53 ::ll::TypedStorage<4, 4, uint> mSpawnableMobTickCount;
54 ::ll::TypedStorage<4, 4, uint> mSpawnableMobTickCountPrevious;
55 // NOLINTEND
56
57public:
58 // prevent constructor by default
59 BedrockSpawner& operator=(BedrockSpawner const&);
62
63public:
64 // virtual functions
65 // NOLINTBEGIN
66 // vIndex: 0
67 virtual ~BedrockSpawner() /*override*/ = default;
68
69 // vIndex: 1
70 virtual void initializeServerSide(::ResourcePackManager& rpm, ::IWorldRegistriesProvider& registries) /*override*/;
71
72 // vIndex: 2
73 virtual ::SpawnSettings const& getSpawnSettings() const /*override*/;
74
75 // vIndex: 3
76 virtual void setSpawnSettings(::SpawnSettings const& spawnSettings) /*override*/;
77
78 // vIndex: 4
79 virtual ::ActorSpawnRuleGroup const* getSpawnRules() const /*override*/;
80
81 // vIndex: 5
82 virtual ::ActorSpawnRuleGroup* getSpawnRulesMutable() const /*override*/;
83
84 // vIndex: 6
85 virtual ::SpawnGroupRegistry const* getSpawnGroupRegistry() const /*override*/;
86
87 // vIndex: 7
88 virtual ::br::spawn::EntityTypeCache* getEntityTypeCache() const /*override*/;
89
90 // vIndex: 9
91 virtual ::ItemActor* spawnItem(
92 ::BlockSource& region,
93 ::ItemStack const& inst,
94 ::Actor* spawner,
95 ::Vec3 const& pos,
96 int throwTime
97 ) /*override*/;
98
99 // vIndex: 11
100 virtual void postProcessSpawnMobs(::BlockSource& region, int xo, int zo, ::Random& random) /*override*/;
101
102 // vIndex: 12
103 virtual void tick(
104 ::BlockSource& region,
105 ::LevelChunkVolumeData const& levelChunkVolumeData,
106 ::ChunkPos const chunkPos
107 ) /*override*/;
108
109 // vIndex: 13
110 virtual void tickMobCount() /*override*/;
111
112 // vIndex: 14
113 virtual void incrementSpawnableTickedMob() /*override*/;
114
115 // vIndex: 15
116 virtual uint getSpawnableTickedMobCountPrevious() const /*override*/;
117
118 // vIndex: 16
119 virtual ::std::unordered_set<::ActorUniqueID> spawnMobGroup(
120 ::BlockSource& region,
121 ::std::string const& spawnGroupId,
122 ::Vec3 const& pos,
123 bool doScatter,
124 bool validateDistToPlayer,
125 ::std::function<void(::Mob&)>&& spawnedCallback
126 ) /*override*/;
127
128 // vIndex: 17
129 virtual ::br::spawn::SpawnPlacements& getSpawnPlacements() /*override*/;
130 // NOLINTEND
131
132public:
133 // member functions
134 // NOLINTBEGIN
135 MCAPI int
136 _handlePopulationCap(::MobSpawnerData const* mobType, ::SpawnConditions const& conditions, int inSpawnCount);
137
138 MCAPI void _postProcessSpawnMobs(
139 ::BlockSource& region,
140 int xo,
141 int zo,
142 ::Randomize& randomize,
143 bool doMobSpawning,
144 ::std::function<void(::BlockPos const&, ::SpawnConditions&)> const& spawnMobClusterCallback,
145 ::std::function<bool(::BlockSource const&, ::BlockPos)> const& isInsideAncientCity
146 );
147
148 MCAPI void _sendHerdEvents(::MobSpawnHerdInfo const& herdInfo, ::std::vector<::Mob*>& spawnGroup) const;
149
150 MCAPI void _spawnMobCluster(::BlockSource& region, ::BlockPos const& pos, ::SpawnConditions& conditions);
151
152 MCAPI void _spawnMobInCluster(
153 ::BlockSource& region,
155 ::BlockPos const& pos,
156 ::SpawnConditions const& conditions,
157 ::std::vector<::Mob*>& spawnGroup
158 );
159
160 MCAPI void _updateBaseTypeCount(::BlockSource& region, ::ChunkPos const& center);
161
162 MCAPI void _updateGroupPersistence(::MobSpawnRules const& spawnRules, ::std::vector<::Mob*> const& spawnGroup);
163 // NOLINTEND
164
165public:
166 // static functions
167 // NOLINTBEGIN
168 MCAPI static bool _isInsideAncientCity(::BlockSource const& region, ::BlockPos pos);
169 // NOLINTEND
170
171public:
172 // static variables
173 // NOLINTBEGIN
174 MCAPI static ::std::unordered_set<::ChunkPos> const& SPAWN_RING_OFFSETS();
175 // NOLINTEND
176
177public:
178 // virtual function thunks
179 // NOLINTBEGIN
180 MCAPI void $initializeServerSide(::ResourcePackManager& rpm, ::IWorldRegistriesProvider& registries);
181
182 MCFOLD ::SpawnSettings const& $getSpawnSettings() const;
183
184 MCAPI void $setSpawnSettings(::SpawnSettings const& spawnSettings);
185
186 MCFOLD ::ActorSpawnRuleGroup const* $getSpawnRules() const;
187
188 MCFOLD ::ActorSpawnRuleGroup* $getSpawnRulesMutable() const;
189
190 MCFOLD ::SpawnGroupRegistry const* $getSpawnGroupRegistry() const;
191
192 MCFOLD ::br::spawn::EntityTypeCache* $getEntityTypeCache() const;
193
194 MCAPI ::ItemActor*
195 $spawnItem(::BlockSource& region, ::ItemStack const& inst, ::Actor* spawner, ::Vec3 const& pos, int throwTime);
196
197 MCAPI void $postProcessSpawnMobs(::BlockSource& region, int xo, int zo, ::Random& random);
198
199 MCAPI void
200 $tick(::BlockSource& region, ::LevelChunkVolumeData const& levelChunkVolumeData, ::ChunkPos const chunkPos);
201
202 MCAPI void $tickMobCount();
203
204 MCAPI void $incrementSpawnableTickedMob();
205
206 MCAPI uint $getSpawnableTickedMobCountPrevious() const;
207
208 MCAPI ::std::unordered_set<::ActorUniqueID> $spawnMobGroup(
209 ::BlockSource& region,
210 ::std::string const& spawnGroupId,
211 ::Vec3 const& pos,
212 bool doScatter,
213 bool validateDistToPlayer,
214 ::std::function<void(::Mob&)>&& spawnedCallback
215 );
216
217 MCFOLD ::br::spawn::SpawnPlacements& $getSpawnPlacements();
218 // NOLINTEND
219
220public:
221 // vftables
222 // NOLINTBEGIN
223 MCNAPI static void** $vftable();
224 // NOLINTEND
225};
Definition ActorSpawnRuleGroup.h:18
Definition Actor.h:102
Definition BedrockSpawner.h:39
static MCAPI void ** $vftable()
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition ChunkPos.h:11
Definition HashedString.h:5
Definition IMinecraftEventing.h:147
Definition IWorldRegistriesProvider.h:26
Definition ItemActor.h:27
Definition ItemStack.h:23
Definition LevelChunkVolumeData.h:18
Definition Level.h:243
Definition MobSpawnRules.h:21
Definition MobSpawnerData.h:17
Definition Mob.h:47
Definition Random.h:10
Definition Randomize.h:13
Definition ResourcePackManager.h:24
Definition SpawnConditions.h:8
Definition SpawnGroupRegistry.h:19
Definition Spawner.h:40
Definition Vec3.h:10
Definition ActorDefinitionIdentifier.h:15
Definition ActorUniqueID.h:5
Definition MobSpawnHerdInfo.h:5
Definition SpawnSettings.h:14