Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2db6f362b2
|
||
|
|
a80a1241b2
|
||
|
|
d2ecb911f2 | ||
|
|
2fb9457cd2 | ||
|
|
5531d8ff71 | ||
|
|
7df7d7c628 | ||
|
|
18ff36d805 | ||
|
|
cfced6638f | ||
|
|
cc4041096e | ||
|
|
55e17cee9e | ||
|
|
d824145030 | ||
|
|
06be6bf318 | ||
|
|
71cd1791e9 | ||
|
|
2f6a861f60 | ||
|
|
66b14bf1ef | ||
|
|
f5e0f565a5 | ||
|
|
6000e1a3b5 | ||
|
|
a129d47dc0 | ||
|
|
2307a8aa15 | ||
|
|
4a26f2c333 | ||
|
|
5a6724f854 | ||
|
|
13feec89c2 | ||
|
|
0859305d28 | ||
|
|
416b22ba77 | ||
|
|
e58147aea0 | ||
|
|
1ddc5f1798 | ||
|
|
956cd3c029 | ||
|
|
efff714ca2 | ||
|
|
ed88680013 | ||
|
|
c194dbd624 | ||
|
|
5ddf63ca83 | ||
|
|
fea5597b93 | ||
|
|
8e0e09b62d | ||
|
|
dd808195f9 | ||
|
|
6220457381 | ||
|
|
7aa0007bfc | ||
|
|
548d04b69e | ||
|
|
59415b0b3e | ||
|
|
a43f3e42f5 | ||
|
|
6efce1cfe3 | ||
|
|
edb9edf3eb | ||
|
|
953ea8158d | ||
|
|
914b6fcef5 | ||
|
|
f829a152be | ||
|
|
b848d092fb | ||
|
|
0799f4f9c4 | ||
|
|
cd7271e247 | ||
|
|
12c6d3fb85 | ||
|
|
56fc696fd6 | ||
|
|
2dc3b75d5b | ||
|
|
c55ecb435e | ||
|
|
28b979f975 | ||
|
|
6e9094d9f0 | ||
|
|
672674a1a2 | ||
|
|
d2d5b5513f | ||
|
|
a5a201f289 | ||
|
|
b680efef52 | ||
|
|
f00cc3fc5b | ||
|
|
c5840658a2 | ||
|
|
c5183fa01b | ||
|
|
6eaccf2b65 | ||
|
|
e4df40df11 | ||
|
|
d2f8f17f90 | ||
|
|
1b1ee632c5 | ||
|
|
0758c0e526 | ||
|
|
6d49072d31 | ||
|
|
61d29e983c | ||
|
|
8b886739da | ||
|
|
33eb4711ca | ||
|
|
1dc0cba891 | ||
|
|
dba1f47d26 | ||
|
|
e38c5312c3 | ||
|
|
402ed6b10e | ||
|
|
f4d81a24f9 | ||
|
|
5bcda30624 | ||
|
|
4d9c9ddbc3 | ||
|
|
5426949be3 | ||
|
|
a1b4d64ea4 | ||
|
|
2abc476b85 | ||
|
|
e909ef687c | ||
|
|
bb237abc01 | ||
|
|
e865b0013e | ||
|
|
fe59f35290 | ||
|
|
0493adac46 | ||
|
|
8478013286 | ||
|
|
cf1a00d5a5 | ||
|
|
a18b81b2b5 | ||
|
|
3a10aa2f69 | ||
|
|
21b537d427 | ||
|
|
b80d48202e | ||
|
|
c63be1d382 | ||
|
|
409225b9e6 | ||
|
|
f56c4ddfbf | ||
|
|
4aa8afc794 | ||
|
|
e419b045ae | ||
|
|
9cc677b3c2 | ||
|
|
f09b8a44d3 | ||
|
|
9006321454 | ||
|
|
81468ca694 | ||
|
|
9780d0b729 |
No files matched your search
@@ -0,0 +1 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -0,0 +1,3 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
@@ -1,28 +0,0 @@
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'gradle'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@2bf6bc364674627d14824f75cb987b3dee0df05e
|
||||
with:
|
||||
arguments: build
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 4drian3d
|
||||
Copyright (c) contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -15,6 +15,8 @@ LuckPerms Expansion for MiniPlaceholders
|
||||
|
||||
`<luckperms_inherits_group:group>` (true/false)
|
||||
|
||||
`<luckperms_meta:meta-key>`
|
||||
|
||||
## Downloads
|
||||
|
||||
[](https://modrinth.com/plugin/luckperms-expansion)
|
||||
+11
-5
@@ -1,18 +1,17 @@
|
||||
plugins {
|
||||
java
|
||||
alias(libs.plugins.shadow)
|
||||
eclipse
|
||||
id("com.gradleup.shadow") version "8.3.9" // Import Shadow plugin.
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.luckpermsExpansionPaper)
|
||||
implementation(projects.luckpermsExpansionVelocity)
|
||||
implementation(projects.luckpermsExpansionSponge)
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply<JavaPlugin>()
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
|
||||
@@ -26,7 +25,14 @@ subprojects {
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
archiveFileName.set("MiniPlaceholders-LuckPerms-Expansion-${project.version}.jar")
|
||||
archiveFileName.set("MiniPlaceholders-LuckPerms-${project.version}.jar")
|
||||
archiveClassifier.set("")
|
||||
doLast {
|
||||
copy {
|
||||
from(archiveFile)
|
||||
into("${rootProject.projectDir}/build")
|
||||
}
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
build {
|
||||
|
||||
+32
-26
@@ -1,6 +1,7 @@
|
||||
package io.github.miniplaceholders.expansion.luckperms.common;
|
||||
|
||||
import io.github.miniplaceholders.api.Expansion;
|
||||
import io.github.miniplaceholders.api.utils.TagsUtils;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -9,15 +10,14 @@ import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
import net.luckperms.api.util.Tristate;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import static io.github.miniplaceholders.api.utils.Components.*;
|
||||
import static io.github.miniplaceholders.api.utils.LegacyUtils.LEGACY_HEX_SERIALIZER;
|
||||
import static net.kyori.adventure.text.minimessage.MiniMessage.miniMessage;
|
||||
import static io.github.miniplaceholders.api.utils.LegacyUtils.*;
|
||||
|
||||
public record CommonExpansion(LuckPerms luckPerms) {
|
||||
private static final Component UNDEFINED_COMPONENT = Component.text("undefined", NamedTextColor.GRAY);
|
||||
@@ -29,22 +29,38 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
return Tag.inserting(parsePossibleLegacy(user.getCachedData().getMetaData().getPrefix()));
|
||||
return Tag.inserting(parsePossibleLegacy(stripOrNull(user.getCachedData().getMetaData().getPrefix()), ctx));
|
||||
})
|
||||
.audiencePlaceholder("suffix", (aud, queue, ctx) -> {
|
||||
final User user = user(aud);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
return Tag.inserting(parsePossibleLegacy(user.getCachedData().getMetaData().getSuffix()));
|
||||
return Tag.inserting(parsePossibleLegacy(stripOrNull(user.getCachedData().getMetaData().getSuffix()), ctx));
|
||||
})
|
||||
.audiencePlaceholder("meta", (aud, queue, ctx) -> {
|
||||
final User user = user(aud);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
final String meta = queue.popOr(() -> "you need to introduce a meta key").value();
|
||||
final Optional<QueryOptions> queryOptions = this.luckPerms.getContextManager().getQueryOptions(user);
|
||||
if (queryOptions.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
final String result = user.getCachedData().getMetaData(queryOptions.get()).getMetaValue(meta);
|
||||
if (result == null) {
|
||||
return TagsUtils.EMPTY_TAG;
|
||||
}
|
||||
return Tag.preProcessParsed(result.strip());
|
||||
})
|
||||
.audiencePlaceholder("has_permission", (aud, queue, ctx) -> {
|
||||
final User user = user(aud);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
String permission = queue.popOr(() -> "you need to introduce an permission").value();
|
||||
Tristate result = user.getCachedData().getPermissionData().checkPermission(permission);
|
||||
final String permission = queue.popOr(() -> "you need to introduce an permission").value();
|
||||
final Tristate result = user.getCachedData().getPermissionData().checkPermission(permission);
|
||||
return Tag.selfClosingInserting(result.asBoolean()
|
||||
? TRUE_COMPONENT
|
||||
: FALSE_COMPONENT
|
||||
@@ -57,7 +73,6 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
}
|
||||
final String permission = queue.popOr(() -> "you need to introduce an permission").value();
|
||||
final Tristate result = user.getCachedData().getPermissionData().checkPermission(permission);
|
||||
|
||||
return Tag.selfClosingInserting(switch(result) {
|
||||
case TRUE -> TRUE_COMPONENT;
|
||||
case FALSE -> FALSE_COMPONENT;
|
||||
@@ -70,7 +85,7 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
return null;
|
||||
}
|
||||
final Component groups = user.getInheritedGroups(user.getQueryOptions()).stream()
|
||||
.map(group -> parsePossibleLegacy(group.getDisplayName()))
|
||||
.map(group -> parsePossibleLegacy(stripOrNull(group.getDisplayName()), ctx))
|
||||
.collect(Component.toComponent(Component.text(", ")));
|
||||
return Tag.selfClosingInserting(groups);
|
||||
})
|
||||
@@ -81,16 +96,16 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
}
|
||||
final String primaryGroup = user.getCachedData().getMetaData().getPrimaryGroup();
|
||||
if (primaryGroup == null) {
|
||||
return null;
|
||||
return TagsUtils.EMPTY_TAG;
|
||||
}
|
||||
return Tag.preProcessParsed(primaryGroup);
|
||||
return Tag.preProcessParsed(primaryGroup.strip());
|
||||
})
|
||||
.audiencePlaceholder("inherits_group", (aud, queue, ctx) -> {
|
||||
final User user = user(aud);
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
Group group = luckPerms.getGroupManager().getGroup(queue.popOr("you need to provide a group").value());
|
||||
final Group group = luckPerms.getGroupManager().getGroup(queue.popOr("you need to provide a group").value());
|
||||
return Tag.selfClosingInserting(group != null && user.getInheritedGroups(user.getQueryOptions()).contains(group)
|
||||
? TRUE_COMPONENT
|
||||
: FALSE_COMPONENT
|
||||
@@ -98,6 +113,10 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
});
|
||||
}
|
||||
|
||||
private static String stripOrNull(final String value) {
|
||||
return value == null ? null : value.strip();
|
||||
}
|
||||
|
||||
private User user(final Audience audience) {
|
||||
final UUID uuid = audience.get(Identity.UUID).orElse(null);
|
||||
if (uuid == null) {
|
||||
@@ -105,17 +124,4 @@ public record CommonExpansion(LuckPerms luckPerms) {
|
||||
}
|
||||
return luckPerms.getUserManager().getUser(uuid);
|
||||
}
|
||||
|
||||
public static @NotNull Component parsePossibleLegacy(final @Nullable String string) {
|
||||
if (string == null || string.isBlank()) return Component.empty();
|
||||
if (string.indexOf('&') != 0) {
|
||||
return miniMessage().deserialize(
|
||||
miniMessage().serialize(LEGACY_HEX_SERIALIZER.deserialize(string))
|
||||
.replace("\\<", "<")
|
||||
.replace("\\>", ">")
|
||||
);
|
||||
} else {
|
||||
return miniMessage().deserialize(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
group = io.github.miniplaceholders
|
||||
version = 1.2.0
|
||||
description = LuckPerms-Expansion
|
||||
version = 1.4.1
|
||||
description = LuckPerms-Expansion
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
@@ -3,16 +3,20 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
velocity = "3.2.0-SNAPSHOT"
|
||||
paper = "1.19.3-R0.1-SNAPSHOT"
|
||||
paper = "1.19.4-R0.1-SNAPSHOT"
|
||||
|
||||
blossom = "1.3.1"
|
||||
shadow = "8.1.1"
|
||||
runtask = "2.1.0"
|
||||
pluginyml = "0.5.3"
|
||||
blossom = "2.1.0"
|
||||
runtask = "2.2.0"
|
||||
pluginyml = "0.6.0"
|
||||
|
||||
miniplaceholders = "2.2.0"
|
||||
miniplaceholders = "2.2.3"
|
||||
luckperms = "5.4"
|
||||
adventure = "4.13.1"
|
||||
adventure = "4.15.0"
|
||||
|
||||
fabric-loader = "0.15.0"
|
||||
fabric-api = "0.90.1+1.20.3"
|
||||
minecraft = "1.20.1"
|
||||
adventurefabric = "5.10.1"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -25,10 +29,15 @@ adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "ad
|
||||
adventure-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
|
||||
adventure-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" }
|
||||
|
||||
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader" }
|
||||
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" }
|
||||
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
|
||||
adventure-platform-fabric = { group = "net.kyori", name = "adventure-platform-fabric", version.ref = "adventurefabric" }
|
||||
|
||||
[plugins]
|
||||
|
||||
blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
|
||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
|
||||
runvelocity = { id = "xyz.jpenilla.run-velocity", version.ref = "runtask" }
|
||||
runpaper = { id = "xyz.jpenilla.run-velocity", version.ref = "runtask" }
|
||||
pluginyml = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" }
|
||||
idea-ext = { id = "org.jetbrains.gradle.plugin.idea-ext", version = "1.1.7" }
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,7 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -111,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -130,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -141,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,16 +204,16 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+14
-12
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
name: MiniPlaceholders-LuckPerms-Expansion
|
||||
name: MiniPlaceholders-LuckPerms
|
||||
version: '${version}'
|
||||
author: 4drian3d
|
||||
main: io.github.miniplaceholders.expansion.luckperms.paper.PaperPlugin
|
||||
api-version: '1.19'
|
||||
folia-supported: true
|
||||
folia-supported: false
|
||||
dependencies:
|
||||
- name: MiniPlaceholders
|
||||
required: true
|
||||
- name: LuckPerms
|
||||
required: true
|
||||
required: true
|
||||
+22
-2
@@ -1,7 +1,27 @@
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
rootProject.name = "Luckperms-Expansion"
|
||||
rootProject.name = "MiniPlaceholders-LuckPerms"
|
||||
|
||||
arrayOf("paper", "velocity", "common").forEach {
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
}
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
maven("https://maven.quiltmc.org/repository/release/")
|
||||
}
|
||||
}
|
||||
|
||||
arrayOf("common", "paper", "velocity", "sponge").forEach {
|
||||
include("luckperms-expansion-$it")
|
||||
project(":luckperms-expansion-$it").projectDir = file(it)
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
id("org.spongepowered.gradle.plugin") version "2.2.0"
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import org.spongepowered.gradle.plugin.config.PluginLoaders
|
||||
import org.spongepowered.plugin.metadata.model.PluginDependency
|
||||
|
||||
plugins {
|
||||
id("org.spongepowered.gradle.plugin")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.miniplaceholders)
|
||||
compileOnly(libs.luckperms)
|
||||
implementation(projects.luckpermsExpansionCommon)
|
||||
}
|
||||
|
||||
sponge {
|
||||
apiVersion("8.1.0")
|
||||
license("GPL-3")
|
||||
loader {
|
||||
name(PluginLoaders.JAVA_PLAIN)
|
||||
version("1.0")
|
||||
}
|
||||
plugin("miniplaceholders-luckperms-expansion") {
|
||||
displayName("MiniPlaceholders-LuckPerms-Expansion")
|
||||
entrypoint("io.github.miniplaceholders.expansion.luckperms.sponge.SpongePlugin")
|
||||
description(project.description)
|
||||
links {
|
||||
homepage("https://github.com/MiniPlaceholders/LuckPerms-Expansion")
|
||||
source("https://github.com/MiniPlaceholders/LuckPerms-Expansion")
|
||||
issues("https://github.com/MiniPlaceholders/LuckPerms-Expansion/issues")
|
||||
}
|
||||
contributor("4drian3d") {
|
||||
description("Lead Developer")
|
||||
}
|
||||
dependency("spongeapi") {
|
||||
loadOrder(PluginDependency.LoadOrder.AFTER)
|
||||
optional(false)
|
||||
}
|
||||
dependency("miniplaceholders") {
|
||||
loadOrder(PluginDependency.LoadOrder.AFTER)
|
||||
optional(false)
|
||||
version("2.2.0")
|
||||
}
|
||||
dependency("luckperms") {
|
||||
loadOrder(PluginDependency.LoadOrder.AFTER)
|
||||
optional(false)
|
||||
version("5.4.98")
|
||||
}
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package io.github.miniplaceholders.expansion.luckperms.sponge;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import io.github.miniplaceholders.expansion.luckperms.common.CommonExpansion;
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.api.Server;
|
||||
import org.spongepowered.api.entity.living.player.server.ServerPlayer;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.lifecycle.StartingEngineEvent;
|
||||
import org.spongepowered.plugin.builtin.jvm.Plugin;
|
||||
|
||||
@Plugin("miniplaceholders-luckperms-expansion")
|
||||
public class SpongePlugin {
|
||||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@Listener
|
||||
public void onServerStart(final StartingEngineEvent<Server> event) {
|
||||
this.logger.info("Starting LuckPerms Expansion for Sponge");
|
||||
|
||||
final LuckPerms luckPerms = LuckPermsProvider.get();
|
||||
new CommonExpansion(luckPerms).commonBuilder()
|
||||
.filter(ServerPlayer.class)
|
||||
.build()
|
||||
.register();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.idea.ext)
|
||||
alias(libs.plugins.blossom)
|
||||
}
|
||||
|
||||
@@ -10,7 +11,12 @@ dependencies {
|
||||
implementation(projects.luckpermsExpansionCommon)
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceTokenIn("src/main/java/io/github/miniplaceholders/expansion/luckperms/velocity/Constants.java")
|
||||
replaceToken("{version}", project.version)
|
||||
sourceSets {
|
||||
main {
|
||||
blossom {
|
||||
javaSources {
|
||||
property("version", project.version.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package io.github.miniplaceholders.expansion.luckperms.velocity;
|
||||
|
||||
public class Constants {
|
||||
static final String VERSION = "{version}";
|
||||
private Constants() {}
|
||||
static final String VERSION = "{{ version }}";
|
||||
}
|
||||
Reference in new issue
Block a user