36class ResourcePackManager :
public ::ResourceLoader {
40 ::ll::TypedStorage<8, 64, ::std::unordered_set<::gsl::not_null<::ResourcePackListener*>>> mListeners;
41 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mLevelStack;
42 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mGlobalStack;
43 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mTreatmentStack;
44 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mBaseGameStack;
45 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackStack>> mFullStack;
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PackSourceReport>> mLoadingReport;
47 ::ll::TypedStorage<8, 32, ::std::string> mLocaleCode;
48 ::ll::TypedStorage<1, 1, bool> mInitializing;
49 ::ll::TypedStorage<1, 1, bool> mPendingRestack;
50 ::ll::TypedStorage<1, 1, bool> mUseGlobalPackStack;
51 ::ll::TypedStorage<1, 1, bool> mGameplayResourcesLoaded;
52 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mFullStackAccess;
53 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>> mContentTierManager;
54 ::ll::TypedStorage<8, 24, ::SemVersion> mFullStackMinEngineVersion_DEPRECATED_DONOTUSE;
59 ResourcePackManager();
64 virtual ~ResourcePackManager() =
default;
66 virtual bool load(
::ResourceLocation const& resourceLocation, ::std::string& resourceStream)
const ;
70 ::std::string& resourceStream,
71 ::gsl::span<::std::string const> extensionList
76 ::std::string& resourceStream,
77 ::gsl::span<::std::string const> extensionList
80 virtual bool loadText(
::ResourceLocation const& resourceLocation, ::std::string& resourceStream)
const ;
82 virtual ::std::vector<::LoadedResourceData> loadAllVersionsOf(
::ResourceLocation const& resourceLocation)
const
89 virtual bool isInStreamableLocation(
::ResourceLocation const& resourceLocation)
const ;
91 virtual bool isInStreamableLocation(
93 ::gsl::span<::std::string const> extensionList
96 virtual ::Core::PathBuffer<::std::string> getPath(
::ResourceLocation const& resourceLocation)
const ;
98 virtual ::Core::PathBuffer<::std::string>
99 getPath(
::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList)
const
102 virtual ::Core::PathBuffer<::std::string>
105 virtual ::Core::PathBuffer<::std::string> getPathContainingResource(
107 ::gsl::span<::std::string const> extensionList
110 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
112 ::gsl::span<::std::string const> extensionList
115 virtual bool hasCapability(::std::string_view requiredCapability)
const;
121 MCAPI ResourcePackManager(
123 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>
const& contentTierManager,
124 bool needsToInitialize
127 MCAPI
void _calculateMinEngineVersionFromFullStack();
129 MCAPI
void _composeFullStack();
131 MCAPI
bool _doStackOperation(
132 ::ResourcePackStackType stackType,
136 MCAPI
void _updateLanguageSubpacks();
139 MCAPI ::ContentTierIncompatibleReason canSupportPacks();
142 MCAPI
int composeFullStack(
149 MCAPI
void ensureSupportedSubpacks();
151 MCAPI ::std::vector<::ResourceLocationPair> findAllTexturesInUse()
const;
153 MCAPI ::std::vector<::PackIdVersion> findInPacks(
::ResourceLocation const& resourceLocation)
const;
157 MCAPI ::SemVersion getFullStackMinEngineVersion_DEPRECATED()
const;
159 MCAPI ::std::vector<::PackInstance> getIncompatiblePacks()
const;
162 MCAPI ::std::vector<::PackInstance> getPacksWhereAssetExtractionNotViable(
164 ::std::string
const& sourceContext
167 MCAPI ::ResourceGroup getResourcesOfGroup(::std::string
const& group)
const;
169 MCAPI ::ResourceGroup getResourcesOfGroup(
::PackInstance const& packInstance, ::std::string
const& group)
const;
172 MCAPI ::std::optional<::StreamableAssetSource> getStreamableSource(
174 ::gsl::span<::std::string const> extensionList,
175 ::std::optional<::Core::PathView> tempDirectory
179 hasResource(
::ResourceLocation const& resourceLocation, ::std::optional<::mce::UUID>
const& packIdToMatch)
const;
181 MCAPI
bool hasResource(
184 ::gsl::span<::std::string const> extensionList
188 MCAPI
bool isAssetExtractionViableForFullStack(
190 ::std::string
const& sourceContext
193 MCAPI
void iteratePacks(::std::function<
void(
::PackInstance const&)>
const& pred)
const;
198 ::std::string& resourceStream,
199 ::std::optional<::mce::UUID> packId
202 MCAPI
void onLanguageChanged();
204 MCAPI
void releasePreloadCacheHandles();
207 MCAPI
void removeIf(::std::function<
bool(
::PackInstance const&)>
const& pred);
210 MCAPI
void removePacks(::std::vector<::gsl::not_null<::ResourcePack const*>>
const& packs);
212 MCAPI
void removeUnsupportedPacks();
217 MCAPI
bool setStack(::std::unique_ptr<::ResourcePackStack> stack, ::ResourcePackStackType stackType);
223 MCAPI
static void _getResourcesOfGroup(
225 ::std::string
const& group,
226 ::std::vector<::Core::Path>& resources
235 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>
const& contentTierManager,
236 bool needsToInitialize
243 MCAPI
bool $load(
::ResourceLocation const& resourceLocation, ::std::string& resourceStream)
const;
247 ::std::string& resourceStream,
248 ::gsl::span<::std::string const> extensionList
253 ::std::string& resourceStream,
254 ::gsl::span<::std::string const> extensionList
257 MCAPI
bool $loadText(
::ResourceLocation const& resourceLocation, ::std::string& resourceStream)
const;
259 MCAPI ::std::vector<::LoadedResourceData> $loadAllVersionsOf(
::ResourceLocation const& resourceLocation)
const;
263 MCAPI
bool $isInStreamableLocation(
265 ::gsl::span<::std::string const> extensionList
268 MCAPI ::Core::PathBuffer<::std::string> $getPath(
::ResourceLocation const& resourceLocation)
const;
270 MCAPI ::Core::PathBuffer<::std::string>
271 $getPath(
::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList)
const;
273 MCAPI ::Core::PathBuffer<::std::string>
276 MCAPI ::Core::PathBuffer<::std::string> $getPathContainingResource(
278 ::gsl::span<::std::string const> extensionList
281 MCAPI ::std::pair<int, ::std::string_view> $getPackStackIndexOfResource(
283 ::gsl::span<::std::string const> extensionList
286 MCAPI
bool $hasCapability(::std::string_view requiredCapability)
const;