@@ -0,0 +1,2460 @@
+/******************************************************************************%0A * Copyright (c) CovertJaguar, 2011-2016                                      *%0A * *%0A * This work (the API) is licensed under the %22MIT%22 License,                   *%0A * see LICENSE.md for details.                                                *%0A ******************************************************************************/%0A%0Apackage mods.railcraft.api.core.items;%0A%0Aimport net.minecraft.item.ItemStack;%0Aimport net.minecraftforge.fml.common.Loader;%0A%0Aimport javax.annotation.Nonnull;%0Aimport javax.annotation.Nullable;%0Aimport java.util.*;%0A%0A/**%0A * This class provides a method to acquire ItemStacks for Railcraft objects.%0A * %3Cp/%3E%0A * The tags are generally similar to the ones you might find in the Blocks/Items/Localization config files.%0A * %3Cp/%3E%0A * Ex. ItemStack stack = getStack(%22signal.box.capacitor%22);%0A * %3Cp/%3E%0A * Created by CovertJaguar on 3/3/2016.%0A */%0Apublic class RailcraftItemRegistry %7B%0A    private static final SortedSet%3CString%3E tags = new TreeSet%3CString%3E();%0A    private static final SortedSet%3CString%3E tagsImmutable = Collections.unmodifiableSortedSet(tags);%0A    private static final Map%3CString, ItemStack%3E stacks = new HashMap%3CString, ItemStack%3E();%0A%0A    private RailcraftItemRegistry() %7B%0A    %7D%0A%0A    /**%0A     * This should only be called by Railcraft. It will throw an exception if called during another mod's load sequence.%0A     */%0A    public static void register(String tag, @Nonnull ItemStack stack) %7B%0A        stack = Objects.requireNonNull(stack, %22Registered ItemStacks cannot be null.%22);%0A        if (!%22Railcraft%22.equals(Loader.instance().activeModContainer().getModId()))%0A            throw new RuntimeException(%22Only Railcraft can register Railcraft ItemStack, if you see this message there is probably a bug.%22);%0A        stacks.put(tag, stack);%0A        tags.add(tag);%0A    %7D%0A%0A    @Nullable%0A    public static ItemStack getStack(@Nonnull String tag) %7B%0A        return getStack(tag, 1);%0A    %7D%0A%0A    @Nullable%0A    public static ItemStack getStack(@Nonnull String tag, int qty) %7B%0A        ItemStack stack = stacks.get(tag);%0A        if (stack != null) %7B%0A            stack = stack.copy();%0A            stack.stackSize = Math.min(qty, stack.getMaxStackSize());%0A            return stack;%0A        %7D%0A        return null;%0A    %7D%0A%0A    /**%0A     * Returns a sorted list of tags that have entries.%0A     */%0A    public static SortedSet%3CString%3E getTags() %7B%0A        return tagsImmutable;%0A    %7D%0A%7D%0A

Add an ItemStack registry to the API (since Forge deleted theirs).