Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabsky committed Nov 7, 2024
2 parents bd5d8bc + 4f8e513 commit 16001c3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
19 changes: 11 additions & 8 deletions PAPER_MODULE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# configuration-paper
<span>
<a href=""><img alt="Latest Published Version" src="https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.grabsky.cloud%2Freleases%2Fcloud%2Fgrabsky%2Fconfiguration-paper%2Fmaven-metadata.xml&style=for-the-badge&logo=gradle&label=%20"></a>
<a href=""><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/Grabsky/configuration/gradle.yml?style=for-the-badge&logo=github&logoColor=white&label=%20"></a>
<a href=""><img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/Grabsky/configuration/main?style=for-the-badge&logo=codefactor&logoColor=white&label=%20"></a>
</span>
Expand All @@ -16,23 +15,23 @@ Requires **Java 17** (or higher) and **Paper 1.20.1** (or higher).
<br />

## Getting Started

To use this project in your plugin, add following repository:

Library is published to the **[GitHub Packages Registry](https://github.com/Grabsky/configuration/packages/)** and may require additional configuration. You can find more details **[here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package)**.
```groovy
repositories {
maven { url = 'https://repo.grabsky.cloud/releases/' }
maven { url = "https://maven.pkg.github.com/grabsky/configuration"
credentials {
username = findProperty("gpr.actor") ?: System.getenv("GITHUB_ACTOR")
password = findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}
```

Then specify dependency:

```groovy
dependencies {
implementation 'cloud.grabsky:configuration-paper:[_VERSION_]'
}
```
You can also use [GitHub Packages](https://github.com/Grabsky/configuration/packages/) - read more about that [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package).

<br />

Expand Down Expand Up @@ -174,6 +173,9 @@ This is an example of what serializers are capable of:
{ "key": "configuration:h", "type": "double", "value": 7.5000005 },
{ "key": "configuration:i", "type": "string", "value": "Hello, World!" }
],
// accepts NBT on <= 1.20.4 or item data components on >= 1.20.5
"components": "[food={nutrition:3,saturation:1}]"
// exclusive to 'damageable' items like tools and armor
"durability": 1,
Expand Down Expand Up @@ -201,6 +203,7 @@ This is an example of what serializers are capable of:
// exclusive to spawners
"spawner_spawn_count": 2
}
}
```
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
# configuration
<span>
<a href=""><img alt="Latest Published Version" src="https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.grabsky.cloud%2Freleases%2Fcloud%2Fgrabsky%2Fconfiguration-core%2Fmaven-metadata.xml&style=for-the-badge&logo=gradle&label=%20"></a>
<a href=""><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/Grabsky/configuration/gradle.yml?style=for-the-badge&logo=github&logoColor=white&label=%20"></a>
<a href=""><img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/Grabsky/configuration/main?style=for-the-badge&logo=codefactor&logoColor=white&label=%20"></a>
</span>
<p></p>

Experimental library based on [square/moshi](https://github.com/square/moshi) that lets you map JSON configuration files to static fields.
Small configuration library based on **[square/moshi](https://github.com/square/moshi)** which aims to provide an easy way to map JSON files to static fields.

<br />

## Requirements
Requires **Java 17** (or higher).
### [Core](#usage)
Requires **Java 17** (or higher).

<br />

## Paper
If you're planning to use this library for your [PaperMC/Paper](https://github.com/PaperMC/Paper) plugins, you may find [paper module](https://github.com/Grabsky/configuration/blob/main/PAPER_MODULE.md) useful.
### [Paper Module](https://github.com/Grabsky/configuration/blob/main/PAPER_MODULE.md)
Requires **Java 17** (or higher) and **Paper 1.20.1** (or higher).

<br />

## Getting Started
To use this project in your plugin, add following repository:
Library is published to the **[GitHub Packages Registry](https://github.com/Grabsky/configuration/packages/)** and may require additional configuration. You can find more details **[here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package)**.
```groovy
repositories {
maven { url = 'https://repo.grabsky.cloud/releases/' }
maven { url = "https://maven.pkg.github.com/grabsky/configuration"
credentials {
username = findProperty("gpr.actor") ?: System.getenv("GITHUB_ACTOR")
password = findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}
```
Then specify dependency:

```groovy
dependencies {
// CORE
implementation 'cloud.grabsky:configuration:[_VERSION_]'
// OPTIONAL PAPER MODULE
implementation 'cloud.grabsky:configuration-paper:[_VERSION_]'
}
```
You can also use [GitHub Packages](https://github.com/Grabsky/configuration/packages/) - read more about that [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package).

<br />

## Usage

This is contents of example JSON file located at `classpath/resources/settings.json`:
```json5
{
Expand Down

0 comments on commit 16001c3

Please sign in to comment.