Thread: Need a bit of help..

Results 1 to 10 of 10
  1. #1 Need a bit of help.. 
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    Alright so trying to modify bank so hardcore ironman can only have 5 bank slots.

    Originally it was
    Code:
    	@Override
    	public int capacity() {
    		return 352;
    	}
    I changed it to
    Code:
    	@Override
    	public int capacity() {
    		if(player.getGameMode() == GameMode.HARDCORE_IRONMAN) {
    			return 5;
    		
    		} else {
    
    		return 352;
    		}
    	}
    Without error, however when the player logs in/out I get errors about bank tab saving..

    Code:
    WARNING: An error has occured while saving a character file!
    java.lang.NullPointerException
    	at com.mpk.world.entity.impl.player.PlayerSaving.save(PlayerSaving.java:132)
    	at com.mpk.world.entity.impl.player.Player.save(Player.java:248)
    	at com.mpk.world.entity.impl.player.PlayerHandler.handleLogout(PlayerHandler.java:242)
    	at com.mpk.world.World.sequence(World.java:132)
    	at com.mpk.engine.GameEngine.run(GameEngine.java:44)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Also getting another one which is the ironman line above.

    Line 132 of Playersaving.java is:

    Code:
    			object.add("bank-0", builder.toJsonTree(player.getBank(0).getValidItems()));
    I'm still learning and didn't know what else to try without fucking things up worse.

    Thanks.
    Reply With Quote  
     

  2. #2  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Pretty sure this only happens to existing accounts. Create a new one and try again.
    Reply With Quote  
     

  3. #3  
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    Quote Originally Posted by Eldritch View Post
    Pretty sure this only happens to existing accounts. Create a new one and try again.
    Nope :/

    Gives a nullpointer.

    Code:
    java.lang.NullPointerException
    	at com.mpk.model.container.impl.Bank.capacity(Bank.java:125)
    	at com.mpk.model.container.ItemContainer.<init>(ItemContainer.java:99)
    	at com.mpk.model.container.impl.Bank.<init>(Bank.java:25)
    	at com.mpk.world.entity.impl.player.PlayerHandler.handleLogin(PlayerHandler.java:77)
    	at com.mpk.world.World.sequence(World.java:122)
    	at com.mpk.engine.GameEngine.run(GameEngine.java:44)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    This is what it looks like ingame after that error lmao

    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Whats line 132 in playersaving. Or just put up the whole class
    Reply With Quote  
     

  5. #5  
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    Quote Originally Posted by Zivik View Post
    Whats line 132 in playersaving. Or just put up the whole class
    132:

    Code:
    object.add("bank-0", builder.toJsonTree(player.getBank(0).getValidItems()));
    Also the line:

    Code:
    		if(player.getGameMode() == GameMode.HARDCORE_IRONMAN) {
    is giving the nullpointer below..

    Code:
    java.lang.NullPointerException
    	at com.mpk.model.container.impl.Bank.capacity(Bank.java:125)
    	at com.mpk.model.container.ItemContainer.<init>(ItemContainer.java:99)
    	at com.mpk.model.container.impl.Bank.<init>(Bank.java:25)
    	at com.mpk.world.entity.impl.player.PlayerHandler.handleLogin(PlayerHandler.java:77)
    	at com.mpk.world.World.sequence(World.java:122)
    	at com.mpk.engine.GameEngine.run(GameEngine.java:44)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Reply With Quote  
     

  6. #6  
    Registered Member Plasmetic's Avatar
    Join Date
    Nov 2015
    Posts
    273
    Thanks given
    20
    Thanks received
    30
    Rep Power
    20
    Code:
    @Override
    	public int capacity() {
    		return 352;
    		} else if(player.getGameMode() == GameMode.HARDCORE_IRONMAN) {
    			return 5;
    	}
    I had a similar issue when trying to make it so UIM couldn't access banks. Had to switch placement of everything for it to read properly.

    At least, that's what I remember. Was also drinking that night so I might have this wrong.
    Reply With Quote  
     

  7. #7  
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    Quote Originally Posted by Plasmetic View Post
    Code:
    @Override
    	public int capacity() {
    		return 352;
    		} else if(player.getGameMode() == GameMode.HARDCORE_IRONMAN) {
    			return 5;
    	}
    I had a similar issue when trying to make it so UIM couldn't access banks. Had to switch placement of everything for it to read properly.

    At least, that's what I remember. Was also drinking that night so I might have this wrong.
    Trying to fight through this one, ill let you know

    Attached image
    Reply With Quote  
     

  8. #8  
    Registered Member Plasmetic's Avatar
    Join Date
    Nov 2015
    Posts
    273
    Thanks given
    20
    Thanks received
    30
    Rep Power
    20
    Quote Originally Posted by Temperature View Post
    Trying to fight through this one, ill let you know

    Attached image
    Hopefully you find a fix mate. I've never tried limiting banks with certain ranks so I'm clueless atm.
    Reply With Quote  
     

  9. #9  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    The issue is that 'player.getGameMode()' is returning null...

    Reading the stacktrace would have helped you.
    Reply With Quote  
     

  10. Thankful user:


  11. #10  
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    Fixed thanks
    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. Need a Bit of help
    By Devil in forum Help
    Replies: 0
    Last Post: 08-31-2010, 06:04 PM
  2. Need a bit of help
    By Devil in forum Help
    Replies: 1
    Last Post: 07-11-2010, 12:08 AM
  3. [PI]Just need a bit of help[PI]
    By polarx1 in forum Help
    Replies: 0
    Last Post: 06-20-2010, 08:28 PM
  4. Need a bit of help
    By denial in forum Help
    Replies: 6
    Last Post: 01-22-2010, 04:09 AM
  5. [525] Need little bit of help :)
    By F4t4lSniper in forum Help
    Replies: 4
    Last Post: 08-08-2009, 11:09 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
  •