Get the direction of a piston by block

Discussion in 'Spigot Plugin Development' started by Webmets, Jun 7, 2017.

  1. Hey, i'm currently working on making a custom piston plugin, and for this I need to get the direction a piston is facing (UP, DOWN, NORTH, EAST, SOUTH, WEST) by the given block. I tried to cast the #getBlockState(), because that works for most things (signs, chest ect) but I cant find what class I should cast to, if I want to get the piston.

    Thanks for any help,
    ~ Webmets
  2. After I had a look at that post, I found that block#getData() to be a solution, but the method is deprecated so I wasnt sure if that was the best solution.

    but I guess deprecation doesnt really matter for this?