Skip to content

Commit

Permalink
Fix duplicate resource pack names
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j committed Jan 31, 2024
1 parent 43ddf42 commit 4b62d37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public static ModNioResourcePack create(String id, ModContainer mod, String subP

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void registerModPack(Consumer<ResourcePackProfile> consumer, @Nullable S
? 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),
Expand Down

0 comments on commit 4b62d37

Please sign in to comment.