Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/22875520/119843615-b6da3f80-bed5-11eb-8d3e-b2432a993454.png">
<a href="https://discord.gg/dvZmP92d4h"><img src="https://discordapp.com/api/guilds/847480795232993280/widget.png?style=banner2"></a>
</p>

[![Discord Banner 2](https://discordapp.com/api/guilds/847480795232993280/widget.png?style=banner2)](https://discord.gg/dvZmP92d4h)

# JavaDestinyAPI
This library is used as an interface to the API for the game Destiny 2, created by Bungie.

Expand Down Expand Up @@ -37,7 +36,8 @@ You need to get an API key from [bungie.net/developer](https://bungie.net/develo
```java
DestinyAPI api = new DestinyAPI().setApiKey("YOUR API KEY HERE");
```
*Must be intialized before any parts of the API are used!*
**IMPORTANT:** *DestinyAPI MUST be the first thing initialized before making any interactions with the API! This is because
all interactions with the API rely on the API Key set in DestinyAPI.*

**Getting the time played in hours, of the user named dec4234#9904**
```java
Expand All @@ -51,13 +51,19 @@ System.out.println(new Clan("Heavenly Mayhem").getFounder().getSupplementalDispl

Check out the [wiki](https://github.com/dec4234/JavaDestinyAPI/wiki/Getting-Started) for more specific examples and information.

### An aside about APIException
As of 4/30/2024, all functions that interact with the API in any way (i.e. could make an HTTP request) throw APIException.
This is to allow for you, the user, to handle API errors in the way you see fit. This means you must use a try/catch or
add "throws" to your function signature.
<br>
This was done because the old way could create a lot of runtime exceptions which were hard to account for.
The most important error you may want to look at is [APIOfflineException](https://github.com/dec4234/JavaDestinyAPI/blob/master/src/main/java/net/dec4234/javadestinyapi/exceptions/APIOfflineException.java)
which indicates when Bungie has disabled the API for maintenence. This may be useful to tell your user's that the API is offline.

## How's it made?
There is both official and unofficial documentation for the API available on [destinydevs.github.io](http://destinydevs.github.io/BungieNetPlatform/docs/Endpoints) and on the [offical bungie api documentation](https://bungie-net.github.io/).

### TO-DO
- Managing inventory / Item transferring
- Collections / Triumphs
- Revamping the wiki

### Contributing
All development since 3/10/2022 on new features occurs within the [dev](https://github.com/dec4234/JavaDestinyAPI/tree/dev) branch. Clone that and submit a pull request with your changes.
- Revamping the wiki
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
import java.util.ArrayList;
import java.util.List;

/**
* An InventoryItem describes any item contained in a player's or one of their characters inventories.
* This could be a weapon, armor piece, ghost, etc.
* <p>
* This class is currently incomplete. If you would like to contribute, please create a pull request on GitHub
*/
public class InventoryItem extends DestinyItem {

private static HttpUtils httpUtils = DestinyAPI.getHttpUtils();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import java.util.ArrayList;
import java.util.List;

/**
* This class is currently incomplete. If you would like to contribute, please create a pull request on GitHub
*/
public class Loadout {

private String colorHash;
Expand Down
Loading