Make ReverseTagWrapper unmodifiable, fix error in log when mods folder doesn't exist initial scan.

This commit is contained in:
LexManos committed 2019-06-16 00:47:40 -07:00
1 parent 604987a005
commit 002e29958e
2 files changed
+4 -2

No files matched your search

@@ -19,6 +19,7 @@
package net.minecraftforge.common.util;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.function.IntSupplier;
@@ -47,7 +48,7 @@ public class ReverseTagWrapper<T>
{
if (cache == null || generation != genSupplier.getAsInt())
{
this.cache = new HashSet<>(colSupplier.get().getOwningTags(target));
this.cache = Collections.unmodifiableSet(new HashSet<>(colSupplier.get().getOwningTags(target)));
this.generation = genSupplier.getAsInt();
}
return this.cache;