Solved The constructor ItemStack(int, int, short) is deprecated

Discussion in 'Plugin Development' started by Sicka_gp, Nov 13, 2013.

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

    Sicka_gp

    Hi, does anyone know how to solve this?

    "The constructor ItemStack(int, int, short) is deprecated."

    Code:java
    1. public void setKits(Player p){
    2. for(String item : plugin.getConfig().getStringList("Newbies.Items")){
    3. String[] itemdata = item.split("-",2);
    4. int id, amount, itemsdatabyte;
    5. String[] itemsdata = itemdata[0].split(":", 2);
    6. try{
    7. itemsdatabyte = Integer.parseInt(itemsdata[1]);
    8. id = Integer.parseInt(itemsdata[0]);
    9. amount = Integer.parseInt(itemdata[1]);
    10. p.getInventory().addItem(new ItemStack(id, amount, (short)itemsdatabyte));
    11. }
    12. ConfigurableMessages.log.info("[ConfigurableMessages] Error! : Incorrect item format '"+ item +"', skipping!");
    13. }
    14. }
    15.  
    16.  
    17. }
     
  2. Offline

    adam753

  3. Offline

    Sicka_gp

Thread Status:
Not open for further replies.

Share This Page