LeviLamina
Loading...
Searching...
No Matches
ResourcePackRepository.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/resource/ContentIdentity.h"
8#include "mc/deps/core/resource/PackCategory.h"
9#include "mc/deps/core/resource/PackOrigin.h"
10#include "mc/deps/core/resource/PackType.h"
11#include "mc/deps/core/threading/Async.h"
12#include "mc/deps/core/utility/NonOwnerPointer.h"
13#include "mc/resources/IContentSourceRepository.h"
14#include "mc/resources/IResourcePackRepository.h"
15#include "mc/resources/repository_loading/IRepositoryLoader.h"
16
17// auto generated forward declare list
18// clang-format off
22class InvalidPacks;
23class PackInstance;
28class RepositoryPacks;
31class ResourcePack;
34class TaskGroup;
36struct PackIdVersion;
37struct PackInstanceId;
38namespace Core { class FilePathManager; }
39namespace Core { class Path; }
40namespace PackCommand { class IPackCommandPipeline; }
41namespace RepositoryLoading { struct AllRefreshTaskData; }
42namespace RepositoryLoading { struct BuildTaskDataOptions; }
43namespace RepositoryLoading { struct VanillaPacks; }
44namespace mce { class UUID; }
45// clang-format on
46
47class ResourcePackRepository : public ::IResourcePackRepository, public ::IContentSourceRepository {
48public:
49 // ResourcePackRepository inner types declare
50 // clang-format off
52 // clang-format on
53
54 // ResourcePackRepository inner types define
55 class RepositoryLoaderImpl : public ::RepositoryLoading::IRepositoryLoader {
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 8, ::ResourcePackRepository&> mRepository;
60 // NOLINTEND
61
62 public:
63 // prevent constructor by default
64 RepositoryLoaderImpl& operator=(RepositoryLoaderImpl const&);
65 RepositoryLoaderImpl(RepositoryLoaderImpl const&);
66 RepositoryLoaderImpl();
67
68 public:
69 // virtual functions
70 // NOLINTBEGIN
71 virtual ::std::shared_ptr<::RepositoryLoading::AllRefreshTaskData>
72 buildTaskData(::RepositoryLoading::BuildTaskDataOptions const& ops) /*override*/;
73
74 virtual void applyTaskResults(::RepositoryLoading::AllRefreshTaskData&& taskData) /*override*/;
75
76 virtual ::std::shared_ptr<::RepositoryPacks const> getPacks() const /*override*/;
77
78 virtual ~RepositoryLoaderImpl() /*override*/ = default;
79 // NOLINTEND
80
81 public:
82 // virtual function thunks
83 // NOLINTBEGIN
84 MCNAPI ::std::shared_ptr<::RepositoryLoading::AllRefreshTaskData>
86
88
89 MCNAPI ::std::shared_ptr<::RepositoryPacks const> $getPacks() const;
90
91
92 // NOLINTEND
93
94 public:
95 // vftables
96 // NOLINTBEGIN
97 MCNAPI static void** $vftable();
98 // NOLINTEND
99 };
100
101public:
102 // member variables
103 // NOLINTBEGIN
104 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>> mFilePathManager;
105 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::RepositoryPacks>>> mAllResourcePacks;
106 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::InvalidPacks>>> mInvalidPacks;
107 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::IRepositoryFactory>>> mFactory;
108 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::RepositorySources>>> mSources;
109 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PackSourceReport>> mPackSourceReport;
110 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::RepositoryLoading::VanillaPacks>>> mVanillaPacks;
111 ::ll::TypedStorage<8, 24, ::std::vector<::PackIdVersion>> mServicePacks;
112 ::ll::TypedStorage<8, 8, ::PackManifestFactory&> mManifestFactory;
113 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IContentAccessibilityProvider>> mContentAccessibility;
114 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mCurrentWorldPath;
115 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mCurrentPremiumWorldTemplatePath;
116 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContentIdentity, ::std::string>> mTempCacheContentKeys;
117 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PackSettingsFactory>> mPackSettingsFactory;
118 ::ll::TypedStorage<8, 8, ::PackSourceFactory&> mPackSourceFactory;
119 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::PackCommand::IPackCommandPipeline>> mCommands;
120 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::TaskGroup>>> mTaskGroup;
121 ::ll::TypedStorage<8, 24, ::ContentIdentity> mCurrentPremiumWorldTemplateIdentity;
122 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ResourcePackRepositoryRefreshQueue>>> mRefresher;
123 // NOLINTEND
124
125public:
126 LLAPI void addCustomResourcePackPath(std::filesystem::path const& path, PackType type);
127
128public:
129 // prevent constructor by default
130 ResourcePackRepository& operator=(ResourcePackRepository const&);
131 ResourcePackRepository(ResourcePackRepository const&);
132 ResourcePackRepository();
133
134public:
135 // virtual functions
136 // NOLINTBEGIN
137 virtual ~ResourcePackRepository() /*override*/;
138
139 virtual void getResourcePacksByPackId(
140 ::std::vector<::PackInstanceId> const& packInstanceIds,
141 ::std::vector<::PackInstance>& result
142 ) const /*override*/;
143
144 virtual ::std::shared_ptr<::ResourcePack> getResourcePackForPackId(::PackIdVersion const& idAndVersion) const
145 /*override*/;
146
147 virtual ::ResourcePack* getResourcePackOfDifferentVersionForPackId(::PackIdVersion const& idAndVersion) const
148 /*override*/;
149
150 virtual ::ResourcePack*
151 getResourcePackForPackIdInPath(::PackIdVersion const& idAndVersion, ::Core::Path const& fullPath) const
152 /*override*/;
153
154 virtual ::ResourcePack* getResourcePackByUUID(::mce::UUID const& id) const /*override*/;
155
156 virtual ::ResourcePack* getResourcePackForPackIdOwned(::PackIdVersion const& idAndVersion) const /*override*/;
157
158 virtual ::std::shared_ptr<::ResourcePack>
159 getResourcePackSatisfiesPackId(::PackIdVersion const& idAndVersion, bool requireOwnership) const /*override*/;
160
161 virtual ::ResourcePack* getResourcePackContainingModule(::PackIdVersion const& idAndVersion) const /*override*/;
162
163 virtual ::Bedrock::Threading::Async<::std::shared_ptr<::ResourcePack>>
164 getResourcePackInPath(::Core::Path const& path) const /*override*/;
165
166 virtual bool isResourcePackLoaded(::PackIdVersion const& identity, ::PackOrigin const& location) /*override*/;
167
168 virtual ::PackSourceReport const* getPackLoadingReport() const /*override*/;
169
170 virtual ::std::shared_ptr<::ResourcePack> getEditorPack() const /*override*/;
171
172 virtual ::std::shared_ptr<::ResourcePack> getVanillaPack() const /*override*/;
173
174 virtual bool setServicePacks(::std::vector<::PackIdVersion> servicePackIds) /*override*/;
175
176 virtual bool hasServicePacks(::std::vector<::PackIdVersion> const& servicePacksIds) const /*override*/;
177
178 virtual ::std::vector<::PackIdVersion> const& getServicePacks() const /*override*/;
179
180 virtual void addServicePacksToStack(::ResourcePackStack& stack) const /*override*/;
181
182 virtual void
183 addCachedResourcePacks(::std::unordered_map<::ContentIdentity, ::std::string> const* tempCacheKeys) /*override*/;
184
185 virtual void addWorldResourcePacks(::Core::Path const& levelPath) /*override*/;
186
187 virtual void addPremiumWorldTemplateResourcePacks(
188 ::Core::Path const& worldTemplatePath,
189 ::ContentIdentity const& premiumWorldIdentity
190 ) /*override*/;
191
192 virtual void addTempWorldTemplateResourcePacks(::mce::UUID const& worldTemplateUUID) /*override*/;
193
194 virtual void addWorldPackSource(::Core::Path const& levelPath) /*override*/;
195
196 virtual void addPremiumWorldTemplatePackSource(
197 ::Core::Path const& worldTemplatePath,
198 ::ContentIdentity const& premiumWorldIdentity
199 ) /*override*/;
200
201 virtual void removePacksLoadedFromCache() /*override*/;
202
203 virtual void removePacksLoadedFromWorld() /*override*/;
204
205 virtual ::Core::PathBuffer<::std::string> const getResourcePacksPath() const /*override*/;
206
207 virtual ::Core::PathBuffer<::std::string> const getBehaviorPacksPath() const /*override*/;
208
209 virtual ::Core::PathBuffer<::std::string> const getSkinPacksPath() const /*override*/;
210
211 virtual ::Core::PathBuffer<::std::string> const getDevelopmentResourcePacksPath() const /*override*/;
212
213 virtual ::Core::PathBuffer<::std::string> const getDevelopmentBehaviorPacksPath() const /*override*/;
214
215 virtual ::Core::PathBuffer<::std::string> const getDevelopmentSkinPacksPath() const /*override*/;
216
217 virtual ::Core::PathBuffer<::std::string> const getTreatmentPacksPath() const /*override*/;
218
219 virtual void refreshPacks() /*override*/;
220
221 virtual ::Bedrock::Threading::Async<void> refreshPacksAsync() /*override*/;
222
223 virtual void requestReloadUserPacks() /*override*/;
224
225 virtual ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> getKeyProvider() const /*override*/;
226
227 virtual ::PackManifestFactory& getPackManifestFactory() /*override*/;
228
229 virtual ::PackSettingsFactory& getPackSettingsFactory() const /*override*/;
230
231 virtual ::PackSourceFactory& getPackSourceFactory() /*override*/;
232
233 virtual ::std::vector<::ResourcePack*> getPacksByResourceLocation(::PackOrigin type) const /*override*/;
234
235 virtual ::std::vector<::ResourcePack*> getPacksByType(::PackType type) const /*override*/;
236
237 virtual ::std::vector<::gsl::not_null<::std::shared_ptr<::ResourcePack>>>
238 getPacksByCategory(::PackCategory category) const /*override*/;
239
240 virtual void forEachPack(::std::function<void(::ResourcePack const&)> const& callback) const /*override*/;
241
242 virtual ::std::vector<::ResourceLocation> const& getInvalidPacks(::PackType type) const /*override*/;
243
244 virtual ::std::vector<::ResourceLocation> getInvalidPacks(::InvalidPacksFilterGroup const& packTypes) const
245 /*override*/;
246
247 virtual void deletePack(::ResourceLocation const& packLocation) /*override*/;
248
249 virtual void deletePackFiles(::ResourceLocation const& packLocation) /*override*/;
250
251 virtual void postDeletePack(::ResourceLocation const& packLocation) /*override*/;
252
253 virtual void untrackInvalidPack(::ResourceLocation const& packLocation) /*override*/;
254
255 virtual bool isInitialized() const /*override*/;
256
257 virtual ::ResourcePackStack createStack(::std::vector<::PackInstanceId> const& identities) /*override*/;
258
259 virtual ::Bedrock::NotNullNonOwnerPtr<::IContentSourceRepository> getContentSourceRepository() /*override*/;
260 // NOLINTEND
261
262public:
263 // member functions
264 // NOLINTBEGIN
265 MCAPI ResourcePackRepository(
266 ::gsl::not_null<::std::shared_ptr<::RepositoryPacks>> repositoryPacks,
267 ::PackManifestFactory& manifestFactory,
268 ::Bedrock::NotNullNonOwnerPtr<::IContentAccessibilityProvider> const& contentAccessibility,
269 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
270 ::Bedrock::NonOwnerPointer<::PackCommand::IPackCommandPipeline> commands,
271 ::PackSourceFactory& packSourceFactory,
272 bool initAsync,
273 ::std::unique_ptr<::IRepositoryFactory> factory
274 );
275 // NOLINTEND
276
277public:
278 // constructor thunks
279 // NOLINTBEGIN
280 MCAPI void* $ctor(
281 ::gsl::not_null<::std::shared_ptr<::RepositoryPacks>> repositoryPacks,
282 ::PackManifestFactory& manifestFactory,
283 ::Bedrock::NotNullNonOwnerPtr<::IContentAccessibilityProvider> const& contentAccessibility,
284 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
285 ::Bedrock::NonOwnerPointer<::PackCommand::IPackCommandPipeline> commands,
286 ::PackSourceFactory& packSourceFactory,
287 bool initAsync,
288 ::std::unique_ptr<::IRepositoryFactory> factory
289 );
290 // NOLINTEND
291
292public:
293 // destructor thunk
294 // NOLINTBEGIN
295 MCAPI void $dtor();
296 // NOLINTEND
297
298public:
299 // virtual function thunks
300 // NOLINTBEGIN
301 MCAPI void $getResourcePacksByPackId(
302 ::std::vector<::PackInstanceId> const& packInstanceIds,
303 ::std::vector<::PackInstance>& result
304 ) const;
305
306 MCAPI ::std::shared_ptr<::ResourcePack> $getResourcePackForPackId(::PackIdVersion const& idAndVersion) const;
307
308 MCAPI ::ResourcePack* $getResourcePackOfDifferentVersionForPackId(::PackIdVersion const& idAndVersion) const;
309
310 MCAPI ::ResourcePack*
311 $getResourcePackForPackIdInPath(::PackIdVersion const& idAndVersion, ::Core::Path const& fullPath) const;
312
313 MCAPI ::ResourcePack* $getResourcePackByUUID(::mce::UUID const& id) const;
314
315 MCAPI ::ResourcePack* $getResourcePackForPackIdOwned(::PackIdVersion const& idAndVersion) const;
316
317 MCAPI ::std::shared_ptr<::ResourcePack>
318 $getResourcePackSatisfiesPackId(::PackIdVersion const& idAndVersion, bool requireOwnership) const;
319
320 MCAPI ::ResourcePack* $getResourcePackContainingModule(::PackIdVersion const& idAndVersion) const;
321
322 MCAPI ::Bedrock::Threading::Async<::std::shared_ptr<::ResourcePack>>
323 $getResourcePackInPath(::Core::Path const& path) const;
324
325 MCAPI bool $isResourcePackLoaded(::PackIdVersion const& identity, ::PackOrigin const& location);
326
327 MCFOLD ::PackSourceReport const* $getPackLoadingReport() const;
328
329 MCAPI ::std::shared_ptr<::ResourcePack> $getEditorPack() const;
330
331 MCAPI ::std::shared_ptr<::ResourcePack> $getVanillaPack() const;
332
333 MCAPI bool $setServicePacks(::std::vector<::PackIdVersion> servicePackIds);
334
335 MCAPI bool $hasServicePacks(::std::vector<::PackIdVersion> const& servicePacksIds) const;
336
337 MCFOLD ::std::vector<::PackIdVersion> const& $getServicePacks() const;
338
339 MCAPI void $addServicePacksToStack(::ResourcePackStack& stack) const;
340
341 MCAPI void $addCachedResourcePacks(::std::unordered_map<::ContentIdentity, ::std::string> const* tempCacheKeys);
342
343 MCAPI void $addWorldResourcePacks(::Core::Path const& levelPath);
344
345 MCAPI void $addPremiumWorldTemplateResourcePacks(
346 ::Core::Path const& worldTemplatePath,
347 ::ContentIdentity const& premiumWorldIdentity
348 );
349
350 MCAPI void $addTempWorldTemplateResourcePacks(::mce::UUID const& worldTemplateUUID);
351
352 MCAPI void $addWorldPackSource(::Core::Path const& levelPath);
353
354 MCAPI void $addPremiumWorldTemplatePackSource(
355 ::Core::Path const& worldTemplatePath,
356 ::ContentIdentity const& premiumWorldIdentity
357 );
358
359 MCAPI void $removePacksLoadedFromCache();
360
361 MCAPI void $removePacksLoadedFromWorld();
362
363 MCAPI ::Core::PathBuffer<::std::string> const $getResourcePacksPath() const;
364
365 MCAPI ::Core::PathBuffer<::std::string> const $getBehaviorPacksPath() const;
366
367 MCAPI ::Core::PathBuffer<::std::string> const $getSkinPacksPath() const;
368
369 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentResourcePacksPath() const;
370
371 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentBehaviorPacksPath() const;
372
373 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentSkinPacksPath() const;
374
375 MCAPI ::Core::PathBuffer<::std::string> const $getTreatmentPacksPath() const;
376
377 MCAPI void $refreshPacks();
378
379 MCAPI ::Bedrock::Threading::Async<void> $refreshPacksAsync();
380
381 MCAPI void $requestReloadUserPacks();
382
383 MCAPI ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> $getKeyProvider() const;
384
385 MCFOLD ::PackManifestFactory& $getPackManifestFactory();
386
387 MCFOLD ::PackSettingsFactory& $getPackSettingsFactory() const;
388
389 MCFOLD ::PackSourceFactory& $getPackSourceFactory();
390
391 MCAPI ::std::vector<::ResourcePack*> $getPacksByResourceLocation(::PackOrigin type) const;
392
393 MCAPI ::std::vector<::ResourcePack*> $getPacksByType(::PackType type) const;
394
395 MCAPI ::std::vector<::gsl::not_null<::std::shared_ptr<::ResourcePack>>>
396 $getPacksByCategory(::PackCategory category) const;
397
398 MCAPI void $forEachPack(::std::function<void(::ResourcePack const&)> const& callback) const;
399
400 MCAPI ::std::vector<::ResourceLocation> const& $getInvalidPacks(::PackType type) const;
401
402 MCAPI ::std::vector<::ResourceLocation> $getInvalidPacks(::InvalidPacksFilterGroup const& packTypes) const;
403
404 MCAPI void $deletePack(::ResourceLocation const& packLocation);
405
406 MCAPI void $deletePackFiles(::ResourceLocation const& packLocation);
407
408 MCAPI void $postDeletePack(::ResourceLocation const& packLocation);
409
410 MCAPI void $untrackInvalidPack(::ResourceLocation const& packLocation);
411
412 MCAPI bool $isInitialized() const;
413
414 MCAPI ::ResourcePackStack $createStack(::std::vector<::PackInstanceId> const& identities);
415
416 MCAPI ::Bedrock::NotNullNonOwnerPtr<::IContentSourceRepository> $getContentSourceRepository();
417
418
419 // NOLINTEND
420
421public:
422 // vftables
423 // NOLINTBEGIN
425
427 // NOLINTEND
428};
Definition ContentIdentity.h:8
Definition FilePathManager.h:18
Definition Path.h:10
Definition IContentAccessibilityProvider.h:13
Definition IContentKeyProvider.h:13
Definition IContentSourceRepository.h:13
Definition IRepositoryFactory.h:12
Definition IResourcePackRepository.h:34
Definition InvalidPacks.h:10
Definition IPackCommandPipeline.h:19
Definition PackInstance.h:16
Definition PackManifestFactory.h:20
Definition PackSettingsFactory.h:23
Definition PackSourceFactory.h:33
Definition PackSourceReport.h:11
Definition Path.h:16
Definition IRepositoryLoader.h:14
Definition RepositoryPacks.h:20
Definition RepositorySources.h:13
Definition ResourceLocation.h:15
Definition ResourcePackRepositoryRefreshQueue.h:15
Definition ResourcePackRepository.h:55
MCAPI ::std::shared_ptr<::RepositoryPacks const > $getPacks() const
MCAPI void $applyTaskResults(::RepositoryLoading::AllRefreshTaskData &&taskData)
MCAPI ::std::shared_ptr<::RepositoryLoading::AllRefreshTaskData > $buildTaskData(::RepositoryLoading::BuildTaskDataOptions const &ops)
static MCAPI void ** $vftableForIContentSourceRepository()
static MCAPI void ** $vftableForIResourcePackRepository()
Definition ResourcePackStack.h:25
Definition ResourcePack.h:21
Definition TaskGroup.h:53
Definition UUID.h:7
STL namespace.
Definition InvalidPacksFilterGroup.h:5
Definition PackIdVersion.h:10
Definition PackInstanceId.h:8
Definition AllRefreshTaskData.h:7
Definition BuildTaskDataOptions.h:7
Definition VanillaPacks.h:7