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