Search in sources :

Example 1 with ItemRegistryLepidopterology

use of forestry.lepidopterology.items.ItemRegistryLepidopterology 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)

Example 2 with ItemRegistryLepidopterology

use of forestry.lepidopterology.items.ItemRegistryLepidopterology in project ForestryMC by ForestryMC.

the class ModuleLepidopterology method registerItemsAndBlocks.

@Override
public void registerItemsAndBlocks() {
    items = new ItemRegistryLepidopterology();
    blocks = new BlockRegistryLepidopterology();
}
Also used : ItemRegistryLepidopterology(forestry.lepidopterology.items.ItemRegistryLepidopterology) BlockRegistryLepidopterology(forestry.lepidopterology.blocks.BlockRegistryLepidopterology)

Example 3 with ItemRegistryLepidopterology

use of forestry.lepidopterology.items.ItemRegistryLepidopterology in project ForestryMC by ForestryMC.

the class ButterflyRoot method getType.

@Nullable
@Override
public EnumFlutterType getType(ItemStack stack) {
    if (stack.isEmpty()) {
        return null;
    }
    ItemRegistryLepidopterology butterflyItems = ModuleLepidopterology.getItems();
    Preconditions.checkState(butterflyItems != null);
    Item item = stack.getItem();
    if (butterflyItems.butterflyGE == item) {
        return EnumFlutterType.BUTTERFLY;
    } else if (butterflyItems.serumGE == item) {
        return EnumFlutterType.SERUM;
    } else if (butterflyItems.caterpillarGE == item) {
        return EnumFlutterType.CATERPILLAR;
    } else if (butterflyItems.cocoonGE == item) {
        return EnumFlutterType.COCOON;
    } else {
        return null;
    }
}
Also used : Item(net.minecraft.item.Item) ItemRegistryLepidopterology(forestry.lepidopterology.items.ItemRegistryLepidopterology) Nullable(javax.annotation.Nullable)

Example 4 with ItemRegistryLepidopterology

use of forestry.lepidopterology.items.ItemRegistryLepidopterology in project ForestryMC by ForestryMC.

the class ModuleLepidopterology method registerRecipes.

@Override
public void registerRecipes() {
    BlockRegistryLepidopterology blocks = getBlocks();
    ItemRegistryLepidopterology items = getItems();
    ForgeRegistries.RECIPES.register(new MatingRecipe());
    RecipeUtil.addRecipe("butterfly_chest", blocks.butterflyChest, " # ", "XYX", "XXX", '#', "blockGlass", 'X', new ItemStack(items.butterflyGE, 1, OreDictionary.WILDCARD_VALUE), 'Y', "chestWood");
}
Also used : ItemRegistryLepidopterology(forestry.lepidopterology.items.ItemRegistryLepidopterology) BlockRegistryLepidopterology(forestry.lepidopterology.blocks.BlockRegistryLepidopterology) ItemStack(net.minecraft.item.ItemStack) MatingRecipe(forestry.lepidopterology.recipes.MatingRecipe)

Aggregations

ItemRegistryLepidopterology (forestry.lepidopterology.items.ItemRegistryLepidopterology)4 BlockRegistryLepidopterology (forestry.lepidopterology.blocks.BlockRegistryLepidopterology)2 Item (net.minecraft.item.Item)2 ItemStack (net.minecraft.item.ItemStack)2 EnumFlutterType (forestry.api.lepidopterology.EnumFlutterType)1 MatingRecipe (forestry.lepidopterology.recipes.MatingRecipe)1 Nullable (javax.annotation.Nullable)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1