diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..78e7463a1 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,142 @@ +import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +plugins { + `java-library` + `maven-publish` + id("com.github.johnrengelman.shadow") version ("6.1.0") apply false +} + +subprojects { + apply { + plugin() + plugin() + plugin() + plugin() + } + + group = "us.myles" + version = "3.3.0-21w06a" + description = "Allow newer clients to join older server versions." + + java.sourceCompatibility = JavaVersion.VERSION_1_8 + + tasks { + build { + dependsOn(withType()) + } + + test { + useJUnitPlatform() + } + + withType() { + options.encoding = "UTF-8" + } + javadoc { + options.encoding = "UTF-8" + } + + // Variable replacements + processResources { + filesMatching(listOf("plugin.yml", "mcmod.info", "fabric.mod.json", "bungee.yml")) { + expand("version" to project.version, "description" to project.description) + } + } + + withType() { + archiveFileName.set("ViaVersion-" + project.version + ".jar") + + relocate("org.yaml.snakeyaml", "us.myles.viaversion.libs.snakeyaml") + relocate("javassist", "us.myles.viaversion.libs.javassist") + relocate("com.google.gson", "us.myles.viaversion.libs.gson") + relocate("com.github.steveice10.opennbt", "us.myles.viaversion.libs.opennbt") + + relocate("net.md_5.bungee", "us.myles.viaversion.libs.bungeecordchat") { + include("net.md_5.bungee.api.chat.*") + include("net.md_5.bungee.api.ChatColor") + include("net.md_5.bungee.api.ChatMessageType") + include("net.md_5.bungee.chat.*") + } + + relocate("it.unimi.dsi.fastutil", "us.myles.viaversion.libs.fastutil") { + // We only want int and Object maps + include("it.unimi.dsi.fastutil.ints.*") + include("it.unimi.dsi.fastutil.objects.*") + include("it.unimi.dsi.fastutil.*.class") + // Object types + exclude("it.unimi.dsi.fastutil.*.*Reference*") + exclude("it.unimi.dsi.fastutil.*.*Boolean*") + exclude("it.unimi.dsi.fastutil.*.*Byte*") + exclude("it.unimi.dsi.fastutil.*.*Short*") + exclude("it.unimi.dsi.fastutil.*.*Float*") + exclude("it.unimi.dsi.fastutil.*.*Double*") + exclude("it.unimi.dsi.fastutil.*.*Long*") + exclude("it.unimi.dsi.fastutil.*.*Char*") + // Map types + exclude("it.unimi.dsi.fastutil.*.*Custom*") + exclude("it.unimi.dsi.fastutil.*.*Linked*") + exclude("it.unimi.dsi.fastutil.*.*Sorted*") + exclude("it.unimi.dsi.fastutil.*.*Tree*") + exclude("it.unimi.dsi.fastutil.*.*Heap*") + exclude("it.unimi.dsi.fastutil.*.*Queue*") + // Crossing fingers + exclude("it.unimi.dsi.fastutil.*.*Big*") + exclude("it.unimi.dsi.fastutil.*.*Synchronized*") + exclude("it.unimi.dsi.fastutil.*.*Unmodifiable*") + } + } + } + + repositories { + maven { + url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots") + } + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots") + } + maven { + url = uri("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/") + } + maven { + url = uri("https://repo.spongepowered.org/maven") + } + maven { + url = uri("https://repo.viaversion.com") + } + maven { + url = uri("https://libraries.minecraft.net") + } + maven { + url = uri("https://repo.maven.apache.org/maven2/") + } + } + + dependencies { + implementation("net.md-5:bungeecord-chat:1.16-R0.5-SNAPSHOT") + implementation("it.unimi.dsi:fastutil:8.3.1") + implementation("com.github.steveice10:opennbt:1.2-SNAPSHOT") + implementation("com.google.code.gson:gson:2.8.6") + implementation("org.javassist:javassist:3.27.0-GA") + implementation("org.yaml:snakeyaml:1.18") + + compileOnly("io.netty:netty-all:4.0.20.Final") + compileOnly("com.google.guava:guava:17.0") + compileOnly("org.jetbrains:annotations:19.0.0") + + testImplementation("io.netty:netty-all:4.0.20.Final") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.3") + testImplementation("org.junit.jupiter:junit-jupiter-engine:5.6.3") + } + + java { + withSourcesJar() + withJavadocJar() + } + + publishing { + publications.create("maven") { + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/bukkit-legacy/build.gradle.kts b/bukkit-legacy/build.gradle.kts new file mode 100644 index 000000000..afb9498c5 --- /dev/null +++ b/bukkit-legacy/build.gradle.kts @@ -0,0 +1,10 @@ +dependencies { + implementation(project(":viaversion-common")) + compileOnly("org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT") { + exclude("junit", "junit") + exclude("com.google.code.gson", "gson") + exclude("javax.persistence", "persistence-api") + } +} + +description = "viaversion-bukkit-legacy" diff --git a/bukkit-legacy/pom.xml b/bukkit-legacy/pom.xml deleted file mode 100644 index af919d74d..000000000 --- a/bukkit-legacy/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-bukkit-legacy - - - 1.8.8-R0.1-SNAPSHOT - - - - - - . - true - src/main/resources/ - - * - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - - org.bukkit - bukkit - ${bukkitVersion} - provided - true - - - junit - junit - - - gson - com.google.code.gson - - - persistence-api - javax.persistence - - - - - \ No newline at end of file diff --git a/bukkit/build.gradle.kts b/bukkit/build.gradle.kts new file mode 100644 index 000000000..262c78b66 --- /dev/null +++ b/bukkit/build.gradle.kts @@ -0,0 +1,11 @@ +dependencies { + implementation(project(":viaversion-bukkit-legacy")) + implementation(project(":viaversion-common")) + compileOnly("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT") { + exclude("junit", "junit") + exclude("com.google.code.gson", "gson") + exclude("javax.persistence", "persistence-api") + } +} + +description = "viaversion-bukkit" diff --git a/bukkit/pom.xml b/bukkit/pom.xml deleted file mode 100644 index 56363cdd6..000000000 --- a/bukkit/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-bukkit - - - - 1.16.1-R0.1-SNAPSHOT - - - - - - . - true - src/main/resources/ - - * - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - - org.spigotmc - spigot-api - ${serverVersion} - provided - true - - - junit - junit - - - gson - com.google.code.gson - - - persistence-api - javax.persistence - - - - - - - us.myles - viaversion-bukkit-legacy - ${project.parent.version} - compile - - - diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 8aa3d4646..9b80adca3 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -1,8 +1,8 @@ name: ViaVersion main: us.myles.ViaVersion.ViaVersionPlugin authors: [_MylesC, creeper123123321, Gerrygames, KennyTV, Matsv] -version: ${project.version} -description: ${project.description} +version: ${version} +description: ${description} load: postworld api-version: 1.13 loadbefore: [ProtocolLib, ProxyPipe, SpigotLib, SkinRestorer] diff --git a/bungee/build.gradle.kts b/bungee/build.gradle.kts new file mode 100644 index 000000000..060b085c8 --- /dev/null +++ b/bungee/build.gradle.kts @@ -0,0 +1,6 @@ +dependencies { + implementation(project(":viaversion-common")) + compileOnly("net.md-5:bungeecord-api:1.15-SNAPSHOT") +} + +description = "viaversion-bungee" diff --git a/bungee/pom.xml b/bungee/pom.xml deleted file mode 100644 index fecb3ab69..000000000 --- a/bungee/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-bungee - - - - - . - true - src/main/resources/ - - * - - - - - - - - - net.md-5 - bungeecord-api - 1.15-SNAPSHOT - provided - - - - - us.myles - viaversion-common - ${project.parent.version} - - - diff --git a/bungee/src/main/resources/bungee.yml b/bungee/src/main/resources/bungee.yml index c107e591d..281b4583e 100644 --- a/bungee/src/main/resources/bungee.yml +++ b/bungee/src/main/resources/bungee.yml @@ -1,5 +1,5 @@ name: ViaVersion main: us.myles.ViaVersion.BungeePlugin -description: ${project.description} +description: ${description} author: _MylesC, creeper123123321, Gerrygames, KennyTV, Matsv -version: ${project.version} \ No newline at end of file +version: ${version} \ No newline at end of file diff --git a/common/build.gradle.kts b/common/build.gradle.kts new file mode 100644 index 000000000..dae021786 --- /dev/null +++ b/common/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("net.kyori.blossom") version "1.1.0" + id("org.ajoberstar.grgit") version "4.1.0" +} + +val commitId: String = grgit.head().abbreviatedId + +blossom { + replaceToken("\$VERSION", project.version) + replaceToken("\$IMPL_VERSION", "git-ViaVersion-" + project.version + ":" + commitId) +} + +description = "viaversion-common" diff --git a/common/pom.xml b/common/pom.xml deleted file mode 100644 index b4817b97a..000000000 --- a/common/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - - 4.0.0 - - viaversion-common - - - - it.unimi.dsi - fastutil - 8.3.1 - compile - - - diff --git a/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java index adce225f5..2352dfc65 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java +++ b/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java @@ -32,7 +32,7 @@ public interface Chunk { void setIgnoreOldLightData(boolean ignoreOldLightData); /** - * @return chunk section bit mask for chunks < 1.17 + * @return chunk section bit mask for chunks < 1.17 * @see #getChunkMask() */ int getBitmask(); diff --git a/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java index dc9c54cc5..efe31fed6 100644 --- a/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java +++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java @@ -44,7 +44,7 @@ public class DumpSubCmd extends ViaSubCommand { Via.getPlatform().getPlatformName(), Via.getPlatform().getPlatformVersion(), Via.getPlatform().getPluginVersion(), - ViaManager.class.getPackage().getImplementationVersion(), + "$IMPL_VERSION", Via.getManager().getSubPlatforms() ); diff --git a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java index dae27fa7a..6628bf805 100644 --- a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java +++ b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java @@ -43,7 +43,7 @@ public class UpdateUtil { @Nullable private static String getUpdateMessage(boolean console) { - if (Via.getPlatform().getPluginVersion().equals("${project.version}")) { + if (Via.getPlatform().getPluginVersion().equals("${version}")) { return "You are using a debug/custom version, consider updating."; } String newestString = getNewestVersion(); diff --git a/common/src/main/java/us/myles/ViaVersion/util/VersionInfo.java b/common/src/main/java/us/myles/ViaVersion/util/VersionInfo.java new file mode 100644 index 000000000..aaba31032 --- /dev/null +++ b/common/src/main/java/us/myles/ViaVersion/util/VersionInfo.java @@ -0,0 +1,6 @@ +package us.myles.ViaVersion.util; + +public class VersionInfo { + + public static final String VERSION = "$VERSION"; +} diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts new file mode 100644 index 000000000..6d2a5ca65 --- /dev/null +++ b/fabric/build.gradle.kts @@ -0,0 +1,5 @@ +dependencies { + implementation(project(":viaversion-common")) +} + +description = "viaversion-fabric" diff --git a/fabric/pom.xml b/fabric/pom.xml deleted file mode 100644 index 3576870be..000000000 --- a/fabric/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-fabric - - - - - . - true - src/main/resources/ - - ** - - - - - - org.codehaus.mojo - templating-maven-plugin - 1.0.0 - - - filter-src - - filter-sources - - - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - \ No newline at end of file diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 7426e3f73..d13b09fc7 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -2,8 +2,8 @@ "schemaVersion": 1, "id": "viaversion", "name": "ViaVersion", - "version": "${project.version}", - "description": "${project.description}", + "version": "${version}", + "description": "${description}", "license": "MIT", "contact": { "homepage": "https://viaversion.com/", diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..f30cf6d13 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.daemon=true +org.gradle.configureondemand=true +org.gradle.parallel=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..e708b1c02 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..2a563242c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 000000000..4f906e0c8 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +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. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..107acd32c --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "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. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +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. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jar/build.gradle.kts b/jar/build.gradle.kts new file mode 100644 index 000000000..0e0156d3c --- /dev/null +++ b/jar/build.gradle.kts @@ -0,0 +1,10 @@ +dependencies { + implementation(project(":viaversion-common")) + implementation(project(":viaversion-bukkit")) + implementation(project(":viaversion-bungee")) + implementation(project(":viaversion-fabric")) + implementation(project(":viaversion-sponge")) + implementation(project(":viaversion-velocity")) +} + +description = "viaversion-jar" diff --git a/jar/pom.xml b/jar/pom.xml deleted file mode 100644 index 26711ab3f..000000000 --- a/jar/pom.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - viaversion-jar - viaversion - - - ViaVersion-${project.version} - clean install - - - . - false - ../ - - LICENSE - - - - . - true - src/main/resources/ - - * - - - - - - - - net.md-5 - scriptus - 0.3.2 - - git-ViaVersion-${project.parent.version}:%s - - - - initialize - - describe - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - - ${describe} - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.2 - - false - false - - - it.unimi.dsi:fastutil - - - it/unimi/dsi/fastutil/ints/* - it/unimi/dsi/fastutil/objects/* - it/unimi/dsi/fastutil/*.class - - - - it/unimi/dsi/fastutil/*/*Reference* - it/unimi/dsi/fastutil/*/*Boolean* - it/unimi/dsi/fastutil/*/*Byte* - it/unimi/dsi/fastutil/*/*Short* - it/unimi/dsi/fastutil/*/*Float* - it/unimi/dsi/fastutil/*/*Double* - it/unimi/dsi/fastutil/*/*Long* - it/unimi/dsi/fastutil/*/*Char* - - it/unimi/dsi/fastutil/*/*Custom* - it/unimi/dsi/fastutil/*/*Linked* - it/unimi/dsi/fastutil/*/*Sorted* - it/unimi/dsi/fastutil/*/*Tree* - it/unimi/dsi/fastutil/*/*Heap* - it/unimi/dsi/fastutil/*/*Queue* - - it/unimi/dsi/fastutil/*/*Big* - it/unimi/dsi/fastutil/*/*Synchronized* - it/unimi/dsi/fastutil/*/*Unmodifiable* - - - - - - it.unimi.dsi.fastutil - us.myles.viaversion.libs.fastutil - - - com.github.steveice10.opennbt - us.myles.viaversion.libs.opennbt - - - com.google.gson - us.myles.viaversion.libs.gson - - - javassist - us.myles.viaversion.libs.javassist - - - net.md_5.bungee - us.myles.viaversion.libs.bungeecordchat - - net.md_5.bungee.api.chat.** - net.md_5.bungee.api.ChatColor - net.md_5.bungee.api.ChatMessageType - net.md_5.bungee.chat.** - - - - - - - package - - shade - - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - - - us.myles - viaversion-bukkit - ${project.parent.version} - - - us.myles - viaversion-bungee - ${project.parent.version} - - - us.myles - viaversion-fabric - ${project.parent.version} - - - us.myles - viaversion-sponge - ${project.parent.version} - - - us.myles - viaversion-velocity - ${project.parent.version} - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index b91a8eb91..000000000 --- a/pom.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - 4.0.0 - - us.myles - viaversion-parent - 3.3.0-21w08a - pom - - viaversion-parent - - Allow newer clients to join older server versions. - 2016 - https://www.spigotmc.org/resources/viaversion.19254/ - - - common - bukkit - bukkit-legacy - bungee - fabric - sponge - sponge-legacy - velocity - jar - - - - 3.3.3 - - - - - UTF-8 - ${projectEncoding} - ${projectEncoding} - 1.8 - 1.8 - - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots - - - - - bungeecord-repo - https://oss.sonatype.org/content/repositories/snapshots - - - - - velocity - https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/ - - - - - sponge - https://repo.spongepowered.org/maven - - - - - viaversion-repo - https://repo.viaversion.com - - - - - mojang - https://libraries.minecraft.net - - - - - - - org.javassist - javassist - 3.27.0-GA - compile - true - - - - - - com.github.steveice10 - opennbt - 1.2-SNAPSHOT - compile - true - - - - - com.google.code.gson - gson - 2.8.6 - compile - true - - - - - io.netty - netty-all - 4.0.20.Final - provided - true - - - - - net.md-5 - bungeecord-chat - 1.16-R0.5-SNAPSHOT - compile - - - - - com.google.guava - guava - 17.0 - provided - - - - - org.jetbrains - annotations - 19.0.0 - provided - - - - - org.junit.jupiter - junit-jupiter-api - 5.3.1 - test - - - - - org.yaml - snakeyaml - 1.18 - provided - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - deploy - - jar-no-fork - - - - - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..0819d6229 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,21 @@ +rootProject.name = "viaversion-parent" + +include(":viaversion") +include(":viaversion-common") +include(":viaversion-bukkit") +include(":viaversion-bukkit-legacy") +include(":viaversion-bungee") +include(":viaversion-velocity") +include(":viaversion-sponge-legacy") +include(":viaversion-sponge") +include(":viaversion-fabric") + +project(":viaversion-common").projectDir = file("common") +project(":viaversion-bukkit").projectDir = file("bukkit") +project(":viaversion-bukkit-legacy").projectDir = file("bukkit-legacy") +project(":viaversion-bungee").projectDir = file("bungee") +project(":viaversion-velocity").projectDir = file("velocity") +project(":viaversion-sponge").projectDir = file("sponge") +project(":viaversion-sponge-legacy").projectDir = file("sponge-legacy") +project(":viaversion-fabric").projectDir = file("fabric") +project(":viaversion").projectDir = file("jar") diff --git a/sponge-legacy/build.gradle.kts b/sponge-legacy/build.gradle.kts new file mode 100644 index 000000000..956a120a5 --- /dev/null +++ b/sponge-legacy/build.gradle.kts @@ -0,0 +1,6 @@ +dependencies { + implementation(project(":viaversion-common")) + compileOnly("org.spongepowered:spongeapi:4.0.0-SNAPSHOT") +} + +description = "viaversion-sponge-legacy" \ No newline at end of file diff --git a/sponge-legacy/pom.xml b/sponge-legacy/pom.xml deleted file mode 100644 index 9a6d63d45..000000000 --- a/sponge-legacy/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-sponge-legacy - jar - - - - - . - true - src/main/resources/ - - * - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - - org.spongepowered - spongeapi - 4.0.0-SNAPSHOT - provided - - - - diff --git a/sponge/build.gradle.kts b/sponge/build.gradle.kts new file mode 100644 index 000000000..6dc243097 --- /dev/null +++ b/sponge/build.gradle.kts @@ -0,0 +1,7 @@ +dependencies { + implementation(project(":viaversion-sponge-legacy")) + implementation(project(":viaversion-common")) + compileOnly("org.spongepowered:spongeapi:5.0.0-SNAPSHOT") +} + +description = "viaversion-sponge" diff --git a/sponge/pom.xml b/sponge/pom.xml deleted file mode 100644 index fc5b97728..000000000 --- a/sponge/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-sponge - - - - - . - true - src/main/resources/ - - ** - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - -proc:none - - - - - org.codehaus.mojo - templating-maven-plugin - 1.0.0 - - - filter-src - - filter-sources - - - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - - org.spongepowered - spongeapi - 5.0.0-SNAPSHOT - provided - - - - - us.myles - viaversion-sponge-legacy - ${project.parent.version} - compile - - - - diff --git a/sponge/src/main/java-templates/us/myles/ViaVersion/sponge/VersionInfo.java b/sponge/src/main/java-templates/us/myles/ViaVersion/sponge/VersionInfo.java deleted file mode 100644 index 960f6a88d..000000000 --- a/sponge/src/main/java-templates/us/myles/ViaVersion/sponge/VersionInfo.java +++ /dev/null @@ -1,5 +0,0 @@ -package us.myles.ViaVersion.sponge; - -public class VersionInfo { - public static final String VERSION = "${project.version}"; -} diff --git a/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java b/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java index 63ffbfba6..ddd0bc068 100644 --- a/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java +++ b/sponge/src/main/java/us/myles/ViaVersion/SpongePlugin.java @@ -23,12 +23,12 @@ import us.myles.ViaVersion.api.platform.TaskId; import us.myles.ViaVersion.api.platform.ViaConnectionManager; import us.myles.ViaVersion.api.platform.ViaPlatform; import us.myles.ViaVersion.dump.PluginInfo; -import us.myles.ViaVersion.sponge.VersionInfo; import us.myles.ViaVersion.sponge.commands.SpongeCommandHandler; import us.myles.ViaVersion.sponge.commands.SpongeCommandSender; import us.myles.ViaVersion.sponge.platform.*; import us.myles.ViaVersion.sponge.util.LoggerWrapper; import us.myles.ViaVersion.util.GsonUtil; +import us.myles.ViaVersion.util.VersionInfo; import java.io.File; import java.util.*; diff --git a/sponge/src/main/resources/mcmod.info b/sponge/src/main/resources/mcmod.info index 343aa5088..4660c688b 100644 --- a/sponge/src/main/resources/mcmod.info +++ b/sponge/src/main/resources/mcmod.info @@ -2,8 +2,8 @@ { "modid": "viaversion", "name": "ViaVersion", - "version": "${project.version}", - "description": "${project.description}", + "version": "${version}", + "description": "${description}", "authorList": [ "_MylesC", "creeper123123321", diff --git a/velocity/build.gradle.kts b/velocity/build.gradle.kts new file mode 100644 index 000000000..3d6b01abe --- /dev/null +++ b/velocity/build.gradle.kts @@ -0,0 +1,7 @@ +dependencies { + implementation(project(":viaversion-common")) + compileOnly("com.velocitypowered:velocity-api:1.1.0-SNAPSHOT") + annotationProcessor("com.velocitypowered:velocity-api:1.1.0-SNAPSHOT") +} + +description = "viaversion-velocity" diff --git a/velocity/pom.xml b/velocity/pom.xml deleted file mode 100644 index 337ba0aac..000000000 --- a/velocity/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - viaversion-parent - us.myles - 3.3.0-21w08a - - 4.0.0 - - viaversion-velocity - - - - - org.codehaus.mojo - templating-maven-plugin - 1.0.0 - - - filter-src - - filter-sources - - - - - - - - - - - us.myles - viaversion-common - ${project.parent.version} - provided - - - - - com.velocitypowered - velocity-api - 1.1.0-SNAPSHOT - provided - - - - diff --git a/velocity/src/main/java-templates/us/myles/ViaVersion/velocity/VersionInfo.java b/velocity/src/main/java-templates/us/myles/ViaVersion/velocity/VersionInfo.java deleted file mode 100644 index 4b189c863..000000000 --- a/velocity/src/main/java-templates/us/myles/ViaVersion/velocity/VersionInfo.java +++ /dev/null @@ -1,5 +0,0 @@ -package us.myles.ViaVersion.velocity; - -public class VersionInfo { - public static final String VERSION = "${project.version}"; -} diff --git a/velocity/src/main/java/us/myles/ViaVersion/VelocityPlugin.java b/velocity/src/main/java/us/myles/ViaVersion/VelocityPlugin.java index a5114b4dc..9505745b7 100644 --- a/velocity/src/main/java/us/myles/ViaVersion/VelocityPlugin.java +++ b/velocity/src/main/java/us/myles/ViaVersion/VelocityPlugin.java @@ -23,7 +23,7 @@ import us.myles.ViaVersion.api.platform.ViaConnectionManager; import us.myles.ViaVersion.api.platform.ViaPlatform; import us.myles.ViaVersion.dump.PluginInfo; import us.myles.ViaVersion.util.GsonUtil; -import us.myles.ViaVersion.velocity.VersionInfo; +import us.myles.ViaVersion.util.VersionInfo; import us.myles.ViaVersion.velocity.command.VelocityCommandHandler; import us.myles.ViaVersion.velocity.command.VelocityCommandSender; import us.myles.ViaVersion.velocity.platform.*;