Files
chomens-bot-java/build.gradle
ChomeNS b4f0958202 feat: finally use adventure component serializers for component parsing (ComponentUtilities)
there is an issue with the legacy code parsing where it doesn't reset the styles when there's a color code, but that is since the old parser, it's not that important but just something to note
similar thing goes to discord message deserialization, the style goes first then the color, but for the style to be displayed in minecraft, the color has to go first then the style. an example will be like: `§l§c[§cOP§c] §r§c§r§cchayapak§r: abc`, the `l` and `c` should be swapped
hex colors also didn't get rounded correctly for some reason. my custom chat format is completely white in discord, although minimessage rainbow and gradients works perfectly fine, which is very weird, maybe it thinks my custom chat format looks white
2025-05-18 19:52:43 +07:00

128 lines
3.3 KiB
Groovy

import java.text.SimpleDateFormat
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'me.chayapak1'
version = 'rolling'
description = 'ChomeNS Bot'
java.sourceCompatibility = JavaVersion.VERSION_21
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri('https://jitpack.io')
}
maven {
url = uri('https://repo.opencollab.dev/main/')
}
maven {
url = uri('https://repo.opencollab.dev/maven-snapshots/')
}
maven {
url = uri('https://repo.opencollab.dev/maven-releases/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
maven {
url = uri('https://maven.maxhenkel.de/repository/public')
}
}
dependencies {
implementation 'org.geysermc.mcprotocollib:protocol:1.21.5-SNAPSHOT'
implementation 'net.kyori:adventure-text-serializer-plain:4.21.0'
implementation 'net.kyori:adventure-text-serializer-legacy:4.21.0'
implementation 'net.kyori:adventure-text-serializer-ansi:4.21.0'
implementation 'com.google.code.gson:gson:2.12.1'
implementation 'com.google.guava:guava:33.4.0-jre'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.3'
implementation 'org.mariadb.jdbc:mariadb-java-client:3.5.2'
implementation 'org.jline:jline:3.29.0'
implementation 'it.unimi.dsi:fastutil:8.5.15'
implementation 'ch.qos.logback:logback-classic:1.5.17'
implementation 'com.github.pircbotx:pircbotx:2.3.1'
implementation 'com.github.ricksbrown:cowsay:1.1.0'
implementation 'org.yaml:snakeyaml:2.4'
implementation 'party.iroiro.luajava:luajava:4.0.2'
implementation 'party.iroiro.luajava:lua54:4.0.2'
runtimeOnly 'party.iroiro.luajava:lua54-platform:4.0.2:natives-desktop' // what is this? is this necessary?
implementation 'net.dv8tion:JDA:5.3.0'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.24.3'
implementation 'io.socket:socket.io-client:2.1.2'
implementation 'de.maxhenkel.opus4j:opus4j:2.0.2'
implementation 'org.concentus:Concentus:1.0-SNAPSHOT'
}
static def getGitCommitHash() {
try {
return 'git rev-parse --short HEAD'.execute().text.trim()
} catch (Exception e) {
e.printStackTrace()
return "unknown"
}
}
static def getGitCommitCount() {
try {
return 'git rev-list --count HEAD'.execute().text.trim()
} catch (Exception e) {
e.printStackTrace()
return "unknown"
}
}
def buildNumberFile = file("build-number.txt")
def buildNumber = 0
if (buildNumberFile.exists()) {
buildNumber = buildNumberFile.text.trim().toInteger() + 1
} else {
buildNumber = 1
}
buildNumberFile.text = buildNumber
ext.buildInfo = [
gitCommitCount: getGitCommitCount(),
compileDate: new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z").format(new Date()),
gitCommitHash: getGitCommitHash(),
buildNumber: buildNumber,
]
processResources {
inputs.property("buildInfo", buildInfo)
filesMatching("application.properties") {
expand(buildInfo)
}
}
application {
mainClass = 'me.chayapak1.chomens_bot.Main'
}
run {
standardInput = System.in
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
}