Search in sources :

Example 1 with ItemSeedBag

use of com.bluepowermod.item.ItemSeedBag in project BluePower by Qmunity.

the class BPItems method initializeItems.

public static void initializeItems() {
    amethyst_gem = new ItemCrafting(Refs.AMETHYST_NAME);
    sapphire_gem = new ItemCrafting(Refs.SAPPHIRE_NAME);
    ruby_gem = new ItemCrafting(Refs.RUBY_NAME);
    teslatite_dust = new ItemCrafting(Refs.TESLATITE_NAME);
    copper_ingot = new ItemCrafting(Refs.COPPERINGOT_NAME);
    silver_ingot = new ItemCrafting(Refs.SILVERINGOT_NAME);
    zinc_ingot = new ItemCrafting(Refs.ZINCINGOT_NAME);
    brass_ingot = new ItemCrafting(Refs.BRASSINGOT_NAME);
    blue_alloy_ingot = new ItemCrafting(Refs.BLUEALLOYINGOT_NAME);
    red_alloy_ingot = new ItemCrafting(Refs.REDALLOYINGOT_NAME);
    purple_alloy_ingot = new ItemCrafting(Refs.PURPLEALLOYINGOT_NAME);
    tungsten_ingot = new ItemCrafting(Refs.TUNGSTENINGOT_NAME);
    tungsten_nugget = new ItemCrafting(Refs.TUNGSTENNUGGET_NAME);
    zinc_ore_crushed = new ItemBase().setUnlocalizedName(Refs.ZINC_ORE_CRUSHED_NAME).setTextureName(Refs.MODID + ":" + Refs.ZINC_ORE_CRUSHED_NAME).setCreativeTab(BPCreativeTabs.items);
    zinc_ore_purified = new ItemBase().setUnlocalizedName(Refs.ZINC_ORE_CRUSHED_PURIFIED_NAME).setTextureName(Refs.MODID + ":" + Refs.ZINC_ORE_CRUSHED_PURIFIED_NAME).setCreativeTab(BPCreativeTabs.items);
    zinc_dust = new ItemBase().setUnlocalizedName(Refs.ZINCDUST_NAME).setTextureName(Refs.MODID + ":" + Refs.ZINCDUST_NAME).setCreativeTab(BPCreativeTabs.items);
    zinc_tiny_dust = new ItemBase().setUnlocalizedName(Refs.ZINCDUST_TINY_NAME).setTextureName(Refs.MODID + ":" + Refs.ZINCDUST_TINY_NAME).setCreativeTab(BPCreativeTabs.items);
    ruby_saw = new ItemSaw(2, Refs.RUBYSAW_NAME);
    sapphire_saw = new ItemSaw(2, Refs.SAPPHIRESAW_NAME);
    amethyst_saw = new ItemSaw(2, Refs.AMETHYSTSAW_NAME);
    wood_sickle = new ItemSickle(ToolMaterial.WOOD, Refs.WOODSICKLE_NAME, Item.getItemFromBlock(Blocks.planks));
    stone_sickle = new ItemSickle(ToolMaterial.STONE, Refs.STONESICKLE_NAME, Item.getItemFromBlock(Blocks.cobblestone));
    iron_sickle = new ItemSickle(ToolMaterial.IRON, Refs.IRONSICKLE_NAME, Items.iron_ingot);
    gold_sickle = new ItemSickle(ToolMaterial.GOLD, Refs.GOLDSICKLE_NAME, Items.gold_ingot);
    diamond_sickle = new ItemSickle(ToolMaterial.EMERALD, Refs.DIAMONDSICKLE_NAME, Items.diamond);
    flax_seeds = new ItemCropSeed(BPBlocks.flax_crop, Blocks.farmland).setUnlocalizedName(Refs.FLAXSEED_NAME);
    indigo_dye = new ItemIndigoDye(Refs.INDIGODYE_NAME);
    silicon_boule = new ItemCrafting(Refs.SILICONBOULE_NAME).setCreativeTab(BPCreativeTabs.items);
    silicon_wafer = new ItemCrafting(Refs.SILICONWAFER_NAME).setCreativeTab(BPCreativeTabs.items);
    red_doped_wafer = new ItemCrafting(Refs.REDDOPEDWAFER_NAME).setCreativeTab(BPCreativeTabs.items);
    blue_doped_wafer = new ItemCrafting(Refs.BLUEDOPEDWAFER_NAME).setCreativeTab(BPCreativeTabs.items);
    infused_teslatite_dust = new ItemCrafting(Refs.INFUSEDTESLATITEDUST_NAME);
    screwdriver = new ItemScrewdriver();
    silky_screwdriver = new ItemSilkyScrewdriver();
    athame = new ItemAthame();
    zincplate = new ItemCrafting(Refs.ZINCPLATE_NAME);
    stone_tile = new ItemCrafting(Refs.STONETILE_NAME);
    bluestone_wire_tile = new ItemCrafting(Refs.BLUESTONEWIRETILE_NAME);
    bluestone_anode_tile = new ItemCrafting(Refs.BLUESTONEANODETILE_NAME);
    bluestone_cathode_tile = new ItemCrafting(Refs.BLUESTONECATHODE_NAME);
    bluestone_pointer_tile = new ItemCrafting(Refs.BLUESTONEPOINTER_NAME);
    silicon_chip_tile = new ItemCrafting(Refs.SILICONCHIP_NAME);
    tainted_silicon_chip_tile = new ItemCrafting(Refs.TAINTEDSILICONCHIP_NAME);
    quartz_resonator_tile = new ItemCrafting(Refs.QUARTZRESONATOR_NAME);
    redstone_wire_tile = new ItemCrafting(Refs.REDSTONEWIRETILE_NAME);
    redstone_anode_tile = new ItemCrafting(Refs.REDSTONEANODETILE_NAME);
    redstone_cathode_tile = new ItemCrafting(Refs.REDSTONECATHODE_NAME);
    redstone_pointer_tile = new ItemCrafting(Refs.REDSTONEPOINTER_NAME);
    // stone_redwire = new ItemCrafting(Refs.STONEREDWIRE_NAME);
    // plate_assembly = new ItemCrafting(Refs.PLATEASSEMBLY_NAME);
    stone_bundle = new ItemCrafting(Refs.STONEBUNDLE_NAME);
    screwdriver_handle = new ItemCrafting(Refs.SCREWDRIVERHANDLE_NAME);
    seed_bag = new ItemSeedBag(Refs.SEEDBAG_NAME);
    canvas_bag = new ItemCanvasBag(Refs.CANVASBAG_NAME);
    canvas = new ItemCrafting(Refs.CANVAS_NAME);
    lumar = new ItemLumar();
    wool_card = new ItemLimitedCrafting(Refs.WOOLCARD_NAME, 64);
    diamond_drawplate = new ItemLimitedCrafting(Refs.DIAMONDDRAWPLATE_NAME, 256);
    copper_wire = new ItemCrafting(Refs.COPPERWIRE_NAME);
    iron_wire = new ItemCrafting(Refs.IRONWIRE_NAME);
    paint_can = new ItemPaintCan(Refs.PAINTCAN_NAME);
    paint_brush = new ItemPaintBrush(Refs.PAINTBRUSH_NAME);
    ruby_axe = new ItemGemAxe(BluePower.gemMaterial, Refs.RUBYAXE_NAME, BPItems.ruby_gem);
    ruby_sword = new ItemGemSword(BluePower.gemMaterial, Refs.RUBYSWORD_NAME, BPItems.ruby_gem);
    ruby_pickaxe = new ItemGemPickaxe(BluePower.gemMaterial, Refs.RUBYPICKAXE_NAME, BPItems.ruby_gem);
    ruby_shovel = new ItemGemSpade(BluePower.gemMaterial, Refs.RUBYSPADE_NAME, BPItems.ruby_gem);
    ruby_hoe = new ItemGemHoe(BluePower.gemMaterial, Refs.RUBYHOE_NAME, BPItems.ruby_gem);
    ruby_sickle = new ItemSickle(BluePower.gemMaterial, Refs.RUBYSICKLE_NAME, BPItems.ruby_gem);
    sapphire_axe = new ItemGemAxe(BluePower.gemMaterial, Refs.SAPPHIREAXE_NAME, BPItems.sapphire_gem);
    sapphire_sword = new ItemGemSword(BluePower.gemMaterial, Refs.SAPPHIRESWORD_NAME, BPItems.sapphire_gem);
    sapphire_pickaxe = new ItemGemPickaxe(BluePower.gemMaterial, Refs.SAPPHIREPICKAXE_NAME, BPItems.sapphire_gem);
    sapphire_shovel = new ItemGemSpade(BluePower.gemMaterial, Refs.SAPPHIRESPADE_NAME, BPItems.sapphire_gem);
    sapphire_hoe = new ItemGemHoe(BluePower.gemMaterial, Refs.SAPPHIREHOE_NAME, BPItems.sapphire_gem);
    sapphire_sickle = new ItemSickle(BluePower.gemMaterial, Refs.SAPPHIRESICKLE_NAME, BPItems.sapphire_gem);
    amethyst_axe = new ItemGemAxe(BluePower.gemMaterial, Refs.AMETHYSTAXE_NAME, BPItems.amethyst_gem);
    amethyst_sword = new ItemGemSword(BluePower.gemMaterial, Refs.AMETHYSTSWORD_NAME, BPItems.amethyst_gem);
    amethyst_pickaxe = new ItemGemPickaxe(BluePower.gemMaterial, Refs.AMETHYSTPICKAXE_NAME, BPItems.amethyst_gem);
    amethyst_shovel = new ItemGemSpade(BluePower.gemMaterial, Refs.AMETHYSTSPADE_NAME, BPItems.amethyst_gem);
    amethyst_hoe = new ItemGemHoe(BluePower.gemMaterial, Refs.AMETHYSTHOE_NAME, BPItems.amethyst_gem);
    amethyst_sickle = new ItemSickle(BluePower.gemMaterial, Refs.AMETHYSTSICKLE_NAME, BPItems.amethyst_gem);
}
Also used : ItemCrafting(com.bluepowermod.item.ItemCrafting) ItemCropSeed(com.bluepowermod.item.ItemCropSeed) ItemSickle(com.bluepowermod.item.ItemSickle) ItemBase(com.bluepowermod.item.ItemBase) ItemLumar(com.bluepowermod.item.ItemLumar) ItemGemPickaxe(com.bluepowermod.item.ItemGemPickaxe) ItemPaintBrush(com.bluepowermod.item.ItemPaintBrush) ItemGemAxe(com.bluepowermod.item.ItemGemAxe) ItemSaw(com.bluepowermod.item.ItemSaw) ItemScrewdriver(com.bluepowermod.item.ItemScrewdriver) ItemIndigoDye(com.bluepowermod.item.ItemIndigoDye) ItemCanvasBag(com.bluepowermod.item.ItemCanvasBag) ItemPaintCan(com.bluepowermod.item.ItemPaintCan) ItemAthame(com.bluepowermod.item.ItemAthame) ItemGemSword(com.bluepowermod.item.ItemGemSword) ItemGemHoe(com.bluepowermod.item.ItemGemHoe) ItemSilkyScrewdriver(com.bluepowermod.item.ItemSilkyScrewdriver) ItemGemSpade(com.bluepowermod.item.ItemGemSpade) ItemSeedBag(com.bluepowermod.item.ItemSeedBag) ItemLimitedCrafting(com.bluepowermod.item.ItemLimitedCrafting)

Example 2 with ItemSeedBag

use of com.bluepowermod.item.ItemSeedBag in project BluePower by Qmunity.

the class BPEventHandler method itemPickUp.

@SubscribeEvent
public void itemPickUp(EntityItemPickupEvent event) {
    PlayerEntity player = event.getPlayer();
    ItemStack pickUp = event.getItem().getItem();
    if (!(player.containerMenu instanceof ContainerSeedBag)) {
        for (ItemStack is : player.inventory.items) {
            if (!is.isEmpty() && is.getItem() instanceof ItemSeedBag) {
                ItemStack seedType = ItemSeedBag.getSeedType(is);
                if (!seedType.isEmpty() && seedType.sameItem(pickUp)) {
                    ItemStackHandler seedBagInvHandler = new ItemStackHandler(9);
                    // Get Items from the NBT Handler
                    if (is.hasTag())
                        seedBagInvHandler.deserializeNBT(is.getTag().getCompound("inv"));
                    // Attempt to insert items
                    for (int j = 0; j < 9 && !pickUp.isEmpty(); ++j) {
                        pickUp = seedBagInvHandler.insertItem(j, pickUp, false);
                    }
                    // Update items in the NBT
                    if (!is.hasTag())
                        is.setTag(new CompoundNBT());
                    if (is.getTag() != null) {
                        is.getTag().put("inv", seedBagInvHandler.serializeNBT());
                    }
                    // Pickup Leftovers
                    if (pickUp.isEmpty()) {
                        event.setResult(Event.Result.ALLOW);
                        event.getItem().remove();
                        return;
                    } else {
                        event.getItem().setItem(pickUp);
                    }
                }
            }
        }
    }
}
Also used : ItemStackHandler(net.minecraftforge.items.ItemStackHandler) CompoundNBT(net.minecraft.nbt.CompoundNBT) ItemStack(net.minecraft.item.ItemStack) ItemSeedBag(com.bluepowermod.item.ItemSeedBag) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ContainerSeedBag(com.bluepowermod.container.ContainerSeedBag) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

ItemSeedBag (com.bluepowermod.item.ItemSeedBag)2 ContainerSeedBag (com.bluepowermod.container.ContainerSeedBag)1 ItemAthame (com.bluepowermod.item.ItemAthame)1 ItemBase (com.bluepowermod.item.ItemBase)1 ItemCanvasBag (com.bluepowermod.item.ItemCanvasBag)1 ItemCrafting (com.bluepowermod.item.ItemCrafting)1 ItemCropSeed (com.bluepowermod.item.ItemCropSeed)1 ItemGemAxe (com.bluepowermod.item.ItemGemAxe)1 ItemGemHoe (com.bluepowermod.item.ItemGemHoe)1 ItemGemPickaxe (com.bluepowermod.item.ItemGemPickaxe)1 ItemGemSpade (com.bluepowermod.item.ItemGemSpade)1 ItemGemSword (com.bluepowermod.item.ItemGemSword)1 ItemIndigoDye (com.bluepowermod.item.ItemIndigoDye)1 ItemLimitedCrafting (com.bluepowermod.item.ItemLimitedCrafting)1 ItemLumar (com.bluepowermod.item.ItemLumar)1 ItemPaintBrush (com.bluepowermod.item.ItemPaintBrush)1 ItemPaintCan (com.bluepowermod.item.ItemPaintCan)1 ItemSaw (com.bluepowermod.item.ItemSaw)1 ItemScrewdriver (com.bluepowermod.item.ItemScrewdriver)1 ItemSickle (com.bluepowermod.item.ItemSickle)1