Jump to content

Checking the bank


Recommended Posts

Posted
 
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
  • 2 weeks later...
Posted
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
Posted (edited)
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
Posted
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
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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