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