How to set itemName [Solved]

Discussion in 'Plugin Development' started by Gabriel333, Dec 31, 2011.

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

    Gabriel333

    Im trying to change the itemName og a Book with this piece of code:

    Code:
    String str = title+" written by"+author;
             SpoutManager.getMaterialManager().setItemName(Material.BOOK, str);
    But I get the error "The method setItemName(Material, String) in the type MaterialManager is not applicable for the arguments (Material, String)" in Eclipse??? Can anyone tell me what Im doing wrong?
     
  2. Try changing it to org.getspout.spoutapi.material.Material.BOOK ?
     
  3. Offline

    Gabriel333

    Hi Tips.

    I found out that the right way was to use "MaterialData.book" instead of "Material.BOOK".

    Code:
    String str = title+" written by"+author;
    SpoutManager.getMaterialManager().setItemName(MaterialData.book, str);
     
  4. Alright, cool. I knew it was something like that :)
     
Thread Status:
Not open for further replies.

Share This Page