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