Thread: Max pickup Amount bug

Results 1 to 6 of 6
  1. #1 Max pickup Amount bug 
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,541
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1003
    Topic title says it.

    Every time a player tries to pickup a amount higher than the server limit is you get this error

    Code:
    E: java.lang.NumberFormatException: For input string: "9999999999"
    E: 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    E: 	at java.lang.Integer.parseInt(Integer.java:459)
    E: 	at java.lang.Integer.parseInt(Integer.java:497)
    E: 	at client.customCommand(client.java:7637)
    E: 	at client.parseIncomingPackets(client.java:14020)
    E: 	at client.packetProcess(client.java:16384)
    E: 	at PlayerHandler.process(PlayerHandler.java:289)
    E: 	at process.run(process.java:23)
    E: 	at java.lang.Thread.run(Thread.java:619)
    Would i just make an If statement telling if the max typed amount is > than the max limit of the server can handle do i just make a sendmessage too
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    May 2008
    Posts
    2,327
    Thanks given
    55
    Thanks received
    67
    Rep Power
    0
    just change the max to the highest which is 2^31-1 or 2Bil(with alot of other numbers)
    Reply With Quote  
     

  3. #3  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,541
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1003
    Isn't this over the max tho
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Dec 2006
    Age
    25
    Posts
    2,196
    Thanks given
    5
    Thanks received
    23
    Rep Power
    0
    max for an int is 2.47m you can make it longer by using a long to store your item amounts but you'd have to change ALOT in your server and it might not even work.. Theres no way to fix that error because an int has a limit and exceeding this limit isa problem
    Reply With Quote  
     

  5. #5  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,541
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1003
    Well, Okay thank you for helping.
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    numberformatexcption is when you try to parse an int from a string and the string gets converted.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •