-
Notifications
You must be signed in to change notification settings - Fork 152
Information configuration #679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JustDrven
wants to merge
13
commits into
HypixelDev:master
Choose a base branch
from
JustDrven:dev-config
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3e8f7be
chore(git): added config.yaml into .gitignore
JustDrven e81a339
chore(git): added config.yaml into .gitignore
JustDrven 9fee6dc
feat(config): created config manager for easier configuration
JustDrven 3a7a63b
chore(config): applied config manager
JustDrven 7f0ad58
chore(file): moved ConfigManager.java from "net.hypixel.api.example.c…
JustDrven c07b9a1
chore(docs): added tutorial to setup config
JustDrven 5ea2ef4
chore(java): improved imports
JustDrven a2d127f
feat(exceptions): created exception for missing values in config file
JustDrven a5ed3ec
chore(configs): improved getter for values in config & applied except…
JustDrven 6ded571
chore(configs): applied new config getter for config's values
JustDrven 2205a17
chore(code style): added ending line
JustDrven 4198b0a
feat(code style): added .editorconfig for remove non star imports
JustDrven dbbb83d
chore(code style): removed non stars imports
JustDrven File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
target | ||
Example/target | ||
Website/javadocs | ||
hypixel-api-example/src/main/resources/config.properties |
9 changes: 8 additions & 1 deletion
9
hypixel-api-core/src/main/java/net/hypixel/api/adapters/DateTimeTypeAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
hypixel-api-core/src/main/java/net/hypixel/api/adapters/GameTypeTypeAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
hypixel-api-core/src/main/java/net/hypixel/api/adapters/ServerTypeTypeAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
hypixel-api-core/src/main/java/net/hypixel/api/adapters/UUIDTypeAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
hypixel-api-core/src/main/java/net/hypixel/api/pets/impl/PetRarityImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
hypixel-api-core/src/main/java/net/hypixel/api/pets/impl/PetTypeImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# HypixelAPI Java Examples | ||
|
||
This codebase serves as examples for how to integrate the HypixelAPI into your project. | ||
This codebase serves as examples for how to integrate the HypixelAPI into your project. | ||
|
||
## Requirements | ||
|
||
Rename `config-config.properties` to `config.properties` and set your credentials. |
35 changes: 35 additions & 0 deletions
35
hypixel-api-example/src/main/java/net/hypixel/api/config/ConfigManager.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.hypixel.api.config; | ||
|
||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
public class ConfigManager { | ||
|
||
private static ConfigManager instance; | ||
|
||
public static ConfigManager getInstance() { | ||
if (instance == null) { | ||
instance = new ConfigManager(); | ||
} | ||
|
||
return instance; | ||
} | ||
|
||
private final Properties config = new Properties(); | ||
|
||
private ConfigManager() { | ||
try { | ||
String fileName = "config.properties"; | ||
|
||
InputStream input = ClassLoader.getSystemResourceAsStream(fileName); | ||
config.load(input); | ||
|
||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public Properties getConfig() { | ||
return config; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
hypixel-api-example/src/main/resources/config-example.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
HYPIXEL_API_KEY=71eb4b26-73b4-4d5b-9952-b078d76543f4 | ||
HYPIXEL=f7c77d99-9f15-4a66-a87d-c4a51ef30d19 | ||
GUILD_ID=53bd67d7ed503e868873eceb | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add an ending line here 😄