package org.embeddedt.modernfix.util; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.core.Holder; import net.minecraft.world.item.Item; import net.minecraftforge.registries.ForgeRegistries; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Map; import java.util.Set; import java.util.function.Function; public class ItemMesherMap implements Map, ModelResourceLocation> { private final Function getLocation; public ItemMesherMap(Function getLocation) { this.getLocation = getLocation; } @Override public int size() { return ForgeRegistries.ITEMS.getValues().size(); } @Override public boolean isEmpty() { return false; } @Override public boolean containsKey(Object key) { return true; } @Override public boolean containsValue(Object value) { return false; } @Override public ModelResourceLocation get(Object key) { return getLocation.apply(((Holder.Reference)key).get()); } @Nullable @Override public ModelResourceLocation put(Holder.Reference key, ModelResourceLocation value) { throw new UnsupportedOperationException(); } @Override public ModelResourceLocation remove(Object key) { throw new UnsupportedOperationException(); } @Override public void putAll(@NotNull Map, ? extends ModelResourceLocation> m) { throw new UnsupportedOperationException(); } @Override public void clear() { throw new UnsupportedOperationException(); } @NotNull @Override public Set> keySet() { throw new UnsupportedOperationException(); } @NotNull @Override public Collection values() { throw new UnsupportedOperationException(); } @NotNull @Override public Set, ModelResourceLocation>> entrySet() { throw new UnsupportedOperationException(); } }