Fix duplicate resource pack names (#3557)

(cherry picked from commit b66dcf78f1)
This commit is contained in:
apple502j 2024-02-01 04:32:38 +09:00 committed by modmuss50
parent f3561f053e
commit ac6e104df9
2 changed files with 3 additions and 2 deletions

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),