[Fix] Biomes can get added multiple times to BiomeTag Registry
This commit is contained in:
parent
d48f6db59f
commit
9150a8f2a3
1 changed files with 8 additions and 0 deletions
|
@ -101,6 +101,14 @@ public class TagRegistry<T> {
|
||||||
Set<TagEntry> set = getSetForTag(tagID);
|
Set<TagEntry> set = getSetForTag(tagID);
|
||||||
for (ResourceKey<Biome> element : elements) {
|
for (ResourceKey<Biome> element : elements) {
|
||||||
ResourceLocation id = element.location();
|
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) {
|
if (id != null) {
|
||||||
set.add(TagEntry.element(id));
|
set.add(TagEntry.element(id));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue