Skip to content

Commit 0da6a98

Browse files
committed
Update readme
1 parent 4d93f20 commit 0da6a98

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

README.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,79 @@ Our focus lies within a basic implementation of a generic api for collect server
1212

1313
## More information / external links
1414

15-
Discord: https://discord.onelitefeather.de
15+
Discord: https://discord.onelitefeather.de
16+
17+
## Get started
18+
<details>
19+
<summary><strong>Groovy</strong></summary>
20+
21+
```groovy
22+
dependencies {
23+
// Core
24+
implementation 'dev.themeinerlp:plugin-debug:1.0.0'
25+
// Bukkit Extension
26+
implementation 'dev.themeinerlp.plugin-debug:bukkit-extension:1.0.0'
27+
}
28+
```
29+
</details>
30+
<details>
31+
<summary><strong>Gradle</strong></summary>
32+
33+
```kt
34+
dependencies {
35+
// Core
36+
implementation("dev.themeinerlp:plugin-debug:1.0.0")
37+
// Bukkit Extension
38+
implementation("dev.themeinerlp.plugin-debug:bukkit-extension:1.0.0")
39+
}
40+
```
41+
</details>
42+
43+
Example code(Kotlin):
44+
```kt
45+
// Example json object
46+
val obj = JsonObject()
47+
obj.addProperty("Test", "Test")
48+
49+
val result =
50+
DebugBuilder.builder(BYTEBIN_BASE_URL)
51+
// For this is the bukkit extension required
52+
.enableLatestLogSpigot() // Adds the paper last log
53+
.defaultPaperDebugInformation() // Adds as a parseable yaml format some system relevant information from bukkit
54+
// Adds a file from path wrapped in a placeholder object
55+
.addFile(DebugFile(attollo.dataFolder.toPath().resolve("config.yml"),FileType.YAML,"Config as file object"))
56+
// Adds a file from path
57+
.addFile(attollo.dataFolder.toPath().resolve("config.yml"),FileType.YAML,"Config as file")
58+
// Add yaml formatted string to the debug
59+
.addYAML(attollo.config.saveToString(), "Config")
60+
// Add a simple text to the debug
61+
.addText("Text test", "Text test")
62+
// Add json formatted string to the debug
63+
.addJson(Gson().toJson(obj), "Json test")
64+
// Upload to a bytebin server
65+
.upload()
66+
// Encodes the URL as string
67+
val encodedUrl = URLEncoder.encode(
68+
result.uploadServer,
69+
StandardCharsets.UTF_8
70+
)
71+
// ByteBin Code from Server
72+
val code = result.code
73+
// Prettified url
74+
val openUrl = "https://debugpaste.onelitefeather.net/#/$code/$encodedUrl/"
75+
val component = MiniMessage.miniMessage().deserialize("<#05b9ff>[Attollo] <yellow><click:OPEN_URL:'$openUrl'>Click <u>here</u> to open the debug paste</click>")
76+
```
77+
**For better formatting we used mini message also the two lines `enableLatestLogSpigot()` and `defaultPaperDebugInformation()` requires the Bukkit Extension.**
78+
79+
Example for java
80+
```java
81+
var obj = new JsonObject();
82+
obj.addProperty("Test", "Test");
83+
84+
var builder = DebugBuilder.builder(BYTEBIN_BASE_URL);
85+
builder = enableLatestLogSpigot(builder);
86+
builder = defaultPaperDebugInformation(builder);
87+
builder.addFile(new DebugFile(Path.of(""), FileType.YAML, "Config as file object"))
88+
.addFile(Path.of(""), FileType.YAML, "Config as file");
89+
var result = builder.upload();
90+
```

0 commit comments

Comments
 (0)