diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-06-28 03:20:16 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-06-28 03:21:12 +0800 |
| commit | ad4340ec49d11f7a440a6cef911e6f963fe8402f (patch) | |
| tree | d4a17da1da9bb1c68373bacbb840f179949cbd8d /default-plugin | |
| parent | c5f2df8e240a8a960f6e1540fdbf9984e8dce856 (diff) | |
| download | RoughlyEnoughItems-ad4340ec49d11f7a440a6cef911e6f963fe8402f.tar.gz RoughlyEnoughItems-ad4340ec49d11f7a440a6cef911e6f963fe8402f.tar.bz2 RoughlyEnoughItems-ad4340ec49d11f7a440a6cef911e6f963fe8402f.zip | |
Fix compile issues
Diffstat (limited to 'default-plugin')
| -rw-r--r-- | default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java index 76b6adbcc..9877363b2 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java @@ -32,6 +32,7 @@ import dev.architectury.utils.EnvExecutor; import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; +import it.unimi.dsi.fastutil.objects.Reference2ObjectMap; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; @@ -42,7 +43,6 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.tags.Tag; import net.minecraft.tags.TagKey; import org.jetbrains.annotations.ApiStatus; @@ -58,10 +58,28 @@ public class TagNodes { public static final Map<String, ResourceKey<? extends Registry<?>>> TAG_DIR_MAP = new HashMap<>(); public static final ThreadLocal<String> CURRENT_TAG_DIR = new ThreadLocal<>(); - public static final Map<String, Map<Tag<?>, RawTagData>> RAW_TAG_DATA_MAP = new ConcurrentHashMap<>(); + public static final Map<String, Map<CollectionWrapper<?>, RawTagData>> RAW_TAG_DATA_MAP = new ConcurrentHashMap<>(); public static final Map<ResourceKey<? extends Registry<?>>, Map<ResourceLocation, TagData>> TAG_DATA_MAP = new HashMap<>(); public static Map<ResourceKey<? extends Registry<?>>, Consumer<Consumer<DataResult<Map<ResourceLocation, TagData>>>>> requestedTags = new HashMap<>(); + public static class CollectionWrapper<T> { + private final Collection<T> collection; + + public CollectionWrapper(Collection<T> collection) { + this.collection = collection; + } + + @Override + public boolean equals(Object obj) { + return obj instanceof CollectionWrapper && ((CollectionWrapper) obj).collection == collection; + } + + @Override + public int hashCode() { + return System.identityHashCode(collection); + } + } + public record RawTagData(List<ResourceLocation> otherElements, List<ResourceLocation> otherTags) { } |
