5 Commits
Author SHA1 Message Date
NotAlexNoyle 5cdc823d8d Exclude CODEOWNERS from language statistics 2026-10-28 08:31:43 -04:00
NotAlexNoyle 180eaf45d9 Add CODEOWNERS (one staff approval) 2026-10-28 08:31:43 -04:00
NotAlexNoyle 7f25d95fc4 Fix building with TrueOG Bootstrap 2025-09-27 12:49:48 -04:00
NotAlexNoyle 49aefaf4c0 Update README.md 2025-09-27 12:39:43 -04:00
NotAlexNoyle 3f3071444a Fix build 2025-09-27 12:38:20 -04:00
14 changed files with 43 additions and 226 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
-30
View File
@@ -1,30 +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 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
command: gradle build
+1 -10
View File
@@ -1,18 +1,9 @@
# PlaceholderAPI-Expansion
PlaceholderAPI Expansion for MiniPlaceholders
1.19.4 branch of PlaceholderAPI Expansion for MiniPlaceholders
## Supported Platforms
- Paper
- Folia
- Velocity
### If you are using Velocity
In order to use PlaceholderAPI placeholders with MiniPlaceholders Velocity,
you must install [PAPIProxyBridge](https://modrinth.com/plugin/papiproxybridge) according to its installation guide
On Velocity there is an additional optional `expiry` parameter for how long the placeholder should be cached. This value is in milliseconds.
## Placeholders
+2 -1
View File
@@ -1,11 +1,12 @@
plugins {
java
alias(libs.plugins.shadow)
eclipse
}
dependencies {
implementation(projects.placeholderapiExpansionPaper)
implementation(projects.placeholderapiExpansionVelocity)
}
tasks {
+4 -4
View File
@@ -3,10 +3,10 @@ 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"
shadow = "8.3.6"
runtask = "2.2.3"
miniplaceholders = "2.2.3"
@@ -17,12 +17,12 @@ adventure = "4.13.1"
velocity-api = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
paper-api = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" }
miniplaceholders = { group = "io.github.miniplaceholders", name = "miniplaceholders-api", version.ref = "miniplaceholders" }
placeholderapi = { group = "me.clip", name = "placeholderapi", version = "2.11.5" }
placeholderapi = { group = "me.clip", name = "placeholderapi", version = "2.11.6" }
proxybridge = "net.william278:papiproxybridge:1.4.2"
[plugins]
blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
runvelocity = { id = "xyz.jpenilla.run-velocity", version.ref = "runtask" }
runpaper = { id = "xyz.jpenilla.run-velocity", version.ref = "runtask" }
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.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored Regular → Executable
+14 -11
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/.
@@ -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.
@@ -144,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
@@ -152,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
@@ -201,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
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
+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
}
repositories {
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
}
+2 -2
View File
@@ -1,12 +1,12 @@
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "PlaceholderAPI-Expansion"
rootProject.name = "PlaceholderAdapter-Expansion"
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
arrayOf("paper", "velocity").forEach {
arrayOf("paper").forEach {
include("placeholderapi-expansion-$it")
project(":placeholderapi-expansion-$it").projectDir = file(it)
-31
View File
@@ -1,31 +0,0 @@
plugins {
java
alias(libs.plugins.blossom)
}
repositories {
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://jitpack.io")
maven("https://repo.william278.net/releases/")
}
dependencies {
compileOnly(libs.proxybridge)
compileOnly(libs.miniplaceholders)
compileOnly(libs.velocity.api)
annotationProcessor(libs.velocity.api)
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
}
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
blossom {
replaceTokenIn("src/main/java/io/github/miniplaceholders/expansion/placeholderapi/velocity/VelocityPlugin.java")
replaceToken("{version}", project.version)
}
@@ -1,123 +0,0 @@
package io.github.miniplaceholders.expansion.placeholderapi.velocity;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Dependency;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.Player;
import io.github.miniplaceholders.api.Expansion;
import io.github.miniplaceholders.api.utils.LegacyUtils;
import net.kyori.adventure.text.minimessage.tag.Tag;
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue;
import net.william278.papiproxybridge.api.PlaceholderAPI;
import org.slf4j.Logger;
import java.util.OptionalInt;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import static net.kyori.adventure.text.minimessage.MiniMessage.miniMessage;
import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.AMPERSAND_CHAR;
import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.SECTION_CHAR;
@Plugin(
id = "placeholderapi-expansion",
name = "PlaceholderAPI Expansion",
version = "{version}",
authors = { "4drian3d" },
dependencies = {
@Dependency(id = "miniplaceholders"),
@Dependency(id = "papiproxybridge")
}
)
public final class VelocityPlugin {
@Inject
private Logger logger;
private static final UUID NULL_UUID = UUID.randomUUID();
private static final PlaceholderAPI instance = PlaceholderAPI.createInstance();
private static final ConcurrentMap<Long, PlaceholderAPI> cachedInstances = Maps.newConcurrentMap();
private PlaceholderAPI getAPI(ArgumentQueue queue) {
if (!queue.hasNext()) return instance;
OptionalInt optExpiry = queue.pop().asInt();
if (optExpiry.isEmpty()) return instance;
Long expiry = (long) optExpiry.getAsInt();
return cachedInstances.computeIfAbsent(expiry, (key) -> {
PlaceholderAPI api = PlaceholderAPI.createInstance();
api.setCacheExpiry(key);
return api;
});
}
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
this.logger.info("Starting PlaceholderAPI Expansion for MiniPlaceholders Velocity");
Expansion.builder("placeholderapi")
.filter(Player.class)
.globalPlaceholder("global", (queue, ctx) -> {
final String argument = queue.popOr("You need to provide a placeholder").value();
boolean isString = parseString(queue);
PlaceholderAPI api = getAPI(queue);
final String papiParsed = api
.formatPlaceholders(argument, NULL_UUID)
.completeOnTimeout(argument, 100, TimeUnit.MILLISECONDS)
.join()
.replace(SECTION_CHAR, AMPERSAND_CHAR);
if (isString) {
return Tag.preProcessParsed(miniMessage().serialize(LegacyUtils.parsePossibleLegacy(papiParsed)));
} else {
return Tag.selfClosingInserting(LegacyUtils.parsePossibleLegacy(papiParsed));
}
})
.audiencePlaceholder("player", (aud, queue, ctx) -> {
final String argument = queue.popOr("You need to provide a placeholder").value();
final Player player = (Player)aud;
boolean isString = parseString(queue);
PlaceholderAPI api = getAPI(queue);
final String papiParsed = api
.formatPlaceholders(argument, player.getUniqueId())
.completeOnTimeout(argument, 100, TimeUnit.MILLISECONDS)
.join()
.replace(SECTION_CHAR, AMPERSAND_CHAR);
if (isString) {
return Tag.preProcessParsed(miniMessage().serialize(LegacyUtils.parsePossibleLegacy(papiParsed)));
} else {
return Tag.selfClosingInserting(LegacyUtils.parsePossibleLegacy(papiParsed));
}
})
.relationalPlaceholder("relational", (audience, audienceToShow, queue, ctx) -> {
final String argument = queue.popOr("You need to provide a placeholder").value();
final Player player = (Player) audience;
final Player toShow = (Player) audienceToShow;
boolean isString = parseString(queue);
PlaceholderAPI api = getAPI(queue);
final String papiParsed = api
.formatPlaceholders(argument, player.getUniqueId(), toShow.getUniqueId())
.completeOnTimeout(argument, 100, TimeUnit.MILLISECONDS)
.join()
.replace(SECTION_CHAR, AMPERSAND_CHAR);
if (isString) {
return Tag.preProcessParsed(miniMessage().serialize(LegacyUtils.parsePossibleLegacy(papiParsed)));
} else {
return Tag.selfClosingInserting(LegacyUtils.parsePossibleLegacy(papiParsed));
}
})
.build()
.register();
}
private boolean parseString(ArgumentQueue queue) {
boolean isString = queue.hasNext() && queue.peek().lowerValue().equals("string");
if (isString) queue.pop();
return isString;
}
}