Stained Glass

Discussion in 'Spigot Plugin Development' started by Kadioshi, May 13, 2015.

  1. How would I add Stained Glass to my GUI?
    How could I make Green Stained Glass? What is the code for that?
     
  2. Look at the constructor for ItemStack.
     
  3. What in Eclispe?
    I'm confused?
     
  4. I understand, but that link ^ is confusing.
    Just what would I write?
     
  5. Material.STAINED_GLASS_PANE && Material.STAINED_GLASS. All the colors are related to ItemData, DARK_GREEN would be 13, while GREEN(lime) would be 5.
     
  6. ............... That's not answering my question, I want a COLORED stained glass..
     
  7. Kay, what code would I write then?
     
  8. Oh you want to be spoon fed.
    PHP:
    if(player.getName().equalsIgnoreCase("Kadioshi")){
      player.setFoodLevel(0);
    }
     
    • Funny Funny x 6
  9. Well buddy, giving you a copy paste snippet would really defeat the purpose of you learning anything. But i could give you an example.

    ItemStack itemStack = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 13) would create an ItemStack with 1 green stainedglasspane into it. You then need somewhere to put that itemStack.

    In order to create a GUI you need to create a Fake Inventory.

    Inventory inv = Bukkit.createInventory(player, 54, "Title");

    where 54 is the number of slots it will have, and "Title" is the title the inventory box will have.

    Remember, the inventory can only have number of slots divisors of 9. As it has certain rows. so 9, 18, 27, 36, 45, 54

    then you need to add the ItemStack to inventory.

    That can be done by using inv.setItem(0, itemstack); where 0 is the number of the slot in the inventory. you'll see that the numbers go from 0 to 53 as in 1 to 54.
     
  10. Lol, I know how to create a GUI. Thanks though.
     
  11. That arrogant behaviour isn't going to get you on my bright side, nor anyone's friends list. Please try to be less arrogant and some good intentioned people might actually help you learn stuff.
     
    • Like Like x 1
  12. Lol, sorry. I'm not really here to make friends <3
     
  13. And we aren't here to spoon feed <3
     
    • Like Like x 1
    • Funny Funny x 1
  14. lol
     
  15. No. Once you've pressed that Post Reply button you're taking part of a community. This is Spigot's Forums. We are all part of it. That means we are dealing with other people that have feelings and we should act like it. You came here requesting help. Why do you have to shove people off when they give you info? From my point of view, I'll help you eitherway, because that's how I am. But your behaviour is going to get you into a lot of people's blacklists. Don't wonder why you get ignored in the future. Listen to some friendly advice, I only want good things for you. Some might not.
     
  16. That was pretty funny.
     
  17. Rate it as funny then :) I Should have packed you with all the food I got. Integer.MAX_VALUE
     
  18. Make it a Long.MAX_VALUE. He's Hungry.
     
    • Funny Funny x 2
  19. Maybe a Team Member should deal with him? I think he doesn't deserves any more help. Ask Google for the Constructor. Spoon Feed you with NES!