Java 类net.minecraft.item.ItemSeeds 实例源码

项目:MooncakeCraft    文件:MooncakeRegistries.java   
@SubscribeEvent
public static void onItemRegister(RegistryEvent.Register<Item> event) {
    IForgeRegistry<Item> registry = event.getRegistry();
    registry.registerAll(
            new Mooncake().setRegistryName("mooncakecraft:mooncake"),
            new MooncakeMold().setRegistryName("mooncakecraft:mooncakemold"),
            new MooncakeFilling().setRegistryName("mooncakecraft:mooncake_filling"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.wheat_flour").setRegistryName("mooncakecraft:wheat_flour"),
            new MoonCakeRaw().setRegistryName("mooncakecraft:mooncakeraw"),
            new MoonCakeUnshaped().setRegistryName("mooncakecraft:mooncakeunshaped"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.lotus_seeds").setRegistryName("mooncakecraft:lotus_seeds"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.jujube").setRegistryName("mooncakecraft:jujube"),
            new ItemSeeds(MooncakeConstants.PEANUT_PLANT, Blocks.FARMLAND).setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setUnlocalizedName("mooncakecraft.peanut_seeds").setRegistryName("mooncakecraft:peanut_seeds"),
            new ItemSeeds(MooncakeConstants.SESAME_PLANT, Blocks.FARMLAND).setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setUnlocalizedName("mooncakecraft.sesame_seeds").setRegistryName("mooncakecraft:sesame_seeds"),
            new Item().setRegistryName("mooncakecraft:icon")
    );
}
项目:BluePower    文件:SlotSeedBag.java   
public boolean isItemValid(ItemStack itemstack) {

    itemstack = itemstack.copy();
    itemstack.stackSize = 1;
    if (itemstack.getItem() instanceof ItemSeeds) {
        ItemStack seedType = null;

        for (int i = 0; i < this.inventory.getSizeInventory(); i++) {
            ItemStack is = this.inventory.getStackInSlot(i);
            if (is != null) {
                seedType = is.copy();
                seedType.stackSize = 1;
                break;
            }
        }

        if (seedType == null) {
            return true;
        } else {
            return ItemStack.areItemStacksEqual(itemstack, seedType);
        }
    }

    return false;
}
项目:mcplus_mods    文件:RecipesGrainMix.java   
@Override
public boolean matches(InventoryCrafting p_77569_1_, World worldIn)
{
    boolean bowl = false;
    int seedCount = 0;
    for (int i = 0; i < p_77569_1_.getSizeInventory(); ++i)
    {
        ItemStack itemstack = p_77569_1_.getStackInSlot(i);

        if (itemstack != null)
        {
            if (itemstack.getItem() instanceof ItemSeeds && ++seedCount > 3)
            {
                return false;
            }
            else if (itemstack.getItem() == Items.bowl)
            {
                if (bowl) return false;
                bowl = true;
            }
        }
    }

    return bowl && seedCount == 3;
}
项目:LittleThings-old    文件:ItemFoodSeedsPack.java   
protected boolean placeSeeds(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing)
{
    if (facing == EnumFacing.UP &&
            playerIn.canPlayerEdit(pos.offset(facing), facing, stack) &&
            worldIn.getBlockState(pos).getBlock().canSustainPlant(worldIn.getBlockState(pos), worldIn, pos, EnumFacing.UP, new ItemSeeds(Blocks.wheat, Blocks.farmland)) &&
            worldIn.isAirBlock(pos.up())) {
        worldIn.setBlockState(pos.up(), Blocks.wheat.getDefaultState());
        return true;
    } else {
        return false;
    }
}
项目:EvangelionMod    文件:ItemManager.java   
public static void initalizeItem() {
RedIngot = new RedIngot();
LanceSword = new LanceSword(EvangelionT).setUnlocalizedName("LanceOfLongenuis").setCreativeTab(CreativeTabs.tabCombat).setTextureName(StringLibrary.MODID + ":LanceSword");
LifeFruit = new LifeFruit(20, 0.6F, true).setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName("LifeFruit").setTextureName(StringLibrary.MODID + ":LifeFruit");
KnowFruit = new KnowFruit(20, 0.6F, true).setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName("KnowFruit").setTextureName(StringLibrary.MODID + ":KnowFruit");
KnowSeeds = new ItemSeeds(BlockManager.KnowBlockCrops, Blocks.farmland).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("KnowSeeds").setTextureName(StringLibrary.MODID + ":KnowSeeds"); 
EvaIngot = new EvaIngot();
LifeSeeds = new ItemSeeds(BlockManager.LifeBlockCrops, Blocks.farmland).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("LifeSeeds").setTextureName(StringLibrary.MODID + ":LifeSeeds");
customHelmet = new CustomArmor(Evangelion, MainRegistry.proxy.addArmor("CustomHelmet"), 0).setUnlocalizedName("CustomHelmet").setCreativeTab(CreativeTabs.tabCombat).setTextureName(StringLibrary.MODID + ":custom_helmet");
EvaChest = new CustomArmor(Evangelion, MainRegistry.proxy.addArmor("EvaChest"), 1).setUnlocalizedName("EvaChest").setCreativeTab(CreativeTabs.tabCombat).setTextureName(StringLibrary.MODID + ":EvaChest");
EvaPant = new CustomArmor(Evangelion, MainRegistry.proxy.addArmor("EvaPant"), 2).setUnlocalizedName("EvaPant").setCreativeTab(CreativeTabs.tabCombat).setTextureName(StringLibrary.MODID + ":EvaPant");
    EvaBoot = new CustomArmor(Evangelion, MainRegistry.proxy.addArmor("EvaBoot"), 3).setUnlocalizedName("EvaBoot").setCreativeTab(CreativeTabs.tabCombat).setTextureName(StringLibrary.MODID + ":EvaBoot");
  }
项目:mcplus_mods    文件:_Blowpipe.java   
@EventHandler
@Override
public void PostInitialize(FMLPostInitializationEvent parEvent)
{
    //Get all seed items
    List<ItemSeeds> seedList = getSeedItems();

    //Seed fuels
    for(ItemSeeds seed : seedList)
    {
        MCP.fuel(seed, seedBurnTime);
    }

    super.PostInitialize(parEvent);
}
项目:mcplus_mods    文件:_Blowpipe.java   
public static final List<ItemSeeds> getSeedItems()
{
    List<ItemSeeds> seedList = new ArrayList<ItemSeeds>();
    Iterator iter = Item.itemRegistry.getKeys().iterator();
    while(iter.hasNext())
    {
        Object obj = Item.itemRegistry.getObject(iter.next());
        if (obj instanceof ItemSeeds) seedList.add((ItemSeeds) obj);
    }
    return seedList;
}
项目:R0b0ts    文件:AIHarvest.java   
public void startExecuting()
{
    if (!robot.worldObj.isRemote)
    {
        if (target != null && !robot.worldObj.isAirBlock((int) target.x, (int) target.y, (int) target.z)
                && Block.blocksList[robot.worldObj.getBlockId((int) target.x, (int) target.y, (int) target.z)] instanceof BlockCrops
                && robot.worldObj.getBlockMetadata((int) target.x, (int) target.y, (int) target.z) == 7)
        {
            robot.getNavigator().tryMoveToXYZ(target.x, target.y, target.z, 0.5F);
            if (robot.getDistanceSq(target.x, target.y, target.z) <= 2)
            {
                robot.worldObj.destroyBlock((int) target.x, (int) target.y, (int) target.z, true);
                List drops = robot.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(target.x - 1D, target.y - 1, target.z - 1D, target.x + 1D, target.y + 1, target.z + 1D));
                for (Object o : drops)
                {
                    if (o instanceof EntityItem)
                    {
                        EntityItem item = (EntityItem) o;
                        if (item.getEntityItem().getItem() instanceof ItemSeeds && !item.isDead)
                        {
                            if (robot.worldObj.isAirBlock((int) target.x, (int) target.y, (int) target.z) &&
                                    Block.blocksList[robot.worldObj.getBlockId((int) target.x, (int) target.y - 1, (int) target.z)].canSustainPlant(robot.worldObj, (int) target.x, (int) target.y - 1, (int) target.z, ForgeDirection.UP, ((ItemSeeds) item.getEntityItem().getItem())))
                            {
                                Integer blockID = ReflectionHelper.getPrivateValue(ItemSeeds.class, (ItemSeeds) item.getEntityItem().getItem(), "blockType", "field_77839_a");
                                robot.worldObj.setBlock((int) target.x, (int) target.y, (int) target.z, blockID, 0, 3);
                                item.setDead();
                                break;
                            }
                        }
                    }
                }
                target = null;
            }
        } else
        {
            robot.getNavigator().tryMoveToXYZ(pos.x, pos.y, pos.z, 0.5F);
            target = null;
        }
    }
}
项目:PopularMMOS-EpicProportions-Mod    文件:EntityLuckyChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack p_70877_1_)
{
    return p_70877_1_ != null && p_70877_1_.getItem() instanceof ItemSeeds;
}
项目:Culinary-Cultivation    文件:SeedBagInventory.java   
@Override
public boolean isItemValidForSlot(int index, @Nonnull ItemStack stack) {
    Item item = stack.getItem();
    ItemCropProduct.ProductType cropProduct = ItemCropProduct.ProductType.byItemStack(stack);
    return (item instanceof ItemSeeds || item instanceof ItemSeedFood || item == ModItems.CROP_SEEDS || item == ModItems.CROP_FOOD && cropProduct.canPlantCrop()) && item instanceof IPlantable;
}
项目:KalStuff    文件:KalStuffItems.java   
/**
 * Initializes all items from the mod.
 */
public static void initializeItems() {

    //Please keep all items in alphabetical order!
    apple_soda              = (ItemSoda) new ItemSoda(2, 2.0f, 600, MobEffects.NIGHT_VISION).setUnlocalizedName("appleSoda");
    bacon_core              = new Item().setUnlocalizedName("baconCore").setCreativeTab(StartupCommon.KALSTUFF);
    bacon_wand              = (ItemBaconWand) new ItemBaconWand().setUnlocalizedName("baconWand");
    blaze_soup              = (ItemBlazeSoup) new ItemBlazeSoup(2, 2.0f, 6000, new Potion[] {MobEffects.ABSORPTION, MobEffects.NIGHT_VISION, MobEffects.STRENGTH, MobEffects.FIRE_RESISTANCE}).setUnlocalizedName("blazeSoup").setCreativeTab(StartupCommon.KALSTUFF);
    boxing_glove            = (ItemBoxingGlove) new ItemBoxingGlove().setUnlocalizedName("boxingGlove").setCreativeTab(StartupCommon.KALSTUFF);
    chocolate_cap           = new Item().setUnlocalizedName("chocolateCap").setCreativeTab(StartupCommon.KALSTUFF);
    closed_apple_soda       = (ItemClosedSoda) new ItemClosedSoda().setUnlocalizedName("closedAppleSoda").setCreativeTab(StartupCommon.KALSTUFF);
    closed_grape_soda       = (ItemClosedSoda) new ItemClosedSoda().setUnlocalizedName("closedGrapeSoda").setCreativeTab(StartupCommon.KALSTUFF);
    closed_melon_soda       = (ItemClosedSoda) new ItemClosedSoda().setUnlocalizedName("closedMelonSoda").setCreativeTab(StartupCommon.KALSTUFF);
        closed_root_beer        = (ItemClosedSoda) new ItemClosedSoda().setUnlocalizedName("closedRootBeer").setCreativeTab(StartupCommon.KALSTUFF);
    coffee                  = (ItemCoffee) new ItemCoffee(2, 2.0f, 200, MobEffects.SPEED).setUnlocalizedName("coffee").setCreativeTab(StartupCommon.KALSTUFF);
    coffee_mug              = new Item().setUnlocalizedName("coffeeMug").setCreativeTab(StartupCommon.KALSTUFF);
    crushed_ender           = (ItemEnderPowder) new ItemEnderPowder().setUnlocalizedName("enderPowder").setCreativeTab(StartupCommon.KALSTUFF);
    diamond_dagger          = (ItemDagger) new ItemDagger(Item.ToolMaterial.DIAMOND).setUnlocalizedName("diamondDagger").setCreativeTab(StartupCommon.KALSTUFF);
    golden_dagger           = (ItemDagger) new ItemDagger(Item.ToolMaterial.GOLD).setUnlocalizedName("goldenDagger").setCreativeTab(StartupCommon.KALSTUFF);
    golden_mug              = new Item().setUnlocalizedName("goldenMug").setCreativeTab(StartupCommon.KALSTUFF);
    grapes                  = (ItemFood) new ItemFood(3, 0.5f, false).setUnlocalizedName("grapes").setCreativeTab(StartupCommon.KALSTUFF);
    grape_seeds             = new Item().setUnlocalizedName("grapeSeeds").setCreativeTab(StartupCommon.KALSTUFF);
    grape_soda              = (ItemSoda) new ItemSoda(2, 2.0f, 600, MobEffects.JUMP_BOOST).setUnlocalizedName("grapeSoda");
    infused_bacon_core      = new Item().setUnlocalizedName("infusedBaconCore").setCreativeTab(StartupCommon.KALSTUFF);
    iron_dagger             = (ItemDagger) new ItemDagger(Item.ToolMaterial.IRON).setUnlocalizedName("ironDagger").setCreativeTab(StartupCommon.KALSTUFF);
    jewel_soup              = (ItemJewelSoup) new ItemJewelSoup(2, 2.0f, 6000, new Potion[] {MobEffects.SPEED, MobEffects.REGENERATION}).setUnlocalizedName("jewelSoup").setCreativeTab(StartupCommon.KALSTUFF);
    light_coffee            = (ItemCoffee) new ItemCoffee(2, 2.0f, 0, null).setUnlocalizedName("lightCoffee").setCreativeTab(StartupCommon.KALSTUFF);
    lute                    = (ItemLute) new ItemLute().setUnlocalizedName("lute").setCreativeTab(StartupCommon.KALSTUFF);
    melon_soda              = (ItemSoda) new ItemSoda(2, 2.0f, 600, MobEffects.HASTE).setUnlocalizedName("melonSoda");
    plantable_grape_seeds   = (ItemSeeds) new ItemSeeds(KalStuffBlocks.grape_vine, Blocks.FARMLAND).setUnlocalizedName("plantableGrapeSeeds").setCreativeTab(StartupCommon.KALSTUFF);
    root_beer               = (ItemSoda) new ItemSoda(2, 2.0f, 600, MobEffects.FIRE_RESISTANCE).setUnlocalizedName("rootBeer");
    soda_can                = new Item().setUnlocalizedName("sodaCan").setCreativeTab(StartupCommon.KALSTUFF);
    stone_dagger            = (ItemDagger) new ItemDagger(Item.ToolMaterial.STONE).setUnlocalizedName("stoneDagger").setCreativeTab(StartupCommon.KALSTUFF);
    tea                     = (ItemTea) new ItemTea(2, 2.0f).setUnlocalizedName("tea").setCreativeTab(StartupCommon.KALSTUFF);
    walking_stick           = (ItemWalkingStick) new ItemWalkingStick().setUnlocalizedName("walkingStick").setCreativeTab(StartupCommon.KALSTUFF);
    wine                    = (ItemWine) new ItemWine(2, 2.0f, 1200, new Potion[] {MobEffects.NAUSEA, MobEffects.BLINDNESS}).setUnlocalizedName("wine").setCreativeTab(StartupCommon.KALSTUFF);
    wine_bottle             = new Item().setUnlocalizedName("wineBottle").setCreativeTab(StartupCommon.KALSTUFF);
    wooden_dagger           = (ItemDagger) new ItemDagger(Item.ToolMaterial.WOOD).setUnlocalizedName("woodenDagger").setCreativeTab(StartupCommon.KALSTUFF);
    wooden_round_shield     = (ItemRoundShield) new ItemRoundShield(Item.ToolMaterial.WOOD).setUnlocalizedName("roundWoodenShield").setCreativeTab(StartupCommon.KALSTUFF);


    // set what items these will return when used. This must happen after_the items are initialized.
        apple_soda.setReturnStack(soda_can);
        blaze_soup.setReturnStack(golden_mug);
        closed_apple_soda.setReturnStack(apple_soda);
        closed_grape_soda.setReturnStack(grape_soda);
        closed_melon_soda.setReturnStack(melon_soda);
        closed_root_beer.setReturnStack(root_beer);
        coffee.setReturnStack(coffee_mug);
        grape_soda.setReturnStack(soda_can);
        jewel_soup.setReturnStack(golden_mug);
        light_coffee.setReturnStack(coffee_mug);
        melon_soda.setReturnStack(soda_can);
        root_beer.setReturnStack(soda_can);
        tea.setReturnStack(coffee_mug);
        wine.setReturnStack(wine_bottle);
}
项目:Rediscovered-Mod-1.8    文件:EntitySkyChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:Resilience-Client-Source    文件:EntityChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:Rediscovered-Mod-1.8.8    文件:EntitySkyChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:AbyssalCraft    文件:EntityAntiChicken.java   
@Override
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return !par1ItemStack.isEmpty() && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:Cauldron    文件:EntityChicken.java   
public boolean isBreedingItem(ItemStack p_70877_1_)
{
    return p_70877_1_ != null && p_70877_1_.getItem() instanceof ItemSeeds;
}
项目:Cauldron    文件:EntityChicken.java   
public boolean isBreedingItem(ItemStack p_70877_1_)
{
    return p_70877_1_ != null && p_70877_1_.getItem() instanceof ItemSeeds;
}
项目:Rediscovered-Mod-1.6.4    文件:EntitySkyChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:RuneCraftery    文件:EntityChicken.java   
public boolean func_70877_b(ItemStack p_70877_1_) {
   return p_70877_1_ != null && p_70877_1_.func_77973_b() instanceof ItemSeeds;
}
项目:RuneCraftery    文件:EntityChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:StarTrekMod    文件:EntityTribble.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:Rediscovered-Mod-1.7.10    文件:EntitySkyChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}
项目:BetterNutritionMod    文件:EntityChicken.java   
/**
 * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
 * the animal type)
 */
public boolean isBreedingItem(ItemStack par1ItemStack)
{
    return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds;
}