Solved Is there a way to set a colored glass with setType(Material.stained_glass)?

Discussion in 'Plugin Development' started by 360_, Oct 10, 2017.

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

    360_

    So im just trying to figure out how to set a block to a colored glass and not a normal glass with setType(Material.stained_glass)
     
  2. Offline

    Zombie_Striker

  3. Offline

    360_

  4. Offline

    Zombie_Striker

    @360_
    setType does not return anything. You will need to get the block's instance again and call setData on a separate line.
     
  5. Offline

    360_

  6. Offline

    Zombie_Striker

    @360_
    If you also include the world of that block, yes.
     
  7. Offline

    360_

  8. Offline

    MightyOne

    The method is deprecated. That does not mean you cannot use it, it is the only way to set data right now. You have to use @SupptessWarnings ("deprecation") for the method
     
  9. Offline

    Side8StarLite

    @360_
    You have to cast the argument. By the looks of it, you're using Eclipse, so hovering over the error will give you suggestions. Click on the suggestion and Eclipse will fix it for you.
    hover.jpg
     
  10. Offline

    360_

  11. Offline

    timtower Administrator Administrator Moderator

    @360_ Check the locations on those getBlock calls.
     
  12. Offline

    Side8StarLite

Thread Status:
Not open for further replies.

Share This Page