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