Compare commits

...

6 Commits

Author SHA1 Message Date
Len 5202301fdb Update to 26.2 2026-07-30 08:20:03 -05:00
Len 20797bd128 Remove java toolchain 2026-07-30 08:19:45 -05:00
Len 5c166f2bba Disable update stage 2026-07-30 08:17:26 -05:00
Len 7bbff411e4 Update Gradle Stage in Jenkinsfile 2026-07-30 08:17:03 -05:00
Len a98b35d073 Improve support for TropicalFishBucket 2026-07-30 08:15:40 -05:00
Len 23ab3747fd Update gradle 2026-07-30 08:15:14 -05:00
8 changed files with 67 additions and 60 deletions

26
Jenkinsfile vendored
View File

@ -3,7 +3,13 @@ pipeline {
stages { stages {
stage('Gradle') { stage('Gradle') {
steps { steps {
sh './gradlew build' withCredentials([usernamePassword(credentialsId: 'alttd-snapshot-user', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh '''
set +x
chmod +x gradlew
./gradlew build -PalttdSnapshotUsername=$USERNAME -PalttdSnapshotPassword=$PASSWORD
'''
}
} }
} }
stage('Archive') { stage('Archive') {
@ -16,14 +22,14 @@ pipeline {
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
} }
} }
stage('Copy to /mnt/updates/plugins') { // stage('Copy to /mnt/updates/plugins') {
when { // when {
branch 'main' // branch 'main'
branch 'master' // branch 'master'
} // }
steps { // steps {
sh 'cp build/libs/*.jar /mnt/updates/plugins/' // sh 'cp build/libs/*.jar /mnt/updates/plugins/'
} // }
} // }
} }
} }

View File

@ -19,12 +19,6 @@ description = "Player Shop plugin for Altitude."
apply<JavaLibraryPlugin>() apply<JavaLibraryPlugin>()
apply(plugin = "maven-publish") apply(plugin = "maven-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
tasks { tasks {
withType<JavaCompile> { withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name() options.encoding = Charsets.UTF_8.name()
@ -41,7 +35,7 @@ tasks {
file.parentFile.mkdirs() file.parentFile.mkdirs()
} }
if (!file.exists()) { if (!file.exists()) {
download("https://jenkins.destro.xyz/job/Cosmos/lastSuccessfulBuild/artifact/cosmos-server/build/libs/cosmos-bundler-1.21.11-R0.1-SNAPSHOT-mojmap.jar", fileName) // download("https://jenkins.destro.xyz/job/Cosmos/lastSuccessfulBuild/artifact/cosmos-server/build/libs/cosmos-bundler-1.21.11-R0.1-SNAPSHOT-mojmap.jar", fileName)
} }
serverJar(file) serverJar(file)
minecraftVersion("1.21") minecraftVersion("1.21")
@ -73,7 +67,7 @@ publishing {
} }
dependencies { dependencies {
compileOnly("com.alttd.cosmos:cosmos-api:1.21.11-R0.1-SNAPSHOT") compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable")
compileOnly("com.github.milkbowl:VaultAPI:1.7") { compileOnly("com.github.milkbowl:VaultAPI:1.7") {
exclude("org.bukkit","bukkit") exclude("org.bukkit","bukkit")
} }
@ -83,15 +77,6 @@ dependencies {
annotationProcessor("org.projectlombok:lombok:1.18.30") annotationProcessor("org.projectlombok:lombok:1.18.30")
} }
fun gitCommit(): String {
val os = ByteArrayOutputStream()
project.exec {
commandLine = "git rev-parse --short HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()).trim()
}
fun download(link: String, path: String) { fun download(link: String, path: String) {
URL(link).openStream().use { input -> URL(link).openStream().use { input ->
FileOutputStream(File(path)).use { output -> FileOutputStream(File(path)).use { output ->
@ -104,7 +89,7 @@ paper {
name = rootProject.name name = rootProject.name
main = "$group.${rootProject.name}" main = "$group.${rootProject.name}"
bootstrapper = "$group.${rootProject.name}Bootstrap" bootstrapper = "$group.${rootProject.name}Bootstrap"
version = "${rootProject.version}-${gitCommit()}" version = "${rootProject.version}"
apiVersion = "1.21" apiVersion = "1.21"
authors = listOf("destro174") authors = listOf("destro174")
serverDependencies { serverDependencies {

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

15
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
# #
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (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/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # 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. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -112,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@ -170,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
@ -203,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # 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. # 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 # * 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. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.

25
gradlew.bat vendored
View File

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @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%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

View File

@ -1,14 +1,24 @@
rootProject.name = "PlayerShops" rootProject.name = "PlayerShops"
val nexusUser = providers.gradleProperty("alttdSnapshotUsername").orNull ?: System.getenv("NEXUS_USERNAME")
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").orNull ?: System.getenv("NEXUS_PASSWORD")
dependencyResolutionManagement { dependencyResolutionManagement {
repositories { repositories {
mavenCentral() mavenCentral()
maven { maven {
name = "AlttdNexus" url = uri("https://repo.alttd.com/repository/alttd-snapshot/")
url = uri( credentials {
"https://repo.alttd.com/repository/alttd-snapshot/" username = nexusUser
) password = nexusPass
credentials(PasswordCredentials::class) }
}
maven {
url = uri("https://repo.alttd.com/repository/alttd/")
credentials {
username = nexusUser
password = nexusPass
}
} }
maven("https://repo.destro.xyz/snapshots") maven("https://repo.destro.xyz/snapshots")
maven("https://jitpack.io") { // Vault maven("https://jitpack.io") { // Vault

View File

@ -228,13 +228,19 @@ public class ItemMatcher {
matcherList.add( matcherList.add(
(meta1, meta2) -> { (meta1, meta2) -> {
if (meta1 instanceof TropicalFishBucketMeta tropicalFishBucketMeta1 && meta2 instanceof TropicalFishBucketMeta tropicalFishBucketMeta2) { if (meta1 instanceof TropicalFishBucketMeta tropicalFishBucketMeta1 && meta2 instanceof TropicalFishBucketMeta tropicalFishBucketMeta2) {
if (tropicalFishBucketMeta1.hasVariant() != tropicalFishBucketMeta2.hasVariant()) { if (tropicalFishBucketMeta1.hasVariant() && tropicalFishBucketMeta2.hasVariant()) {
return false; if (tropicalFishBucketMeta1.getPattern() != tropicalFishBucketMeta2.getPattern()) {
return false;
}
if (tropicalFishBucketMeta1.getBodyColor() != tropicalFishBucketMeta2.getBodyColor()) {
return false;
}
return tropicalFishBucketMeta1.getPatternColor() == tropicalFishBucketMeta2.getPatternColor();
} }
return !tropicalFishBucketMeta1.hasVariant() // return !tropicalFishBucketMeta1.hasVariant()
|| (tropicalFishBucketMeta1.getPattern() == tropicalFishBucketMeta2.getPattern() // || (tropicalFishBucketMeta1.getPattern() == tropicalFishBucketMeta2.getPattern()
&& tropicalFishBucketMeta1.getBodyColor().equals(tropicalFishBucketMeta2.getBodyColor()) // && tropicalFishBucketMeta1.getBodyColor().equals(tropicalFishBucketMeta2.getBodyColor())
&& tropicalFishBucketMeta1.getPatternColor().equals(tropicalFishBucketMeta2.getPatternColor())); // && tropicalFishBucketMeta1.getPatternColor().equals(tropicalFishBucketMeta2.getPatternColor()));
} }
return true; return true;
} }