Set Sappling

Discussion in 'Spigot Plugin Development' started by KyleMan, May 25, 2015.

  1. So I just updated to 1.8.6 and now when I set saplings it sets oak saplings instead of birch and I have looked and looked to change from oak to birch but I cannot figure it out. Please help :)
    Code (Text):

    if((locUnder.getBlock().getType() == Material.DIRT) || (locUnder.getBlock().getType() == Material.GRASS)){
                w.dropItem(block.getLocation(), drop);
                event.setCancelled(true);
                b.setType(Material.SAPLING); //THE THING I WANA FIX
     
    I tried using setData but I am sure I dont know how to use it
     
  2. b.setData((short)2) should do the trick ;)
     
  3. This worked! Thanks! Only thing is is that it is depreciated. Lets just hope it is not removed :p