Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vankka/mcdiscordreserializer
A library for transcoding between Minecraft and Discord.
https://github.com/vankka/mcdiscordreserializer
java minecraft
Last synced: about 2 months ago
JSON representation
A library for transcoding between Minecraft and Discord.
- Host: GitHub
- URL: https://github.com/vankka/mcdiscordreserializer
- Owner: Vankka
- License: gpl-3.0
- Created: 2018-12-22T16:08:36.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-20T14:16:40.000Z (5 months ago)
- Last Synced: 2024-10-11T03:22:10.773Z (2 months ago)
- Topics: java, minecraft
- Language: Java
- Homepage:
- Size: 367 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# MCDiscordReserializer
[![Maven Central](https://img.shields.io/maven-central/v/dev.vankka/mcdiscordreserializer?label=release)](https://central.sonatype.com/search?q=g%3Adev.vankka+a%3Amcdiscordreserializer)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/dev.vankka/mcdiscordreserializer?label=dev&server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/#view-repositories;snapshots~browsestorage~dev/vankka)A library for transcoding between Minecraft and Discord.
Minecraft text is represented using [Kyori's Adventure](https://github.com/KyoriPowered/adventure) (compatible with 4.x.x).
Discord text is represented using Java Strings (not relying on any specific Discord library)
and is translated using a fork of [Discord's SimpleAST](https://github.com/discordapp/SimpleAST),
[here](https://github.com/Vankka/SimpleAST).## Dependency information
### Version
| Text/Adventure Version | MCDiscordReserializer version | Maintained |
|----|----|----|
| 4.x.x | 4.x.x | ✔ |
| 3.x.x | 3.x.x | ️ |### Versions 4.2.0 and up
#### Maven
```xml
dev.vankka
mcdiscordreserializer
4.3.0
```
### Gradle
```groovy
repositories {
mavenCentral()
}dependencies {
implementation 'dev.vankka:mcdiscordreserializer:4.3.0'
}
```Versions Before 4.2.0
#### Maven
```xml
Vankka-Nexus
https://nexus.vankka.dev/repository/maven-public/
dev.vankka
MCDiscordReserializer
3.0.1
```
#### Gradle
```groovy
repositories {
maven {
id 'Vankka-Nexus'
url 'https://nexus.vankka.dev/repository/maven-public/'
}
}
dependencies {
implementation 'dev.vankka:MCDiscordReserializer:3.0.1'
}
```## Basic usage
```java
// For Minecraft -> Discord translating
String output = DiscordSerializer.INSTANCE.serialize(TextComponent.of("Bold").decoration(TextDecoration.BOLD, true));// For Discord -> Minecraft translating
TextComponent output = MinecraftSerializer.INSTANCE.serialize("**Bold**");
```