Skip to content

Commit 463cfee

Browse files
committed
Refactor classes
1 parent c0a7f0f commit 463cfee

File tree

4 files changed

+54
-6
lines changed

4 files changed

+54
-6
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,52 @@ public class MyPlugin extends JavaPlugin {
124124

125125
---
126126

127+
## Maven / Gradle Installation
128+
129+
To include YAML API to the project, add the following repository and dependency to your build configuration. Replace `${version}` with the desired version tag.
130+
131+
### Maven
132+
133+
Add the repository and dependency to your `pom.xml`:
134+
135+
```xml
136+
<repositories>
137+
<repository>
138+
<id>croabeast-repo</id>
139+
<url>https://croabeast.github.io/repo/</url>
140+
</repository>
141+
</repositories>
142+
143+
<dependencies>
144+
<dependency>
145+
<groupId>me.croabeast</groupId>
146+
<artifactId>YAML-API</artifactId>
147+
<version>${version}</version>
148+
<scope>compile</scope>
149+
</dependency>
150+
</dependencies>
151+
```
152+
153+
### Gradle
154+
155+
Add the repository and dependency to your `build.gradle`:
156+
157+
```groovy
158+
repositories {
159+
maven {
160+
url "https://croabeast.github.io/repo/"
161+
}
162+
}
163+
164+
dependencies {
165+
implementation "me.croabeast:YAML-API:${version}"
166+
}
167+
```
168+
169+
Replace `${version}` with the appropriate module version.
170+
171+
---
172+
127173
## Conclusion
128174

129175
**YAML API** is a powerful library for managing YAML configurations in your Bukkit/Spigot/Paper plugins. It streamlines file operations, mapping, and updates while preserving comments and ensuring compatibility across server versions. Whether you are building simple configuration systems or working with complex, nested settings, YAML API provides the tools you need to efficiently manage your plugin’s configuration.

src/main/java/me/croabeast/file/Copyable.java renamed to src/main/java/me/croabeast/common/Copyable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package me.croabeast.file;
1+
package me.croabeast.common;
22

33
import org.jetbrains.annotations.NotNull;
44

src/main/java/me/croabeast/file/Builder.java renamed to src/main/java/me/croabeast/common/builder/BaseBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package me.croabeast.file;
1+
package me.croabeast.common.builder;
22

33
import org.jetbrains.annotations.NotNull;
44

@@ -7,7 +7,7 @@
77
*
88
* @param <B> the specific builder type extending this interface
99
*/
10-
public interface Builder<B extends Builder<B>> {
10+
public interface BaseBuilder<B extends BaseBuilder<B>> {
1111

1212
/**
1313
* Provides an instance of the builder, ensuring fluent-style method chaining.

src/main/java/me/croabeast/file/Mappable.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package me.croabeast.file;
22

3+
import me.croabeast.common.Copyable;
4+
import me.croabeast.common.builder.BaseBuilder;
35
import org.jetbrains.annotations.NotNull;
46

57
import java.util.*;
@@ -9,7 +11,7 @@
911
/**
1012
* Represents a specialized mapping structure that associates integer keys with collections of elements.
1113
* <p>
12-
* {@code Mappable} extends {@link Map} and {@link Builder} to provide a fluent interface for performing operations
14+
* {@code Mappable} extends {@link Map} and {@link BaseBuilder} to provide a fluent interface for performing operations
1315
* such as filtering, ordering, and merging values across grouped collections.
1416
* </p>
1517
* <p>
@@ -40,10 +42,10 @@
4042
* @param <T> The type of elements stored in the collections.
4143
* @param <C> The type of collection that holds the elements.
4244
* @param <B> The type of the implementing {@code Mappable} instance.
43-
* @see Builder
45+
* @see BaseBuilder
4446
*/
4547
public interface Mappable<T, C extends Collection<T>, B extends Mappable<T, C, B>>
46-
extends Map<Integer, C>, Iterable<Map.Entry<Integer, C>>, Builder<B>, Copyable<B> {
48+
extends Map<Integer, C>, Iterable<Map.Entry<Integer, C>>, BaseBuilder<B>, Copyable<B> {
4749

4850
/**
4951
* Filters the stored elements based on the given predicate, modifying the current instance.

0 commit comments

Comments
 (0)