Skip to content

Commit 1f6881b

Browse files
authored
Merge pull request #24 from dec4234/19-update-documentation
19 update documentation
2 parents 2358d44 + 3bfc31e commit 1f6881b

File tree

5 files changed

+180
-57
lines changed

5 files changed

+180
-57
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<p align="center">
22
<img src="https://user-images.githubusercontent.com/22875520/119843615-b6da3f80-bed5-11eb-8d3e-b2432a993454.png">
3+
<a href="https://discord.gg/dvZmP92d4h"><img src="https://discordapp.com/api/guilds/847480795232993280/widget.png?style=banner2"></a>
34
</p>
45

5-
[![Discord Banner 2](https://discordapp.com/api/guilds/847480795232993280/widget.png?style=banner2)](https://discord.gg/dvZmP92d4h)
6-
76
# JavaDestinyAPI
87
This library is used as an interface to the API for the game Destiny 2, created by Bungie.
98

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

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

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

54+
### An aside about APIException
55+
As of 4/30/2024, all functions that interact with the API in any way (i.e. could make an HTTP request) throw APIException.
56+
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
57+
add "throws" to your function signature.
58+
<br>
59+
This was done because the old way could create a lot of runtime exceptions which were hard to account for.
60+
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)
61+
which indicates when Bungie has disabled the API for maintenence. This may be useful to tell your user's that the API is offline.
62+
5463
## How's it made?
5564
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/).
5665

5766
### TO-DO
5867
- Managing inventory / Item transferring
5968
- Collections / Triumphs
60-
- Revamping the wiki
61-
62-
### Contributing
63-
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.
69+
- Revamping the wiki

src/main/java/net/dec4234/javadestinyapi/material/inventory/items/InventoryItem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
import java.util.ArrayList;
1818
import java.util.List;
1919

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

2228
private static HttpUtils httpUtils = DestinyAPI.getHttpUtils();

src/main/java/net/dec4234/javadestinyapi/material/inventory/loadouts/Loadout.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import java.util.ArrayList;
1414
import java.util.List;
1515

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

1821
private String colorHash;

0 commit comments

Comments
 (0)