Compare commits
2 Commits
e74361a7b7
...
38228ea585
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38228ea585 | ||
|
|
b65fcdb1c7 |
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
|
|
@ -3,7 +3,13 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Gradle') {
|
stage('Gradle') {
|
||||||
steps {
|
steps {
|
||||||
sh './gradlew build'
|
withCredentials([usernamePassword(credentialsId: 'my-credentials-id', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
|
||||||
|
sh """
|
||||||
|
./gradlew build \
|
||||||
|
-PalttdSnapshotUsername=$NEXUS_USERNAME \
|
||||||
|
-PalttdSnapshotPassword=$NEXUS_PASSWORD
|
||||||
|
"""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Archive') {
|
stage('Archive') {
|
||||||
|
|
@ -13,7 +19,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('discord') {
|
stage('discord') {
|
||||||
steps {
|
steps {
|
||||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
discordSend
|
||||||
|
description: "Build: ${BUILD_NUMBER}",
|
||||||
|
showChangeset: true,
|
||||||
|
result: currentBuild.currentResult,
|
||||||
|
title: currentBuild.fullProjectName,
|
||||||
|
webhookURL: env.discordwebhook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import net.luckperms.api.LuckPerms;
|
||||||
import net.luckperms.api.model.group.Group;
|
import net.luckperms.api.model.group.Group;
|
||||||
import net.luckperms.api.model.user.User;
|
import net.luckperms.api.model.user.User;
|
||||||
import net.luckperms.api.node.Node;
|
import net.luckperms.api.node.Node;
|
||||||
import org.bukkit.permissions.Permission;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|
@ -22,7 +21,7 @@ import java.util.stream.Collectors;
|
||||||
public class Utility {
|
public class Utility {
|
||||||
|
|
||||||
private static final List<String> EMPTY_LIST = new ArrayList<>();
|
private static final List<String> EMPTY_LIST = new ArrayList<>();
|
||||||
static final Pattern DEFAULT_URL_PATTERN = Pattern.compile("(?:(https?)://)?([-\\w_.]+\\.\\w{2,})(/\\S*)?");
|
static final Pattern DEFAULT_URL_PATTERN = Pattern.compile("(https?://)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)");
|
||||||
static final Pattern URL_SCHEME_PATTERN = Pattern.compile("^[a-z][a-z0-9+\\-.]*:");
|
static final Pattern URL_SCHEME_PATTERN = Pattern.compile("^[a-z][a-z0-9+\\-.]*:");
|
||||||
|
|
||||||
private static MiniMessage miniMessage = null;
|
private static MiniMessage miniMessage = null;
|
||||||
|
|
@ -292,30 +291,25 @@ public class Utility {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatText(String message) {
|
public static String formatText(String message) {
|
||||||
/*
|
|
||||||
.match(pattern)
|
|
||||||
.replacement(url -> {
|
|
||||||
String clickUrl = url.content();
|
|
||||||
if (!URL_SCHEME_PATTERN.matcher(clickUrl).find()) {
|
|
||||||
clickUrl = "http://" + clickUrl;
|
|
||||||
}
|
|
||||||
return (style == null ? url : url.style(style)).clickEvent(ClickEvent.openUrl(clickUrl));
|
|
||||||
})
|
|
||||||
.build();
|
|
||||||
*/
|
|
||||||
Matcher matcher = DEFAULT_URL_PATTERN.matcher(message);
|
Matcher matcher = DEFAULT_URL_PATTERN.matcher(message);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String url = matcher.group();
|
String url = matcher.group();
|
||||||
String clickUrl = url;
|
String displayUrl = url;
|
||||||
String urlFormat = Config.URLFORMAT;
|
String urlFormat = Config.URLFORMAT;
|
||||||
// if (!URL_SCHEME_PATTERN.matcher(clickUrl).find()) {
|
message = message.replace(url, urlFormat
|
||||||
// clickUrl = "http://" + clickUrl;
|
.replaceAll("<url>", "<u>" + displayUrl + "</u>")
|
||||||
// }
|
.replaceAll("<clickurl>", formatUrl(url)));
|
||||||
message = message.replace(url, urlFormat.replaceAll("<url>", url).replaceAll("<clickurl>", clickUrl));
|
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String formatUrl(String url) {
|
||||||
|
if (url.startsWith("http://") || url.startsWith("https://")) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
return "https://" + url;
|
||||||
|
}
|
||||||
|
|
||||||
public static Component parseMiniMessage(String message) {
|
public static Component parseMiniMessage(String message) {
|
||||||
return getMiniMessage().deserialize(message);
|
return getMiniMessage().deserialize(message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user