Skip to content

Commit bd9939f

Browse files
authored
Merge pull request #1 from MachineMC/1.2
1.2
2 parents 505c245 + f669b60 commit bd9939f

File tree

80 files changed

+3147
-1095
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3147
-1095
lines changed

.github/assets/scriptive.png

53.4 KB
Loading

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 MachineMC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1-
# Scriptive
1+
![banner](.github/assets/scriptive.png)
2+
3+
<p align="center">Java Implementation for Minecraft Java Edition Chat Component Format.</p>
4+
5+
<p align="center">
6+
<img src="https://img.shields.io/github/license/machinemc/scriptive?style=for-the-badge&color=107185" alt="LICENSE">
7+
<img src="https://img.shields.io/github/v/release/machinemc/scriptive?style=for-the-badge&color=edb228" alt="RELEASE">
8+
</p>
9+
10+
---
11+
12+
Since version 1.7.2, Minecraft has two separate text formatting systems.
13+
The newer text component system is used in many specific
14+
contexts expecting formatted text, including chat messages,
15+
written books, death messages, window titles, and the like.
16+
17+
Scriptive is a library for easy creation and serialization
18+
of such text components with support for the latest Minecraft
19+
versions.
20+
21+
### Features
22+
23+
- *Comprehensive support for all formating options*
24+
- Lightweight and intuitive
25+
- Supports new NBT serialization introduced in *1.20.3* version of Minecraft
26+
- Supports JSON serialization
27+
- Provides [custom format](scriptive-formatify) of components suitable for *user-input*
28+
- Supports terminal format
29+
30+
### Modules
31+
32+
- [`scriptive-core`](scriptive-core) - Core of the Scriptive library
33+
- [`scriptive-gson`](scriptive-gson) - JSON serialization of text components using GSON library
34+
- [`scriptive-nbt`](scriptive-nbt) - NBT serialization of text components using Machine's [NBT](https://github.com/MachineMC/NBT) library
35+
- [`scriptive-formatify`](scriptive-formatify) - Custom human-readable format for components
36+
37+
### Importing
38+
39+
#### Gradle
40+
41+
```kotlin
42+
repositories {
43+
maven {
44+
name = "machinemcRepositoryReleases"
45+
url = uri("https://repo.machinemc.org/releases")
46+
}
47+
}
48+
49+
dependencies {
50+
implementation("org.machinemc:scriptive-core:VERSION")
51+
}
52+
```
53+
54+
#### Maven
55+
56+
```xml
57+
<repositories>
58+
<repository>
59+
<id>machinemc-repository-releases</id>
60+
<name>MachineMC Repository</name>
61+
<url>https://repo.machinemc.org/releases</url>
62+
</repository>
63+
</repositories>
64+
65+
<dependencies>
66+
<dependency>
67+
<groupId>org.machinemc</groupId>
68+
<artifactId>scriptive-core</artifactId>
69+
<version>VERSION</version>
70+
</dependency>
71+
</dependencies>
72+
```
73+
74+
Other modules can be added as another dependency.
75+
76+
### License
77+
Scriptive is free software licensed under the [MIT license](LICENCE).

build-logic/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
tasks {
10+
compileKotlin {
11+
kotlinOptions {
12+
jvmTarget = "21"
13+
}
14+
}
15+
}

build-logic/settings.gradle.kts

Whitespace-only changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
plugins {
2+
java
3+
`java-library`
4+
}
5+
6+
val group: String by project
7+
setGroup(group)
8+
9+
val version: String by project
10+
setVersion(version)
11+
12+
val libs = project.rootProject
13+
.extensions
14+
.getByType(VersionCatalogsExtension::class)
15+
.named("libs")
16+
17+
//
18+
// Repositories and Dependencies
19+
//
20+
21+
repositories {
22+
mavenCentral()
23+
}
24+
25+
dependencies {
26+
compileOnly(libs.findLibrary("jetbrains-annotations").get())
27+
28+
testImplementation(libs.findLibrary("junit-api").get())
29+
testRuntimeOnly(libs.findLibrary("junit-engine").get())
30+
testImplementation(libs.findLibrary("junit-params").get())
31+
}
32+
33+
//
34+
// Java configuration
35+
//
36+
37+
java {
38+
sourceCompatibility = JavaVersion.VERSION_21
39+
targetCompatibility = JavaVersion.VERSION_21
40+
withSourcesJar()
41+
}
42+
43+
//
44+
// Task configurations
45+
//
46+
47+
tasks {
48+
withType<JavaCompile> {
49+
options.release.set(21)
50+
options.encoding = Charsets.UTF_8.name()
51+
}
52+
test {
53+
useJUnitPlatform()
54+
}
55+
}

build.gradle.kts

Lines changed: 0 additions & 50 deletions
This file was deleted.

gradle.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Group and version
2+
group = org.machinemc.scriptive
3+
version = 1.2
4+
5+
# Dependency versions
6+
jetbrainsAnnotations = 24.1.0
7+
junit = 5.10.1
8+
googleGson = 2.10.1
9+
machineNbt = 2.0.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

scriptive-core/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id("java-library-convention")
3+
`maven-publish`
4+
}
5+
6+
publishing {
7+
repositories {
8+
maven {
9+
name = "machine"
10+
url = uri("https://repo.machinemc.org/releases")
11+
credentials(PasswordCredentials::class)
12+
authentication {
13+
create<BasicAuthentication>("basic")
14+
}
15+
}
16+
}
17+
publications {
18+
create<MavenPublication>("maven") {
19+
groupId = "org.machinemc"
20+
artifactId = "scriptive-core"
21+
version = project.version.toString()
22+
from(components["java"])
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)