From 9e0c36bf7b7e05ad2134cde4f894b885070fdc9f Mon Sep 17 00:00:00 2001 From: Relentless Date: Mon, 21 Nov 2022 14:41:13 +0100 Subject: [PATCH] fix hiding of tags with only one namespace fixes #21 --- .../java/com/almostreliable/unified/compat/HideHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/src/main/java/com/almostreliable/unified/compat/HideHelper.java b/Common/src/main/java/com/almostreliable/unified/compat/HideHelper.java index 5155e92..f7cfc4e 100644 --- a/Common/src/main/java/com/almostreliable/unified/compat/HideHelper.java +++ b/Common/src/main/java/com/almostreliable/unified/compat/HideHelper.java @@ -25,7 +25,10 @@ public class HideHelper { return filteredTagMap.getTags().stream().map(unifyTag -> { Collection itemsByTag = filteredTagMap.getItems(unifyTag); - if (itemsByTag.size() <= 1) return new ArrayList(); + + // 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(); Set replacements = itemsByTag .stream()