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/client/gui/screens/controllers/PackCategory.h"
7#include "mc/deps/core/file/PathBuffer.h"
8#include "mc/deps/core/resource/ContentIdentity.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 getCustomSkinDirectoryPath() const /*override*/;
212
213 virtual ::Core::PathBuffer<::std::string> const getDevelopmentResourcePacksPath() const /*override*/;
214
215 virtual ::Core::PathBuffer<::std::string> const getDevelopmentBehaviorPacksPath() const /*override*/;
216
217 virtual ::Core::PathBuffer<::std::string> const getDevelopmentSkinPacksPath() const /*override*/;
218
219 virtual ::Core::PathBuffer<::std::string> const getTreatmentPacksPath() const /*override*/;
220
221 virtual void refreshPacks() /*override*/;
222
223 virtual ::Bedrock::Threading::Async<void> refreshPacksAsync() /*override*/;
224
225 virtual void requestReloadUserPacks() /*override*/;
226
227 virtual ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> getKeyProvider() const /*override*/;
228
229 virtual ::PackManifestFactory& getPackManifestFactory() /*override*/;
230
231 virtual ::PackSettingsFactory& getPackSettingsFactory() const /*override*/;
232
233 virtual ::PackSourceFactory& getPackSourceFactory() /*override*/;
234
235 virtual ::std::vector<::ResourcePack*> getPacksByResourceLocation(::PackOrigin type) const /*override*/;
236
237 virtual ::std::vector<::ResourcePack*> getPacksByType(::PackType type) const /*override*/;
238
239 virtual ::std::vector<::gsl::not_null<::std::shared_ptr<::ResourcePack>>>
240 getPacksByCategory(::PackCategory category) const /*override*/;
241
242 virtual void forEachPack(::std::function<void(::ResourcePack const&)> const& callback) const /*override*/;
243
244 virtual ::std::vector<::ResourceLocation> const& getInvalidPacks(::PackType type) const /*override*/;
245
246 virtual ::std::vector<::ResourceLocation> getInvalidPacks(::InvalidPacksFilterGroup const& packTypes) const
247 /*override*/;
248
249 virtual void deletePack(::ResourceLocation const& packLocation) /*override*/;
250
251 virtual void deletePackFiles(::ResourceLocation const& packLocation) /*override*/;
252
253 virtual void postDeletePack(::ResourceLocation const& packLocation) /*override*/;
254
255 virtual void untrackInvalidPack(::ResourceLocation const& packLocation) /*override*/;
256
257 virtual bool isInitialized() const /*override*/;
258
259 virtual ::ResourcePackStack createStack(::std::vector<::PackInstanceId> const& identities) /*override*/;
260
261 virtual ::Bedrock::NotNullNonOwnerPtr<::IContentSourceRepository> getContentSourceRepository() /*override*/;
262 // NOLINTEND
263
264public:
265 // member functions
266 // NOLINTBEGIN
267 MCAPI ResourcePackRepository(
268 ::gsl::not_null<::std::shared_ptr<::RepositoryPacks>> repositoryPacks,
269 ::PackManifestFactory& manifestFactory,
270 ::Bedrock::NotNullNonOwnerPtr<::IContentAccessibilityProvider> const& contentAccessibility,
271 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
272 ::Bedrock::NonOwnerPointer<::PackCommand::IPackCommandPipeline> commands,
273 ::PackSourceFactory& packSourceFactory,
274 bool initAsync,
275 ::std::unique_ptr<::IRepositoryFactory> factory
276 );
277 // NOLINTEND
278
279public:
280 // static functions
281 // NOLINTBEGIN
282#ifdef LL_PLAT_C
283 MCAPI static ::Core::PathBuffer<::std::string>
284 getDevelopmentBehaviorPacksPath(::Core::FilePathManager const& paths);
285#endif
286 // NOLINTEND
287
288public:
289 // constructor thunks
290 // NOLINTBEGIN
291 MCAPI void* $ctor(
292 ::gsl::not_null<::std::shared_ptr<::RepositoryPacks>> repositoryPacks,
293 ::PackManifestFactory& manifestFactory,
294 ::Bedrock::NotNullNonOwnerPtr<::IContentAccessibilityProvider> const& contentAccessibility,
295 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
297 ::PackSourceFactory& packSourceFactory,
298 bool initAsync,
299 ::std::unique_ptr<::IRepositoryFactory> factory
300 );
301 // NOLINTEND
302
303public:
304 // destructor thunk
305 // NOLINTBEGIN
306 MCAPI void $dtor();
307 // NOLINTEND
308
309public:
310 // virtual function thunks
311 // NOLINTBEGIN
312 MCAPI void $getResourcePacksByPackId(
313 ::std::vector<::PackInstanceId> const& packInstanceIds,
314 ::std::vector<::PackInstance>& result
315 ) const;
316
317 MCAPI ::std::shared_ptr<::ResourcePack> $getResourcePackForPackId(::PackIdVersion const& idAndVersion) const;
318
319 MCAPI ::ResourcePack* $getResourcePackOfDifferentVersionForPackId(::PackIdVersion const& idAndVersion) const;
320
321 MCAPI ::ResourcePack*
322 $getResourcePackForPackIdInPath(::PackIdVersion const& idAndVersion, ::Core::Path const& fullPath) const;
323
324 MCAPI ::ResourcePack* $getResourcePackByUUID(::mce::UUID const& id) const;
325
326 MCAPI ::ResourcePack* $getResourcePackForPackIdOwned(::PackIdVersion const& idAndVersion) const;
327
328 MCAPI ::std::shared_ptr<::ResourcePack>
329 $getResourcePackSatisfiesPackId(::PackIdVersion const& idAndVersion, bool requireOwnership) const;
330
331 MCAPI ::ResourcePack* $getResourcePackContainingModule(::PackIdVersion const& idAndVersion) const;
332
333 MCAPI ::Bedrock::Threading::Async<::std::shared_ptr<::ResourcePack>>
334 $getResourcePackInPath(::Core::Path const& path) const;
335
336 MCAPI bool $isResourcePackLoaded(::PackIdVersion const& identity, ::PackOrigin const& location);
337
338 MCFOLD ::PackSourceReport const* $getPackLoadingReport() const;
339
340 MCAPI ::std::shared_ptr<::ResourcePack> $getEditorPack() const;
341
342 MCAPI ::std::shared_ptr<::ResourcePack> $getVanillaPack() const;
343
344 MCAPI bool $setServicePacks(::std::vector<::PackIdVersion> servicePackIds);
345
346 MCAPI bool $hasServicePacks(::std::vector<::PackIdVersion> const& servicePacksIds) const;
347
348 MCAPI ::std::vector<::PackIdVersion> const& $getServicePacks() const;
349
350 MCAPI void $addServicePacksToStack(::ResourcePackStack& stack) const;
351
352 MCAPI void $addCachedResourcePacks(::std::unordered_map<::ContentIdentity, ::std::string> const* tempCacheKeys);
353
354 MCAPI void $addWorldResourcePacks(::Core::Path const& levelPath);
355
356 MCAPI void $addPremiumWorldTemplateResourcePacks(
357 ::Core::Path const& worldTemplatePath,
358 ::ContentIdentity const& premiumWorldIdentity
359 );
360
361 MCAPI void $addTempWorldTemplateResourcePacks(::mce::UUID const& worldTemplateUUID);
362
363 MCAPI void $addWorldPackSource(::Core::Path const& levelPath);
364
365 MCAPI void $addPremiumWorldTemplatePackSource(
366 ::Core::Path const& worldTemplatePath,
367 ::ContentIdentity const& premiumWorldIdentity
368 );
369
370 MCAPI void $removePacksLoadedFromCache();
371
372 MCAPI void $removePacksLoadedFromWorld();
373
374 MCAPI ::Core::PathBuffer<::std::string> const $getResourcePacksPath() const;
375
376 MCAPI ::Core::PathBuffer<::std::string> const $getBehaviorPacksPath() const;
377
378 MCAPI ::Core::PathBuffer<::std::string> const $getSkinPacksPath() const;
379
380 MCAPI ::Core::PathBuffer<::std::string> const $getCustomSkinDirectoryPath() const;
381
382 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentResourcePacksPath() const;
383
384 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentBehaviorPacksPath() const;
385
386 MCAPI ::Core::PathBuffer<::std::string> const $getDevelopmentSkinPacksPath() const;
387
388 MCAPI ::Core::PathBuffer<::std::string> const $getTreatmentPacksPath() const;
389
390 MCAPI void $refreshPacks();
391
392 MCAPI ::Bedrock::Threading::Async<void> $refreshPacksAsync();
393
394 MCAPI void $requestReloadUserPacks();
395
396 MCAPI ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> $getKeyProvider() const;
397
398 MCFOLD ::PackManifestFactory& $getPackManifestFactory();
399
400 MCFOLD ::PackSettingsFactory& $getPackSettingsFactory() const;
401
402 MCFOLD ::PackSourceFactory& $getPackSourceFactory();
403
404 MCAPI ::std::vector<::ResourcePack*> $getPacksByResourceLocation(::PackOrigin type) const;
405
406 MCAPI ::std::vector<::ResourcePack*> $getPacksByType(::PackType type) const;
407
408 MCAPI ::std::vector<::gsl::not_null<::std::shared_ptr<::ResourcePack>>>
409 $getPacksByCategory(::PackCategory category) const;
410
411 MCAPI void $forEachPack(::std::function<void(::ResourcePack const&)> const& callback) const;
412
413 MCAPI ::std::vector<::ResourceLocation> const& $getInvalidPacks(::PackType type) const;
414
415 MCAPI ::std::vector<::ResourceLocation> $getInvalidPacks(::InvalidPacksFilterGroup const& packTypes) const;
416
417 MCAPI void $deletePack(::ResourceLocation const& packLocation);
418
419 MCAPI void $deletePackFiles(::ResourceLocation const& packLocation);
420
421 MCAPI void $postDeletePack(::ResourceLocation const& packLocation);
422
423 MCAPI void $untrackInvalidPack(::ResourceLocation const& packLocation);
424
425 MCAPI bool $isInitialized() const;
426
427 MCAPI ::ResourcePackStack $createStack(::std::vector<::PackInstanceId> const& identities);
428
429 MCAPI ::Bedrock::NotNullNonOwnerPtr<::IContentSourceRepository> $getContentSourceRepository();
430
431
432 // NOLINTEND
433
434public:
435 // vftables
436 // NOLINTBEGIN
438
440 // NOLINTEND
441};
Definition NonOwnerPointer.h:9
Definition ContentIdentity.h:8
Definition FilePathManager.h:18
Definition Path.h:17
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:17
Definition PackManifestFactory.h:20
Definition PackSettingsFactory.h:24
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:57
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