Block.setData() deprecated

Discussion in 'Plugin Development' started by Oneric-1st, Dec 14, 2013.

Thread Status:
Not open for further replies.
  1. Hi
    I want to update my Plugin to 1.7.2, but the method setData(byte b) in the class Block seems to be deprecated. Does anybody know what can be used instead of it ?
    I need this to change the Metadata of Blocks.


    Thanks in advance !

    ~Oneric
     
  2. Offline

    NathanWolf

    That method has been deprecated for ages. I'm still using it and they' have to pry it out of my cold dead hands... :D

    Anyway, if you want to avoid the problem, you need to use the MaterialType classes to do what you want. Personally I find this system pretty clunky to use, especially if you don't know the Material you're working with in advance.

    Otherwise just suppress the warning and move on... :)
     
  3. Ok, for setting Blocks I can use
    Code:
    setType(Material.AIR)
    but I couldn't find any way to set the MEtadata of the Block without using the depecated setData(byte b) or setData(byte b, boolean b2) which is also deprecated ?

    ~Oneric
     
Thread Status:
Not open for further replies.

Share This Page