Jump to content

[1.6.4][solved]custom sapling


denbukki

Recommended Posts

hi i made a custom sapling but it cant seem to grow it just pop of the block and bonemeal also doenst work on it

 

 

 

 

package denbukki.indestructibleTools;



import java.util.List;
import java.util.Random;

import net.minecraft.block.BlockSapling;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import denbukki.indestructibleTools.worldgen.WorldGenTree;

public class blockhardwoodsapling extends BlockSapling
{
        private static WorldGenTree treeGen = new WorldGenTree(true);
                        
        public blockhardwoodsapling(int id)
        {
                super(id);
                setHardness(0.0F);
                setStepSound(soundGrassFootstep);
                setCreativeTab(indestructibletools.indestructibleTools);
                this.useNeighborBrightness[id] = true;
        }
        
        @Override
        @SideOnly(Side.CLIENT)
        public void registerIcons(IconRegister par1IconRegister)
        {
                blockIcon = par1IconRegister.registerIcon("indestructibleTools:hardwoodSapling");
        }
        
        @Override
        public Icon getIcon(int side, int metadata)
        {
                return blockIcon;
        }
        
        @Override
        public void growTree(World world, int x, int y, int z, Random rand)
        {
                if (world.isRemote)
                {
                        return;
                }
                
                world.setBlockToAir(x, y, z);
                
                if(!treeGen.growTree(world, rand, x, y, z))
                {
                        world.setBlock(x, y, z, blockID, 0, 4);
                }
        }
        
        @Override
        public int idDropped(int meta, Random rand, int fortune)
        {
                return indestructibletools.blockhardwoodsapling.blockID;
        }
        
        @Override
        @SideOnly(Side.CLIENT)
        public void getSubBlocks(int blockId, CreativeTabs tab, List subBlocks)
        {
                subBlocks.add(new ItemStack(blockId, 1, 0));
        }
        
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.