Thread: NullPointerException

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11  
    Registered Member
    Lingerz's Avatar
    Join Date
    Dec 2008
    Age
    29
    Posts
    396
    Thanks given
    2
    Thanks received
    2
    Rep Power
    176
    As far as I can tell it throws the NullPointerException when I try do anything that is in client.class.
    Reply With Quote  
     

  2. #12  
    a7x&FF5=SEX
    Guest
    I lold cause it took like 5 people to explain it to this nub and he still doesn't get it.

    Here is the short version.
    Either undo what you just did and it will work fine, then try to do it a different way.
    or go to the line(s) that gives you the error and correct the problem.

    End of story, Good luck
    Reply With Quote  
     

  3. #13  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    how did you add your object class?

    you should have added it like this

    Code:
    /**
     * Fletching Class
     *
     * Info: 
     * In server.java add public static Fletching fletching = new Fletching();
     * In the parseincomingpackets method on case 53: add at the end server.fletching.Fletching(this, packetType, packetSize);
     *
     * @author Lmctruck30
     */
    
    public class Fletching {
    
    	public void Fletching(Client p, int packetType, int packetSize) {
    	
    		switch(packetType) {
    		
    		/*
    		 * Case 53: Item On Item Packet 53
    		 */
    		case 53:
    			int p4 = 0;
    			int p6 = 0;
    			int usedWithSlot = inStream.readUnsignedWord();
    			int itemUsedSlot = inStream.readUnsignedWordA();
    			int interface1284 = inStream.readUnsignedWord();
    			int interfacek = inStream.readUnsignedWord();
    			int useWith = playerItems[usedWithSlot]-1;
    			int itemUsed = playerItems[itemUsedSlot]-1;
    
    			if(itemUsed == 946 && useWith == 1511) {
    				p.deleteItem(1511, getItemSlot(1511), 1);
    				p.addItem(50, 1);
    				p.sendMessage("you made a unstrung shortbow");
    				p.addSkillXP(200*playerLevel[9], 9);
    			}
    			
    		}
    		
    	}
    	
    }
    Attached image
    Reply With Quote  
     

  4. #14  
    Registered Member
    Lingerz's Avatar
    Join Date
    Dec 2008
    Age
    29
    Posts
    396
    Thanks given
    2
    Thanks received
    2
    Rep Power
    176
    Fixed. Thanks to all who tried to help.
    Reply With Quote  
     

  5. #15  
    Apple Computers
    Bridget7298's Avatar
    Join Date
    Aug 2007
    Age
    32
    Posts
    1,088
    Thanks given
    99
    Thanks received
    49
    Rep Power
    219
    Quote Originally Posted by a7x&FF5=SEX View Post
    I lold cause it took like 5 people to explain it to this nub and he still doesn't get it.

    Here is the short version.
    Either undo what you just did and it will work fine, then try to do it a different way.
    or go to the line(s) that gives you the error and correct the problem.

    End of story, Good luck
    Here is a the short version.
    Either your a dumb shit and that undoing what he did wont fix the problem, then try to stay off rune-server a different way. or go to runelocus(s) that gives you the dumb knowledge and correct your life.

    End of story, Good luck
    Reply With Quote  
     

  6. #16  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Null means nonexistant. To use an object, you must create an instance of it, or use a static one. Soemthing as, String s; is not an object, but a declaration that can point to any String object. When you refrence to that declaration and it points to no object, a nullpointerexception is thrown.
    Reply With Quote  
     

  7. #17  
    Registered Member
    Its paris's Avatar
    Join Date
    Apr 2009
    Posts
    1,141
    Thanks given
    56
    Thanks received
    234
    Rep Power
    689
    why does always someone just before me explain it correctly . I want to help... xd
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

Thread Information
Users Browsing this Thread

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


User Tag List

Tags for this Thread

View Tag Cloud

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