From 9150a8f2a3f4f5011af53033364479f375eab98b Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 8 Jun 2023 02:17:51 +0200 Subject: [PATCH] [Fix] Biomes can get added multiple times to BiomeTag Registry --- .../org/betterx/worlds/together/tag/v3/TagRegistry.java | 8 ++++++++ 1 file changed, 8 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 5c145dd3..5c95d2af 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 @@ -101,6 +101,14 @@ public class TagRegistry { Set set = getSetForTag(tagID); for (ResourceKey element : elements) { ResourceLocation id = element.location(); + + //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)); }