Setting the color of wool, stained glass and panes

Discussion in 'Plugin Development' started by EvilPeanut, Dec 14, 2013.

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

    EvilPeanut

    Hello,

    How can I set the color of wool, stained glass and stained glass panes without using depreciated methods?

    Thanks,
    Reece
     
  2. Offline

    DrMedia

    I don't believe this is possible..
     
  3. Offline

    EvilPeanut

    Haha lovely!
     
  4. Offline

    ROKLGAMES

    Maybe this will help,
    Code:java
    1. if(b.getState().getData() instanceof Wool){
    2. Wool w = ((Wool)b.getState().getData());
    3. DyeColor color = w.getColor();
    4. }

    Not sure if its what you're looking for.
     
  5. Offline

    JPG2000

    EvilPeanut How to create wool with color:
    Code:java
    1. ItemStack wool = new ItemStack(Material.WOOL, 1, DyeColor.BLACK.getData());
     
  6. Offline

    NathanWolf

    For stained glass, you have to use the deprecated setData method, or wait for the 1.7 build to include a stained glass material type that supports color (last I checked it wasn't there yet)

    I'm sure this will get implemented before a 1.7 RB is released.
     
  7. Offline

    EvilPeanut


    Thanks but im trying to set the color of a wool block, any ideas?
     
  8. Offline

    AoH_Ruthless

    EvilPeanut
    Do you mean you want to set a color of wool that's already placed?
     
  9. Offline

    EvilPeanut

  10. Offline

    Chlorek

    Bump
    Would be nice to know how to do this without deprecated methods!
     
  11. Offline

    pope_on_dope

    deprecated methods are the way to go :)
    Code:
    ItemStack blackwool = new ItemStack(Material.WOOL, 1, DyeColor.BLACK.getData());
     
    ChipDev likes this.
  12. Offline

    Chlorek

    pope_on_dope
    Hell people! Can you read! I am not stupid and I can do it in ItemStack, just need way to set it when it is block! Anyway I know it is not possible to do any other way than this depracted method.
     
  13. Offline

    breezeyboy

    Get the block, cast it to wool and change the color. Most of the depressed stuff hasn't been readded so no harm in using them
     
  14. Offline

    EnchantedMiners

    Can i say this idk why i am saying it but i will say it so i think is way easier to use this method
    Code:java
    1. public static ItemStack bluewool = new ItemStack(Material.WOOL, 0, (short)1);
    2. // the (short)1 will work as the itemid:2 so with that code it should give a hmmm wool:1 i think is easier than doing the wool item meta ;)
    3.  

    there ;)
     
  15. Offline

    Freelix2000

    Hell person! This isn't your thread! =P
     
  16. Offline

    ItsMattHogan

    Get the block that you want to change and replace it with the changed version.
     
  17. Offline

    PePsiGam3r

    Block#setData is the way to set the data of a placed block.
     
  18. Offline

    mythbusterma

    PePsiGam3r

    Did you really need to necro this thread? They know that, they were asking if it was possible without deprecated methods, and the answer was already given.
     
  19. Offline

    PePsiGam3r

  20. Offline

    Chintzi

    Can someone just show it simple on how to set the Item Meta please :D
     
  21. Chintzi Well firstly congratulations on the 3rd time this thread has been necro'd... is it not time to let it rest in peace?

    Also, I have no idea what you mean by 'set the Item Meta', because I don't think you really mean just ItemStack#setItemMeta()...
     
Thread Status:
Not open for further replies.

Share This Page