Skip to content

Commit 9eede1c

Browse files
committed
2 parents 8162841 + cd4ae53 commit 9eede1c

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

.github/workflows/build.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Java CI with Maven
2+
3+
concurrency:
4+
group: "maven-build"
5+
cancel-in-progress: true
6+
7+
permissions:
8+
contents: write
9+
10+
on:
11+
push:
12+
branches: [ master ]
13+
paths-ignore:
14+
- '*.md'
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: 17
25+
distribution: 'zulu'
26+
cache: maven
27+
- name: Build with Maven
28+
run: mvn -B package --file pom.xml
29+
- name: Release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
tag_name: "latest"
33+
name: "Automatic Build"
34+
body: "Automatically released build for Maven"
35+
prerelease: true
36+
files: |
37+
./target/*.jar

docs/currencies.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Currencies
2+
3+
### Create the class
4+
```java
5+
public static class MyCurrency extends CaramelCurrency {
6+
public MyCurrency() {
7+
super(Plugin, "Name", "id", 10); // Plugin, Name, ID, Default amount
8+
}
9+
}
10+
```
11+
### Register
12+
```java
13+
CaramelCurrency currency;
14+
15+
public void onEnable() {
16+
Caramel.getInstance().currencies.register(currency = new MyCurrency());
17+
}
18+
public void onDisable() {
19+
Caramel.getInstance().currencies.getCurrencyList().remove(currency);
20+
}
21+
```
22+
23+
### Using it
24+
Simply use the instance you've set up with these functions:
25+
```java
26+
// Currency methods
27+
currency.setValue(UUID, double) -> double
28+
currency.addValue(UUID, double) -> double
29+
currency.getValue(UUID) -> double
30+
currency.getSaveDataFile() -> CaramelBlankConfig
31+
```

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ Caramel has a few main features.
3030
- [Commands](https://pages.klash.dev/Caramel/commands)
3131
- [Items](https://pages.klash.dev/Caramel/items) - Docs incomplete
3232
- [Guis](https://pages.klash.dev/Caramel/guis)
33-
- [Currencies](https://pages.klash.dev/Caramel/currencies) - Docs incomplete
33+
- [Currencies](https://pages.klash.dev/Caramel/currencies)
3434
- [Recipes](https://pages.klash.dev/Caramel/recipes) - Docs incomplete
3535
- [Configs](https://pages.klash.dev/Caramel/configs) - Docs incomplete

0 commit comments

Comments
 (0)