Compare commits

...
9 Commits
16 changed files with 67 additions and 166 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -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
-28
View File
@@ -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@v4
- 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@32bab5b15a50e1b08ae1565fc18471b42da9665b
with:
arguments: build
+22
View File
@@ -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.
+3 -2
View File
@@ -1,6 +1,7 @@
plugins {
java
alias(libs.plugins.shadow)
eclipse
id("com.gradleup.shadow") version "8.3.9" // Import Shadow plugin.
}
dependencies {
@@ -24,7 +25,7 @@ subprojects {
tasks {
shadowJar {
archiveFileName.set("MiniPlaceholders-LuckPerms-Expansion-${project.version}.jar")
archiveFileName.set("MiniPlaceholders-LuckPerms-${project.version}.jar")
archiveClassifier.set("")
doLast {
copy {
@@ -29,14 +29,14 @@ public record CommonExpansion(LuckPerms luckPerms) {
if (user == null) {
return null;
}
return Tag.inserting(parsePossibleLegacy(user.getCachedData().getMetaData().getPrefix(), ctx));
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(), ctx));
return Tag.inserting(parsePossibleLegacy(stripOrNull(user.getCachedData().getMetaData().getSuffix()), ctx));
})
.audiencePlaceholder("meta", (aud, queue, ctx) -> {
final User user = user(aud);
@@ -52,7 +52,7 @@ public record CommonExpansion(LuckPerms luckPerms) {
if (result == null) {
return TagsUtils.EMPTY_TAG;
}
return Tag.preProcessParsed(result);
return Tag.preProcessParsed(result.strip());
})
.audiencePlaceholder("has_permission", (aud, queue, ctx) -> {
final User user = user(aud);
@@ -85,7 +85,7 @@ public record CommonExpansion(LuckPerms luckPerms) {
return null;
}
final Component groups = user.getInheritedGroups(user.getQueryOptions()).stream()
.map(group -> parsePossibleLegacy(group.getDisplayName(), ctx))
.map(group -> parsePossibleLegacy(stripOrNull(group.getDisplayName()), ctx))
.collect(Component.toComponent(Component.text(", ")));
return Tag.selfClosingInserting(groups);
})
@@ -98,7 +98,7 @@ public record CommonExpansion(LuckPerms luckPerms) {
if (primaryGroup == 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);
@@ -113,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) {
-44
View File
@@ -1,44 +0,0 @@
plugins {
id("fabric-loom")
alias(libs.plugins.shadow)
}
val shade: Configuration by configurations.creating
dependencies {
compileOnly(libs.luckperms)
compileOnly(libs.miniplaceholders)
implementation(projects.luckpermsExpansionCommon)
shade(projects.luckpermsExpansionCommon)
minecraft(libs.minecraft)
mappings(loom.officialMojangMappings())
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.api)
modImplementation(libs.adventure.platform.fabric)
}
tasks {
processResources {
filteringCharset = Charsets.UTF_8.name()
filesMatching("fabric.mod.json") {
expand("version" to project.version)
}
}
remapJar {
inputFile.set(shadowJar.get().archiveFile)
archiveFileName.set("MiniPlaceholders-LuckPerms-Expansion-Fabric-${project.version}.jar")
doLast {
copy {
from(archiveFile)
into("${rootProject.projectDir}/build")
}
}
}
shadowJar {
configurations = listOf(shade)
}
}
java {
withSourcesJar()
}
@@ -1,28 +0,0 @@
package io.github.miniplaceholders.expansion.luckperms.fabric;
import io.github.miniplaceholders.expansion.luckperms.common.CommonExpansion;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import net.minecraft.server.level.ServerPlayer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class FabricMod implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("miniplaceholders-luckperms-expansion");
@Override
public void onInitialize() {
LOGGER.info("Starting LuckPerms Expansion for Fabric");
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
final LuckPerms luckPerms = LuckPermsProvider.get();
new CommonExpansion(luckPerms).commonBuilder()
.filter(ServerPlayer.class)
.build()
.register();
});
}
}
-29
View File
@@ -1,29 +0,0 @@
{
"schemaVersion": 1,
"id": "miniplaceholders-luckperms-expansion",
"version": "${version}",
"name": "MiniPlaceholders-LuckPerms-Expansion",
"authors": [
"4drian3d"
],
"contact": {
"homepage": "https://github.com/MiniPlaceholders/LuckPerms-Expansion",
"sources": "https://github.com/MiniPlaceholders/LuckPerms-Expansion",
"issues": "https://github.com/MiniPlaceholders/LuckPerms-Expansion/issues"
},
"license": "GPL",
"environment": "server",
"entrypoints": {
"main": [
"io.github.miniplaceholders.expansion.luckperms.fabric.FabricMod"
]
},
"depends": {
"fabricloader": ">=0.14.22",
"fabric": "*",
"java": ">=17",
"minecraft": ">=1.20.1",
"miniplaceholders": ">=2.2.1",
"luckperms": ">=5.4.0"
}
}
+1 -3
View File
@@ -3,10 +3,9 @@ metadata.format.version = "1.1"
[versions]
velocity = "3.2.0-SNAPSHOT"
paper = "1.20.2-R0.1-SNAPSHOT"
paper = "1.19.4-R0.1-SNAPSHOT"
blossom = "2.1.0"
shadow = "8.1.1"
runtask = "2.2.0"
pluginyml = "0.6.0"
@@ -38,7 +37,6 @@ adventure-platform-fabric = { group = "net.kyori", name = "adventure-platform-fa
[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" }
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+7 -5
View File
@@ -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/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
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
@@ -112,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.
@@ -203,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * 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.
@@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
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
View File
@@ -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
+3 -3
View File
@@ -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
+3 -6
View File
@@ -1,10 +1,9 @@
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "LuckPerms-Expansion"
rootProject.name = "MiniPlaceholders-LuckPerms"
dependencyResolutionManagement {
repositories {
maven("https://papermc.io/repo/repository/maven-public/")
//maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
}
@@ -13,18 +12,16 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.fabricmc.net/")
maven("https://maven.quiltmc.org/repository/release/")
}
}
arrayOf("common", "paper", "velocity", "sponge", "fabric").forEach {
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("fabric-loom") version "1.4.4"
id("org.spongepowered.gradle.plugin") version "2.2.0"
}