diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..54966ac --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,20 @@ +pipeline { + agent any + stages { + stage('Gradle') { + steps { + sh './gradlew build' + } + } + stage('Archive') { + steps { + archiveArtifacts artifacts: 'build/libs/', followSymlinks: false + } + } + stage('discord') { + steps { + discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook + } + } + } +} \ No newline at end of file diff --git a/api/build.gradle.kts b/api/build.gradle.kts index d4e432d..0205c1b 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } dependencies { - compileOnly("com.alttd:Galaxy-API:1.19.2-R0.1-SNAPSHOT") { + compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") { // exclude("net.kyori") } compileOnly("org.spongepowered:configurate-yaml:4.1.2") // Configurate diff --git a/api/src/main/java/com/alttd/chat/config/Config.java b/api/src/main/java/com/alttd/chat/config/Config.java index f1e4c59..0e7e8cb 100755 --- a/api/src/main/java/com/alttd/chat/config/Config.java +++ b/api/src/main/java/com/alttd/chat/config/Config.java @@ -32,7 +32,7 @@ public final class Config { public static File CONFIGPATH; public static void init() { - CONFIGPATH = new File(System.getProperty("user.home") + File.separator + "share" + File.separator + "configs" + File.separator + "ChatPlugin"); + CONFIGPATH = new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "ChatPlugin"); CONFIG_FILE = new File(CONFIGPATH, "config.yml"); configLoader = YamlConfigurationLoader.builder() .file(CONFIG_FILE) diff --git a/build.gradle.kts b/build.gradle.kts index 75b8e7d..4860c07 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,25 +1,12 @@ plugins { `java-library` - id("com.github.johnrengelman.shadow") version "7.1.0" + id("io.github.goooler.shadow") version "8.1.8" } allprojects { group = "com.alttd.chat" version = "2.0.0-SNAPSHOT" description = "All in one minecraft chat plugin" - -// repositories { -// mavenCentral() -// maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy -// maven("https://oss.sonatype.org/content/groups/public/") // Adventure -// maven("https://oss.sonatype.org/content/repositories/snapshots/") // Minimessage -// maven("https://oss.sonatype.org/content/repositories/") // Minimessage -// maven("https://nexus.velocitypowered.com/repository/") // Velocity -// maven("https://nexus.velocitypowered.com/repository/maven-public/") // Velocity -// maven("https://repo.spongepowered.org/maven") // Configurate -// maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // Papi -// maven("https://jitpack.io") -// } } subprojects { @@ -27,7 +14,7 @@ subprojects { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(21)) } } diff --git a/galaxy/build.gradle.kts b/galaxy/build.gradle.kts index a3b7501..7874f92 100644 --- a/galaxy/build.gradle.kts +++ b/galaxy/build.gradle.kts @@ -1,58 +1,24 @@ -import java.io.FileOutputStream -import java.net.URL - plugins { `maven-publish` - id("com.github.johnrengelman.shadow") - id("xyz.jpenilla.run-paper") version "1.0.6" + id("io.github.goooler.shadow") } dependencies { implementation(project(":api")) // API - compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT") // Galaxy + compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") // Galaxy compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") // move to proxy compileOnly("org.apache.commons:commons-lang3:3.12.0") // needs an alternative, already removed from upstream api and will be removed in server compileOnly("net.luckperms:api:5.3") // Luckperms - compileOnly(files("../libs/CMI.jar")) } tasks { shadowJar { archiveFileName.set("${rootProject.name}-${project.name}-${project.version}.jar") -// minimize() } build { -// setBuildDir("${rootProject.buildDir}") dependsOn(shadowJar) } - runServer { - val dir = File(System.getProperty("user.home") + "/share/devserver/"); - if (!dir.parentFile.exists()) { - dir.parentFile.mkdirs() - } - runDirectory.set(dir) - - val fileName = "/galaxy.jar" - var file = File(dir.path + fileName) - - if (!file.parentFile.exists()) { - file.parentFile.mkdirs() - } - if (!file.exists()) { - download("https://repo.destro.xyz/snapshots/com/alttd/Galaxy-Server/Galaxy-paperclip-1.19.2-R0.1-SNAPSHOT-reobf.jar", file) - } - serverJar(file) - minecraftVersion("1.19.2") - } -} - -fun download(link: String, path: File) { - URL(link).openStream().use { input -> - FileOutputStream(path).use { output -> - input.copyTo(output) - } - } } \ No newline at end of file diff --git a/galaxy/src/main/java/com/alttd/chat/listeners/ChatListener.java b/galaxy/src/main/java/com/alttd/chat/listeners/ChatListener.java index 0db2434..0d85bf3 100755 --- a/galaxy/src/main/java/com/alttd/chat/listeners/ChatListener.java +++ b/galaxy/src/main/java/com/alttd/chat/listeners/ChatListener.java @@ -82,11 +82,6 @@ public class ChatListener implements Listener { Player player = event.getPlayer(); - Set receivers = event.viewers().stream().filter(audience -> audience instanceof Player) - .map(audience -> (Player) audience) - .filter(receiver -> !ChatUserManager.getChatUser(receiver.getUniqueId()).getIgnoredPlayers().contains(player.getUniqueId())) - .collect(Collectors.toSet()); - Component input = event.message().colorIfAbsent(NamedTextColor.WHITE); ModifiableString modifiableString = new ModifiableString(input); @@ -112,6 +107,11 @@ public class ChatListener implements Listener { return; // the message was blocked } + Set receivers = event.viewers().stream().filter(audience -> audience instanceof Player) + .map(audience -> (Player) audience) + .filter(receiver -> !ChatUserManager.getChatUser(receiver.getUniqueId()).getIgnoredPlayers().contains(player.getUniqueId())) + .collect(Collectors.toSet()); + Set playersToPing = new HashSet<>(); pingPlayers(playersToPing, modifiableString, player); @@ -136,11 +136,12 @@ public class ChatListener implements Listener { Pattern nickPattern = Pattern.compile("\\b(?