Fix duplicate resource pack names ()

This commit is contained in:
apple502j 2024-02-01 04:32:38 +09:00 committed by GitHub
parent 43ddf4264d
commit b66dcf78f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions
fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader

View file

@ -94,7 +94,8 @@ public class ModNioResourcePack implements ResourcePack, ModResourcePack {
if (paths.isEmpty()) return null;
ModNioResourcePack ret = new ModNioResourcePack(id, mod, paths, type, activationType, modBundled);
String packId = subPath == null ? id : id + "_" + subPath;
ModNioResourcePack ret = new ModNioResourcePack(packId, mod, paths, type, activationType, modBundled);
return ret.getNamespaces(type).isEmpty() ? null : ret;
}

View file

@ -122,7 +122,7 @@ public class ModResourcePackCreator implements ResourcePackProvider {
? Text.translatable("pack.name.fabricMod", pack.getFabricModMetadata().getName())
: Text.translatable("pack.name.fabricMod.subPack", pack.getFabricModMetadata().getName(), Text.translatable("resourcePack." + subPath + ".name"));
ResourcePackProfile profile = ResourcePackProfile.create(
subPath == null ? pack.getName() : pack.getName() + "_" + subPath,
pack.getName(),
displayName,
subPath == null,
new ModResourcePackFactory(pack),