Thread: Server Error

Results 1 to 6 of 6
  1. #1 Server Error 
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    I need this fixed ASAP. When running the server I get this error:


    Read below.
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Na/aaaaaaa
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2011
    Posts
    161
    Thanks given
    9
    Thanks received
    12
    Rep Power
    3
    Post your spawn-config.cfg
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Nvm, fixed that.

    Code:
    [12/30/11 1:44 PM]: java.lang.NumberFormatException: For input string: "item = 1"
    [12/30/11 1:44 PM]: 	at java.lang.NumberFormatException.forInputString(Unknown Source)
    [12/30/11 1:44 PM]: 	at java.lang.Integer.parseInt(Unknown Source)
    [12/30/11 1:44 PM]: 	at java.lang.Integer.parseInt(Unknown Source)
    [12/30/11 1:44 PM]: 	at server.model.items.ItemDefinition.<init>(ItemDefinition.java:28)
    [12/30/11 1:44 PM]: 	at server.model.items.ItemDefinition.load(ItemDefinition.java:51)
    [12/30/11 1:44 PM]: 	at server.Server.main(Server.java:91)
    Code:
    package server.model.items;
    
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Scanner;
    
    public class ItemDefinition {
    
       public static ItemDefinition[] definitions;
       public int id;
       public int slot;
       public boolean stackable;
       public boolean note;
       public int reverseId;
       public int value;
       public int shopValue;
       public String name;
       public String examine;
    
    
       public ItemDefinition(String[] values) {
          this.id = Integer.parseInt(values[0]);
          this.name = values[1];
          this.examine = values[2];
          this.value = Integer.parseInt(values[3]);
          this.shopValue = Integer.parseInt(values[4]);
          this.slot = Integer.parseInt(values[5]);
          this.stackable = values[6].equals("1");
          this.note = values[7].equals("1");
          this.reverseId = Integer.parseInt(values[8]);
          definitions[this.id] = this;
       }
    
       public static void load() {
          definitions = new ItemDefinition[21000];
    
          try {
             Scanner e = new Scanner(new File("./data/itemdef.txt"));
             e.nextLine();
    
             while(e.hasNextLine()) {
                String line = e.nextLine();
                if(!line.startsWith("//")) {
                   String[] values = line.split("\t");
                   new ItemDefinition(values);
                }
             }
          } catch (Exception var3) {
             var3.printStackTrace();
             System.exit(1);
          }
    
       }
    
       public static void dump() throws IOException {
          FileWriter fw = new FileWriter(new File("./data/itemdef.txt"));
          ItemDefinition[] var4 = definitions;
          int var3 = definitions.length;
    
          for(int var2 = 0; var2 < var3; ++var2) {
             ItemDefinition def = var4[var2];
             if(def != null) {
                fw.write(def.id + "\t" + def.name + "\t" + def.examine + "\t" + def.value + "\t" + def.shopValue + "\t");
                fw.write(def.slot + "\t" + (def.stackable?"1":"0") + "\t" + (def.note?"1":"0") + "\t" + def.reverseId + "\r\n");
             }
          }
    
          fw.flush();
          fw.close();
       }
    
       public static ItemDefinition get(int id) {
          return definitions[id];
       }
    }
    Reply With Quote  
     

  5. #5  
    Registered Member
    Anadyr's Avatar
    Join Date
    Nov 2009
    Posts
    682
    Thanks given
    31
    Thanks received
    100
    Rep Power
    675
    Quote Originally Posted by Rusite View Post
    Nvm, fixed that.

    Code:
    [12/30/11 1:44 PM]: java.lang.NumberFormatException: For input string: "item = 1"
    [12/30/11 1:44 PM]: 	at java.lang.NumberFormatException.forInputString(Unknown Source)
    [12/30/11 1:44 PM]: 	at java.lang.Integer.parseInt(Unknown Source)
    [12/30/11 1:44 PM]: 	at java.lang.Integer.parseInt(Unknown Source)
    [12/30/11 1:44 PM]: 	at server.model.items.ItemDefinition.<init>(ItemDefinition.java:28)
    [12/30/11 1:44 PM]: 	at server.model.items.ItemDefinition.load(ItemDefinition.java:51)
    [12/30/11 1:44 PM]: 	at server.Server.main(Server.java:91)
    Code:
    package server.model.items;
    
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Scanner;
    
    public class ItemDefinition {
    
       public static ItemDefinition[] definitions;
       public int id;
       public int slot;
       public boolean stackable;
       public boolean note;
       public int reverseId;
       public int value;
       public int shopValue;
       public String name;
       public String examine;
    
    
       public ItemDefinition(String[] values) {
          this.id = Integer.parseInt(values[0]);
          this.name = values[1];
          this.examine = values[2];
          this.value = Integer.parseInt(values[3]);
          this.shopValue = Integer.parseInt(values[4]);
          this.slot = Integer.parseInt(values[5]);
          this.stackable = values[6].equals("1");
          this.note = values[7].equals("1");
          this.reverseId = Integer.parseInt(values[8]);
          definitions[this.id] = this;
       }
    
       public static void load() {
          definitions = new ItemDefinition[21000];
    
          try {
             Scanner e = new Scanner(new File("./data/itemdef.txt"));
             e.nextLine();
    
             while(e.hasNextLine()) {
                String line = e.nextLine();
                if(!line.startsWith("//")) {
                   String[] values = line.split("\t");
                   new ItemDefinition(values);
                }
             }
          } catch (Exception var3) {
             var3.printStackTrace();
             System.exit(1);
          }
    
       }
    
       public static void dump() throws IOException {
          FileWriter fw = new FileWriter(new File("./data/itemdef.txt"));
          ItemDefinition[] var4 = definitions;
          int var3 = definitions.length;
    
          for(int var2 = 0; var2 < var3; ++var2) {
             ItemDefinition def = var4[var2];
             if(def != null) {
                fw.write(def.id + "\t" + def.name + "\t" + def.examine + "\t" + def.value + "\t" + def.shopValue + "\t");
                fw.write(def.slot + "\t" + (def.stackable?"1":"0") + "\t" + (def.note?"1":"0") + "\t" + def.reverseId + "\r\n");
             }
          }
    
          fw.flush();
          fw.close();
       }
    
       public static ItemDefinition get(int id) {
          return definitions[id];
       }
    }
    learn to fucking read an exception please and you told me you changed and are a good 'coder' now. hmm
    '[12/30/11 1:44 PM]: java.lang.NumberFormatException: For input string: "item = 1"'
    youre trying to parse item = 1 when it should just be the string 1 all you have to do is remove 'item = '

    they see me durppin they fuuuin, they so loud, my hurp be hurrpin derpin. tryna catch me hurp n' durpin
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Dude, I didn't post this. My friend did, requesting lock, easy shit is easy.
    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

Similar Threads

  1. Replies: 14
    Last Post: 12-30-2011, 03:21 AM
  2. Replies: 4
    Last Post: 08-15-2011, 06:21 PM
  3. Replies: 20
    Last Post: 06-27-2011, 04:43 AM
  4. Replies: 8
    Last Post: 03-30-2011, 01:02 PM
  5. Server Error!
    By PrataKosong in forum Help
    Replies: 2
    Last Post: 04-14-2009, 11:41 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •