Search in sources :

Example 1 with EnumFlutterType

use of forestry.api.lepidopterology.EnumFlutterType in project ForestryMC by ForestryMC.

the class ButterflyRoot method getMemberStack.

@Override
public ItemStack getMemberStack(IIndividual butterfly, ISpeciesType type) {
    Preconditions.checkArgument(type instanceof EnumFlutterType);
    ItemRegistryLepidopterology items = ModuleLepidopterology.getItems();
    Preconditions.checkState(items != null);
    Item butterflyItem;
    switch((EnumFlutterType) type) {
        case SERUM:
            butterflyItem = items.serumGE;
            break;
        case CATERPILLAR:
            butterflyItem = items.caterpillarGE;
            break;
        case COCOON:
            butterflyItem = items.cocoonGE;
            break;
        case BUTTERFLY:
        default:
            butterflyItem = items.butterflyGE;
            break;
    }
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    butterfly.writeToNBT(nbttagcompound);
    ItemStack stack = new ItemStack(butterflyItem);
    stack.setTagCompound(nbttagcompound);
    if (type == EnumFlutterType.CATERPILLAR) {
        ItemButterflyGE.setAge(stack, 0);
    }
    return stack;
}
Also used : EnumFlutterType(forestry.api.lepidopterology.EnumFlutterType) Item(net.minecraft.item.Item) ItemRegistryLepidopterology(forestry.lepidopterology.items.ItemRegistryLepidopterology) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EnumFlutterType (forestry.api.lepidopterology.EnumFlutterType)1 ItemRegistryLepidopterology (forestry.lepidopterology.items.ItemRegistryLepidopterology)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1