Compare commits
No commits in common. "38228ea585889d1f4b7e758b01c8244e329f55fa" and "e74361a7b7c17389f0e53c97bee2b7807be22c3c" have entirely different histories.
38228ea585
...
e74361a7b7
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
|
|
@ -3,13 +3,7 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Gradle') {
|
stage('Gradle') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: 'my-credentials-id', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
|
sh './gradlew build'
|
||||||
sh """
|
|
||||||
./gradlew build \
|
|
||||||
-PalttdSnapshotUsername=$NEXUS_USERNAME \
|
|
||||||
-PalttdSnapshotPassword=$NEXUS_PASSWORD
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Archive') {
|
stage('Archive') {
|
||||||
|
|
@ -19,13 +13,8 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('discord') {
|
stage('discord') {
|
||||||
steps {
|
steps {
|
||||||
discordSend
|
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||||
description: "Build: ${BUILD_NUMBER}",
|
|
||||||
showChangeset: true,
|
|
||||||
result: currentBuild.currentResult,
|
|
||||||
title: currentBuild.fullProjectName,
|
|
||||||
webhookURL: env.discordwebhook
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ 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;
|
||||||
|
|
@ -21,7 +22,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?://)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)");
|
static final Pattern DEFAULT_URL_PATTERN = Pattern.compile("(?:(https?)://)?([-\\w_.]+\\.\\w{2,})(/\\S*)?");
|
||||||
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;
|
||||||
|
|
@ -291,25 +292,30 @@ 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 displayUrl = url;
|
String clickUrl = url;
|
||||||
String urlFormat = Config.URLFORMAT;
|
String urlFormat = Config.URLFORMAT;
|
||||||
message = message.replace(url, urlFormat
|
// if (!URL_SCHEME_PATTERN.matcher(clickUrl).find()) {
|
||||||
.replaceAll("<url>", "<u>" + displayUrl + "</u>")
|
// clickUrl = "http://" + clickUrl;
|
||||||
.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