Thread: Player.java

Results 1 to 9 of 9
  1. #1 Player.java 
    Registered Member
    Join Date
    Jan 2015
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    When I added Clue scroll reward chest in player.java

    private transient ClueBox clueBox;

    clueBox = new ClueBox();

    public ClueBox getClueBox() {
    return clueBox;
    }
    Added them into player.java but I try to open it, it sets player to null and doesn't open. What have I missed?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2015
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    anyone know what im missing?
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Jul 2014
    Posts
    509
    Thanks given
    90
    Thanks received
    87
    Rep Power
    503
    Are there any errors in the console or compiler?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2015
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Nope, made it send a message to the console if player == null, and it sent the message, but there's no errors.
    Reply With Quote  
     

  5. #5  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    I don't exactly understand the code but I don't know if this could fix it?

    Code:
    public ClueBox getClueBox() {
    if (clueBox == null) {
        clueBox = new ClueBox(); 
    }
    return clueBox;
    }
    Project thread
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jan 2015
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by clem585 View Post
    I don't exactly understand the code but I don't know if this could fix it?

    Code:
    public ClueBox getClueBox() {
    if (clueBox == null) {
        clueBox = new ClueBox(); 
    }
    return clueBox;
    }
    Yeah i've already tried that and it didn't work, not sure why it' snot working
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jan 2014
    Posts
    1,652
    Thanks given
    428
    Thanks received
    501
    Rep Power
    221
    Quote Originally Posted by JackThomson View Post
    Yeah i've already tried that and it didn't work, not sure why it' snot working
    Initialize cluebox on player init.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2015
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Joris View Post
    Initialize cluebox on player init.
    Code:
    clueBox = new ClueBox();
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Post the Cluebox code
    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. Method in Player.java rep+
    By massacre561 in forum Help
    Replies: 2
    Last Post: 11-25-2009, 12:01 PM
  2. Replies: 31
    Last Post: 10-17-2009, 08:51 PM
  3. Whats the point in Player.java?
    By bloodargon in forum Help
    Replies: 8
    Last Post: 09-27-2009, 04:08 AM
  4. Do I need to add this in player.java?
    By N_1c. in forum Help
    Replies: 2
    Last Post: 08-01-2009, 11:30 PM
  5. Player.java help
    By CTucker in forum Help
    Replies: 1
    Last Post: 02-10-2009, 04:17 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
  •