Solved Getting itemstack out of sign

Discussion in 'Plugin Development' started by ArsenArsen, Jul 12, 2014.

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

    ArsenArsen

    Hello guys, i need to get line 2 of sign as quantity, and line 3 as item, line 4 as price, Like:
    |-------------------------------------------|​
    | [Sell] |​
    | 1 |​
    | Acacia |​
    | $1000 |​
    |--------------------------------------------|​
    And it will give you 1 acacia if you have 1000$, for example​
     
  2. Offline

    mythbusterma

    You can just use Integer.parseInt(String) to get a number from a string, and for the price you can remove the dollar sign and do this.

    For the item you would have to do Material.matchMaterial(String) to try and guess the material, but an item id would be more reliable using Material.getMaterial(int).
     
    ArsenArsen likes this.
  3. Offline

    Necrodoom

  4. Offline

    mythbusterma

    Fixed.
     
    Necrodoom likes this.
  5. Offline

    ArsenArsen

    I was placing number to wrong place, and forgot parsing, thanks!
     
Thread Status:
Not open for further replies.

Share This Page