Results 1 to 4 of 4
  1. #1
    empire is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default nullpointer exception

    i keep getting a nulledpointer i dont know what its causing any help would be appericated :)

    Java Code:
    ERROR! THREAD NAME: World Thread
    java.lang.NullPointerException
            at com.rs.game.player.controlers.Controler.getArguments(Controler.java:2
    7)
            at com.rs.game.player.controlers.GraveStoneControler.<init>(GraveStoneCo
    ntroler.java:12)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at java.lang.Class.newInstance0(Unknown Source)
            at java.lang.Class.newInstance(Unknown Source)
            at com.rs.game.player.controlers.ControlerHandler.getControler(Controler
    Handler.java:119)
            at com.rs.game.player.ControlerManager.startControler(ControlerManager.j
    ava:42)
            at com.rs.game.player.Player$16.run(Player.java:1929)
            at com.rs.game.tasks.WorldTasksManager.processTasks(WorldTasksManager.ja
    va:19)
            at com.rs.cores.WorldThread.run(WorldThread.java:24)
    here is me .java file

    Java Code:
    package com.rs.game.player.controlers;
    
    import com.rs.game.World;
    import com.rs.game.WorldObject;
    import com.rs.game.WorldTile;
    import com.rs.game.tasks.WorldTask;
    import com.rs.game.tasks.WorldTasksManager;
    
    public class GraveStoneControler extends Controler {
    
    	public static int ticks = 300;
    	public WorldTile lastTile = (WorldTile) getArguments()[0];
    
    	@Override
    	public void start() {
    		this.player.getPackets().sendGameMessage(
    				"You have 3 minutes to pickup your loot.");
    	}
    
    	@Override
    	public void process() {
    		if (player.startedGraveStoneTimer) {
    			final WorldTile tile = lastTile;
    			WorldTasksManager.schedule(new WorldTask() {
    				public void run() {
    					int minutes = ticks / 100;
    					int seconds = (int) ((ticks - (minutes * 100)) * 0.6);
    					String time = (minutes < 10 ? "0" + minutes : minutes)
    							+ ":" + (seconds < 10 ? "0" + seconds : seconds);
    					
    					if (ticks == 100) {
    						player.getPackets()
    								.sendGameMessage(
    										"You have 1 minute left to pickup your loot, so hurry up!");
    					}
    					
    					if (ticks == 0) {
    						WorldObject object = World.getObject(tile, 10);
    						if(object != null) {
    							World.removeObject(object, true);
    						}
    						player.getHintIconsManager().removeUnsavedHintIcon();
    						player.getPackets().sendHideIComponent(548, 21, true);
    						player.getPackets().sendHideIComponent(548, 22, true);
    						player.getPackets().sendGameMessage("Your .... collapsed.");
    						player.startedGraveStoneTimer = false;
    						ticks = 300;
    						this.stop();
    						removeControler();
    						WorldTasksManager.removeTask();
    					} 
    					
    					if(ticks > 0) {
    						--ticks;
    						if (player.getInterfaceManager().containsInterface(548)) {
    							player.getPackets().sendHideIComponent(548, 21, false);
    							player.getPackets().sendHideIComponent(548, 22, false);
    							player.getPackets().sendIComponentText(548, 22, "" + time);
    						} else {
    							player.getPackets().sendHideIComponent(746, 187, false);
    							player.getPackets().sendHideIComponent(746, 188, false);
    							player.getPackets()
    								.sendIComponentText(746, 188, "" + time);
    						}
    					}
    				}
    			}, 0, ticks);
    		}
    	}
    	
    	@Override
    	public boolean processObjectClick1(WorldObject object) {
    		return true;
    	}
    
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: nullpointer exception

    You haven't posted the Controler class, and in particular its getArguments() method, and in particular line 27 of the class.

  3. #3
    empire is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: nullpointer exception

    REQ Delete

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: nullpointer exception

    We don't delete content from the forum without a valid reason. I'm closing this thread as it appears you do not want to discuss your problem.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. NULLPointer Exception
    By phyzix5761 in forum New To Java
    Replies: 7
    Last Post: 11-08-2012, 04:53 AM
  2. Nullpointer exception
    By Games2Design in forum New To Java
    Replies: 4
    Last Post: 10-20-2012, 12:15 AM
  3. Nullpointer Exception???
    By kipcorn91 in forum AWT / Swing
    Replies: 5
    Last Post: 10-28-2010, 11:19 PM
  4. NullPointer exception
    By bdario1 in forum New To Java
    Replies: 15
    Last Post: 03-17-2010, 04:44 AM
  5. NullPointer Exception
    By Preethi in forum New To Java
    Replies: 8
    Last Post: 02-06-2008, 03:40 PM

Posting Permissions

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