How to set sapling species? [Solved]

Discussion in 'Spigot Plugin Development' started by dark4rr0w, Jul 3, 2015.

  1. Hi all. I'm having a problem with setting a sapling species.
    Code (Text):

    BlockState state =l.getBlock().getState();
                   MaterialData data = state.getData().clone();
                   Block a=l.getWorld().getHighestBlockAt(l);
    The l.getBlock() is a log and i want to plant a sapling depending on that log's data. What am I doing wrong? I know that data returns actual data value, but when i make this data sapling's data, it returns 0 after i use
    Code (Text):
  2. Never mind fixed it by replacing:
    Code (Text):
    Code (Text):