///
//
// Versioning: http://semver.org/
// Example Code: https://github.com/Choonster/TestMod3/
//
///

//
// old constructor registry
//
   public PrimalItem(String name) {
        this.setRegistryName(name);
        this.setUnlocalizedName(this.getRegistryName().toString());
        this.setCreativeTab(ModInfo.TAB_PRIMAL);

        GameRegistry.registerItem(this, name);
        PrimalCore.proxy.renderItem(this, name);
   }

//
// old name prefix
//
   item.setUnlocalizedName(ModInfo.MOD_ID + "." + name);

//
// item constructor test
//
   public PrimalItem(String name) {
        setName(this, name);
        setCreativeTab(ModInfo.TAB_PRIMAL);
   }

   public static void setName(Item item, String name) {
        item.setRegistryName(name);
        item.setUnlocalizedName(item.getRegistryName().toString());
   }

   vs

   public PrimalItem(String name) {
        this.setRegistryName(name);
        this.setUnlocalizedName(this.getRegistryName().toString());
        this.setCreativeTab(ModInfo.TAB_PRIMAL);
   }

//
// thaumcraft in-line aspects
//
   // item/block class method:
   //
   //import thaumcraft.api.ThaumcraftApi;
   //import thaumcraft.api.aspects.Aspect;
   //import thaumcraft.api.aspects.AspectList;

   //public Item thaumcraftAspects(AspectList list) {
   //    ThaumcraftApi.registerObjectTag(new ItemStack(this), list);
   //    return this;
   //}

   // item/block registry class:
   //
   //goldenStick = new PrimalItem("goldenStick").thaumcraftAspects((new AspectList()).add(Aspect.AURA, 1).add(Aspect.DESIRE, 2));

///
// item/block registration
///
    ASH_BLOCK   = new AshBlock("ash_block").registerCrafting(ModItems.ASH);
    ASH_LAYER   = new AshLayer("ash_layer");

    vs

    ASH_BLOCK   = registerBlock(new AshBlock("ash_block").registerCrafting(ModItems.ASH));
    ASH_LAYER   = registerBlock(new AshBlock("ash_layer"));

///
// Item Factory
// https://github.com/Choonster/TestMod3/
///
    private static <BLOCK extends Block> BLOCK registerBlock(BLOCK block) {
        return registerBlock(block, ItemBlock::new);
    }

    private static <BLOCK extends Block> BLOCK registerBlock(BLOCK block, @Nullable Function<BLOCK, ItemBlock> itemFactory)
    {
        //GameRegistry.register(block);
        ForgeRegistries.BLOCKS.register(block);
        PrimalCore.proxy.renderBlock(block);

        if (itemFactory != null) {
            final ItemBlock itemBlock = itemFactory.apply(block);

            //GameRegistry.register(itemBlock.setRegistryName(block.getRegistryName()));
            ForgeRegistries.ITEMS.register(itemBlock.setRegistryName(block.getRegistryName()));
        }

        BLOCKS.add(block);
        return block;
    }

///
// Basic plant growth block states
///
    public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 9);
    public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
    {
        int age = ((Integer)state.getValue(AGE)).intValue();
        if (age < 9 && rand.nextInt(10) == 0)
        {
            state = state.withProperty(AGE, Integer.valueOf(age + 1));
            worldIn.setBlockState(pos, state, 2);
        }
        super.updateTick(worldIn, pos, state, rand);
    }

    public IBlockState getStateFromMeta(int meta)
    {
        return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta));
    }

    public int getMetaFromState(IBlockState state)
    {
        return ((Integer)state.getValue(AGE)).intValue();
    }

///
//  1.10.2 OreDictionary: http://pastebin.com/tgrvn65p
//
//  end
///