Search in sources :

Example 1 with WrapperItem

use of minechem.item.prefab.WrapperItem in project Minechem by iopleke.

the class WrapperRecipe method getCraftingResult.

@Override
public ItemStack getCraftingResult(InventoryCrafting crafting) {
    ItemStack wrapper = getWrapper(crafting);
    if (wrapper == null) {
        return null;
    }
    ItemStack item = getItem(crafting);
    if (item == null) {
        return null;
    }
    ItemStack result = wrapper.copy();
    ((WrapperItem) result.getItem()).setWrappedItemStack(result, item);
    return result;
}
Also used : ItemStack(net.minecraft.item.ItemStack) WrapperItem(minechem.item.prefab.WrapperItem)

Example 2 with WrapperItem

use of minechem.item.prefab.WrapperItem in project Minechem by iopleke.

the class WrapperRecipe method matches.

@Override
public boolean matches(InventoryCrafting crafting, World world) {
    ItemStack wrapper = getWrapper(crafting);
    if (wrapper == null) {
        return false;
    }
    ItemStack item = getItem(crafting);
    if (item == null) {
        return false;
    }
    return ((WrapperItem) wrapper.getItem()).isWrappable(item);
}
Also used : ItemStack(net.minecraft.item.ItemStack) WrapperItem(minechem.item.prefab.WrapperItem)

Aggregations

WrapperItem (minechem.item.prefab.WrapperItem)2 ItemStack (net.minecraft.item.ItemStack)2