Exemplo n.º 1
0
        public override bool GetDrop(ToolItem tool, out ItemStack[] drop)
        {
            if (Plant == FlowerPotPlant.Empty)
            {
                drop = new[] { new ItemStack(new FlowerPotItem()) };
                return(true);
            }
            Block plant;

            switch (Plant)
            {
            case FlowerPotPlant.Fern:
                plant          = new TallGrassBlock();
                plant.Metadata = 2;
                break;

            case FlowerPotPlant.Rose:
                plant = new RedFlowerBlock();
                break;

            case FlowerPotPlant.Dandelion:
                plant = new YellowFlowerBlock();
                break;

            case FlowerPotPlant.OakSapling:
                plant = new SaplingBlock(SaplingBlock.SaplingType.Oak);
                break;

            case FlowerPotPlant.SpruceSapling:
                plant = new SaplingBlock(SaplingBlock.SaplingType.Spruce);
                break;

            case FlowerPotPlant.BirchSapling:
                plant = new SaplingBlock(SaplingBlock.SaplingType.Birch);
                break;

            case FlowerPotPlant.DeadBush:
                plant = new DeadBushBlock();
                break;

            case FlowerPotPlant.JungleTreeSapling:
                plant = new SaplingBlock(SaplingBlock.SaplingType.Jungle);
                break;

            case FlowerPotPlant.RedMushroom:
                plant = new RedMushroomBlock();
                break;

            case FlowerPotPlant.BrownMushroom:
                plant = new BrownMushroomBlock();
                break;

            default:
                plant = new CactusBlock();
                break;
            }
            drop = new[]
            {
                new ItemStack(new FlowerPotItem()),
                new ItemStack(plant, 1, plant.Metadata)
            };
            return(true);
        }
Exemplo n.º 2
0
 public override bool GetDrop(ToolItem tool, out ItemStack[] drop)
 {
     if (Plant == FlowerPotPlant.Empty)
     {
         drop = new[] { new ItemStack(new FlowerPotItem()) };
         return true;
     }
     Block plant;
     switch (Plant)
     {
         case FlowerPotPlant.Fern:
             plant = new TallGrassBlock();
             plant.Metadata = 2;
             break;
         case FlowerPotPlant.Rose:
             plant = new RedFlowerBlock();
             break;
         case FlowerPotPlant.Dandelion:
             plant = new YellowFlowerBlock();
             break;
         case FlowerPotPlant.OakSapling:
             plant = new SaplingBlock(SaplingBlock.SaplingType.Oak);
             break;
         case FlowerPotPlant.SpruceSapling:
             plant = new SaplingBlock(SaplingBlock.SaplingType.Spruce);
             break;
         case FlowerPotPlant.BirchSapling:
             plant = new SaplingBlock(SaplingBlock.SaplingType.Birch);
             break;
         case FlowerPotPlant.DeadBush:
             plant = new DeadBushBlock();
             break;
         case FlowerPotPlant.JungleTreeSapling:
             plant = new SaplingBlock(SaplingBlock.SaplingType.Jungle);
             break;
         case FlowerPotPlant.RedMushroom:
             plant = new RedMushroomBlock();
             break;
         case FlowerPotPlant.BrownMushroom:
             plant = new BrownMushroomBlock();
             break;
         default:
             plant = new CactusBlock();
             break;
     }
     drop = new[]
     {
         new ItemStack(new FlowerPotItem()),
         new ItemStack(plant, 1, plant.Metadata)
     };
     return true;
 }