Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21.1 #251

Merged
merged 18 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
909e799
Bump org.jetbrains.kotlin.kapt from 1.9.22 to 2.0.10
dependabot[bot] Aug 9, 2024
a377c44
Bump org.jetbrains.kotlin.jvm from 1.9.22 to 2.0.10
dependabot[bot] Aug 9, 2024
672b447
Bump io.lettuce:lettuce-core from 6.3.0.RELEASE to 6.4.0.RELEASE
dependabot[bot] Aug 9, 2024
6e2f1a7
Bump io.fabric8:kubernetes-client from 6.9.2 to 6.13.3
dependabot[bot] Aug 14, 2024
521405d
Bump io.fabric8:kubernetes-httpclient-okhttp from 6.9.2 to 6.13.3
dependabot[bot] Aug 14, 2024
37afeae
Merge remote-tracking branch 'origin/dependabot/gradle/org.jetbrains.…
jimchen5209 Aug 15, 2024
c60b4ef
Merge remote-tracking branch 'origin/dependabot/gradle/org.jetbrains.…
jimchen5209 Aug 15, 2024
9ae3378
Merge remote-tracking branch 'origin/dependabot/gradle/io.lettuce-let…
jimchen5209 Aug 15, 2024
245e9cf
Merge remote-tracking branch 'origin/dependabot/gradle/io.fabric8-kub…
jimchen5209 Aug 15, 2024
8820617
Merge remote-tracking branch 'origin/dependabot/gradle/io.fabric8-kub…
jimchen5209 Aug 15, 2024
46b2dcc
build: Bump com.gradleup.shadow from 8.1.1 to 8.3.0
jimchen5209 Aug 15, 2024
e99858d
build: Update Java version to 21
jimchen5209 Aug 15, 2024
9fb3505
build: bump gradle to 8.9
jimchen5209 Aug 15, 2024
539f936
feat: bump minecraft version 1.21.1
jimchen5209 Aug 15, 2024
50c0d73
fix: RemoveResourcePack was renamed to RemoveResourcePackPacket
jimchen5209 Aug 15, 2024
49908b7
fix: resourcePack can't be reapply after RemoveResourcePackPacket
jimchen5209 Aug 15, 2024
eb254b3
build: bump galaxy lib
jimchen5209 Aug 15, 2024
3559d7c
ci: update ci version
jimchen5209 Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -21,16 +21,16 @@ jobs:
caches-

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Build with Gradle
run: ./gradlew build

- name: Upload-Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact
path: build/libs/
Expand All @@ -51,9 +51,9 @@ jobs:
echo IMAGE_NAME=${GITHUB_REPOSITORY,,} >>${GITHUB_ENV}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: build/libs/
Expand All @@ -62,7 +62,7 @@ jobs:
run: cp build/libs/galaxy-proxy-1.0-SNAPSHOT.jar docker/plugins

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
COPY --chown=1000 --link docker /app

# Download Velocity
ADD --chown=1000 --link https://api.papermc.io/v2/projects/velocity/versions/3.3.0-SNAPSHOT/builds/312/downloads/velocity-3.3.0-SNAPSHOT-312.jar /app/velocity.jar
ADD --chown=1000 --link https://api.papermc.io/v2/projects/velocity/versions/3.3.0-SNAPSHOT/builds/414/downloads/velocity-3.3.0-SNAPSHOT-414.jar /app/velocity.jar

# Run Server
EXPOSE 25565
Expand Down
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id "org.jetbrains.kotlin.kapt" version "1.9.22"
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.jetbrains.kotlin.jvm' version '2.0.10'
id "org.jetbrains.kotlin.kapt" version "2.0.10"
id 'com.gradleup.shadow' version '8.3.0'
}

group 'one.oktw'
Expand All @@ -23,16 +25,16 @@ repositories {
dependencies {
kapt 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'
compileOnly 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'
implementation 'io.fabric8:kubernetes-client:6.9.2'
implementation 'io.fabric8:kubernetes-httpclient-okhttp:6.9.2'
implementation 'io.fabric8:kubernetes-client:6.13.3'
implementation 'io.fabric8:kubernetes-httpclient-okhttp:6.13.3'
implementation 'com.github.fkorotkov:k8s-kotlin-dsl:3.3.0'
implementation 'io.lettuce:lettuce-core:6.3.0.RELEASE'
implementation 'io.lettuce:lettuce-core:6.4.0.RELEASE'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-reactive' // lettuce need this
implementation 'one.oktw:galaxy-lib:9a964eaf'
implementation 'one.oktw:galaxy-lib:7376fcdf'
}

compileKotlin {
kotlinOptions.jvmTarget = "17"
compilerOptions.jvmTarget = JvmTarget.JVM_21
}

tasks.withType(AbstractArchiveTask).configureEach {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
21 changes: 12 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand Down Expand Up @@ -84,7 +86,8 @@ 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
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -145,15 +148,15 @@ 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
case $MAX_FD in #(
'' | 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
Expand Down Expand Up @@ -202,11 +205,11 @@ 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, 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" \
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down Expand Up @@ -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

Expand All @@ -57,11 +59,11 @@ 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

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rootProject.name = 'galaxy-proxy'
include 'api'
project(":api").projectDir.mkdirs()
13 changes: 0 additions & 13 deletions src/main/kotlin/one/oktw/galaxy/proxy/extension/Player.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@ package one.oktw.galaxy.proxy.resourcepack

import com.velocitypowered.api.proxy.Player
import one.oktw.galaxy.proxy.Main.Companion.main
import one.oktw.galaxy.proxy.extension.sendPacket

class ResourcePackHelper {
companion object{
fun trySendResourcePack(player: Player, galaxy: String){
val resourcePack = main.config.galaxiesResourcePack[galaxy] ?: return
// workaround Minecraft 1.20.3 not auto unload old resource pack
try {
val packet = Class.forName("com.velocitypowered.proxy.protocol.packet.RemoveResourcePack").getConstructor().newInstance()
player.sendPacket(packet)
} catch (e: Exception) {
main.logger.error("Send remove resource pack packet error.", e)
}

player.clearResourcePacks()
player.sendResourcePackOffer(
main.proxy.createResourcePackBuilder(resourcePack.uri.toString())
.setHash(resourcePack.hash)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/proxy.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ProtocolVersion": 765
"ProtocolVersion": 767
}