Solved -

Discussion in 'Plugin Development' started by PlayFriik, Dec 2, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    PlayFriik

    Fixed.
     
  2. Offline

    SyTeck

    If you get the block as PistonBaseMaterial, it has a method to change facing direction.
    You can then set it to BlockFace.NORTH;

    This code is not tested, and might need to be tweaked a little.

    Example:
    Code:java
    1. public void setFacingDirection() {
    2.  
    3. PistonBaseMaterial piston = (PistonBaseMaterial) new Location(Bukkit.getWorld("world"), 0, 0, 0).getBlock();
    4.  
    5. piston.setFacingDirection(BlockFace.NORTH);
    6.  
    7. }
     
  3. Offline

    mine-care

    SyTeck sugested one solution, The other way is to use data values on the ItemStack
    (new ItemStack(Material.PISTON, ammount,(byte)data))
    different datas will produce different rotations i think (not tested)
     
Thread Status:
Not open for further replies.

Share This Page