Jump to content

Checking the bank


farmerGold

Recommended Posts

 
public class Bank
extends ItemContainer
Represents the API regarding bank functionality.
 
contains
public boolean contains(java.util.List<Item> items)
Determines whether or not this containers contains any of the specified items.
Parameters:
items - The items to match.
Returns:
True if the containers contains at least one item matched.

 

getBank().contains("TriHard")

 

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
On 5/1/2017 at 9:58 PM, Chris said:


 

public class Bank
extends ItemContainer
Represents the API regarding bank functionality.
 

contains
public boolean contains(java.util.List<Item> items)
Determines whether or not this containers contains any of the specified items.
Parameters:
items - The items to match.
Returns:
True if the containers contains at least one item matched.

 


getBank().contains("TriHard")

 

Hi, 

Using that, how would I display # of a item in paint? I just need to be able to call it?

Maybe, puclic int = getbank... something...

Or would it be more complicated than that? Where I have to update a number every time I open the bank?

  • Like 1
Link to comment
Share on other sites

11 hours ago, Chris said:

int numberOfPogChamps;

if (getBank().isOpen()){
    numberOfPogChamps += getBank().getAmount("PogChamp");
}

//onPaint
g.drawString("# of Pogchamps: " + numberOfPogChamps, 20, 50);

 

This will add the bank amount each time you open the bank. So if you have 200 and open the bank twice it will say 400 instead of 200. You should update the var like:

 numberOfPogChamps += getBank().getAmount("PogChamp") - numberOfPogChamps;

//or

 numberOfPogChamps = getBank().getAmount("PogChamp")

This way it will only update the changes.

Edited by LoudPacks
  • Like 1
Link to comment
Share on other sites

6 hours ago, LoudPacks said:

This will add the bank amount each time you open the bank. So if you have 200 and open the bank twice it will say 400 instead of 200. You should update the var like:


 numberOfPogChamps += getBank().getAmount("PogChamp") - numberOfPogChamps;

//or

 numberOfPogChamps = getBank().getAmount("PogChamp")

This way it will only update the changes.

yeah u rite but i figured he would know that after a few tests xD

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...