Search in sources :

Example 1 with ModuleItems

use of binnie.genetics.item.ModuleItems in project Binnie by ForestryMC.

the class GeneticsJeiPlugin method registerItemSubtypes.

@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
    ModuleItems items = Genetics.items();
    List<Item> chargeables = Arrays.asList(items.itemSequencer, items.itemSerum, items.itemSerumArray);
    ChargeableSubtypeInterpreter chargeableSubtypeInterpreter = new ChargeableSubtypeInterpreter();
    for (Item chargeable : chargeables) {
        subtypeRegistry.registerSubtypeInterpreter(chargeable, chargeableSubtypeInterpreter);
    }
}
Also used : Item(net.minecraft.item.Item) ModuleItems(binnie.genetics.item.ModuleItems)

Example 2 with ModuleItems

use of binnie.genetics.item.ModuleItems in project Binnie by ForestryMC.

the class DatabaseRecipeMaker method create.

public static List<DatabaseRecipeWrapper> create() {
    List<DatabaseRecipeWrapper> recipes = new ArrayList<>();
    ModuleItems items = Genetics.items();
    {
        ItemStack emptySerum = GeneticsItems.EMPTY_SERUM.get(1);
        ItemStack resultSerum = new ItemStack(items.itemSerum, 1, OreDictionary.WILDCARD_VALUE);
        IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
        List<ItemStack> subtypes = stackHelper.toItemStackList(resultSerum);
        List<ItemStack> resultSerums = new ArrayList<>();
        for (ItemStack subtype : subtypes) {
            subtype = subtype.copy();
            subtype.setItemDamage(subtype.getMaxDamage());
            resultSerums.add(subtype);
        }
        recipes.add(new DatabaseRecipeWrapper(emptySerum, resultSerums));
    }
    {
        ItemStack emptySerumArray = GeneticsItems.EMPTY_GENOME.get(1);
        ItemStack resultSerumArray = new ItemStack(items.itemSerumArray, 1, OreDictionary.WILDCARD_VALUE);
        IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
        List<ItemStack> subtypes = stackHelper.toItemStackList(resultSerumArray);
        List<ItemStack> resultSerumArrays = new ArrayList<>();
        for (ItemStack subtype : subtypes) {
            subtype = subtype.copy();
            subtype.setItemDamage(subtype.getMaxDamage());
            resultSerumArrays.add(subtype);
        }
        recipes.add(new DatabaseRecipeWrapper(emptySerumArray, resultSerumArrays));
    }
    return recipes;
}
Also used : ArrayList(java.util.ArrayList) ModuleItems(binnie.genetics.item.ModuleItems) List(java.util.List) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) IStackHelper(mezz.jei.api.recipe.IStackHelper)

Aggregations

ModuleItems (binnie.genetics.item.ModuleItems)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 IStackHelper (mezz.jei.api.recipe.IStackHelper)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1