fix hiding of tags with only one namespace

fixes #21
This commit is contained in:
Relentless 2022-11-21 14:41:13 +01:00
parent 3009c440e9
commit 9e0c36bf7b
No known key found for this signature in database
GPG key ID: 759D97B8C6F25265

View file

@ -25,7 +25,10 @@ public class HideHelper {
return filteredTagMap.getTags().stream().map(unifyTag -> { return filteredTagMap.getTags().stream().map(unifyTag -> {
Collection<ResourceLocation> itemsByTag = filteredTagMap.getItems(unifyTag); Collection<ResourceLocation> itemsByTag = filteredTagMap.getItems(unifyTag);
if (itemsByTag.size() <= 1) return new ArrayList<ItemStack>();
// avoid hiding single entries and tags that only contain the same namespace for all items
long namespaces = itemsByTag.stream().map(ResourceLocation::getNamespace).distinct().count();
if (namespaces <= 1) return new ArrayList<ItemStack>();
Set<ResourceLocation> replacements = itemsByTag Set<ResourceLocation> replacements = itemsByTag
.stream() .stream()