From bdc2f52743ed98335c69296001669bf80b0d156b Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 17 Jun 2023 21:47:21 +0200 Subject: [PATCH] [Change] Make sure BlockTags are only added once --- .../org/betterx/worlds/together/tag/v3/TagRegistry.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/betterx/worlds/together/tag/v3/TagRegistry.java b/src/main/java/org/betterx/worlds/together/tag/v3/TagRegistry.java index 23c3d058..08597bf9 100644 --- a/src/main/java/org/betterx/worlds/together/tag/v3/TagRegistry.java +++ b/src/main/java/org/betterx/worlds/together/tag/v3/TagRegistry.java @@ -263,6 +263,15 @@ public class TagRegistry { Set set = getSetForTag(tagID); for (T element : elements) { ResourceLocation id = locationProvider.apply(element); + + //only add if the set doesn't already contain the element + for (TagEntry tagEntry : set) { + if (!tagEntry.elementOrTag().tag() && tagEntry.elementOrTag().id().equals(id)) { + id = null; + break; + } + } + if (id != null) { set.add(TagEntry.element(id)); }