mirror of
https://github.com/ViaVersion/ViaRewind-Legacy-Support.git
synced 2026-11-05 01:10:06 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e1cf69ebe | ||
|
|
18988d97c0 | ||
|
|
15045d2188 | ||
|
|
ee905820eb | ||
|
|
c62c7ed62a | ||
|
|
53bde6ba43 | ||
|
|
3eac764559 | ||
|
|
34ce9102e1 | ||
|
|
d63b405bdb | ||
|
|
dc51b8899c | ||
|
|
d3b6a41bc6 | ||
|
|
bcfa25eec9 | ||
|
|
e68e15dd9f | ||
|
|
788d87086e | ||
|
|
03a6fe6c2a | ||
|
|
54523d7de9 | ||
|
|
33c3c4c641 | ||
|
|
5a0f6621cf |
No files matched your search
+2
-2
@@ -1,2 +1,2 @@
|
||||
github: FlorianMichael
|
||||
custom: ['https://florianmichael.de/donate', 'https://creeper123123321.github.io/#donate']
|
||||
github: florianreuth
|
||||
custom: ['https://florianreuth.de/donate', 'https://creeper123123321.github.io/#donate']
|
||||
@@ -0,0 +1,22 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gradle"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
all-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
- package-ecosystem: "github-actions"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
all-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -1,21 +1,32 @@
|
||||
name: Build
|
||||
on: [pull_request, push, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
|
||||
with:
|
||||
cache-disabled: true
|
||||
cache-provider: basic
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
java-version: 25
|
||||
check-latest: true
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
run: ./gradlew build --stacktrace
|
||||
- name: Upload Artifacts to GitHub
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: Artifacts
|
||||
path: build/libs/
|
||||
if-no-files-found: error
|
||||
@@ -8,21 +8,25 @@ on:
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository_owner == 'ViaVersion'
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
|
||||
with:
|
||||
cache-disabled: true
|
||||
cache-provider: basic
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
java-version: 25
|
||||
check-latest: true
|
||||
- name: Publish
|
||||
env:
|
||||
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}
|
||||
run: ./gradlew build publishAllPublicationsToHangar
|
||||
run: ./gradlew build publishAllPublicationsToHangar --stacktrace
|
||||
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.foojay.resolver.convention.plugin)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
group = property("project_group") as String
|
||||
version = property("project_version") as String
|
||||
description = property("project_description") as String
|
||||
|
||||
if (project == rootProject) {
|
||||
(findProperty("project_name") as String?)?.let { base.archivesName = it }
|
||||
}
|
||||
|
||||
// The Kotlin plugin picks up the Java toolchain, so no Kotlin specific configuration is needed
|
||||
val jvmVersion = (property("jvm_version") as String).toInt()
|
||||
java {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(jvmVersion)
|
||||
sourceCompatibility = JavaVersion.toVersion(jvmVersion)
|
||||
targetCompatibility = JavaVersion.toVersion(jvmVersion)
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.compilerArgs.addAll(listOf("-nowarn", "-Xlint:-unchecked", "-Xlint:-deprecation"))
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
(options as StandardJavadocDocletOptions).apply {
|
||||
addBooleanOption("Xdoclint:none", true)
|
||||
quiet()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
val projectName = project.name
|
||||
from("LICENSE") {
|
||||
rename { "LICENSE_$projectName" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
signing
|
||||
}
|
||||
|
||||
val projectName = property("project_name") as String
|
||||
val ownerId = property("publish_owner_id") as String
|
||||
val ownerName = property("publish_owner_name") as String
|
||||
val ownerMail = property("publish_owner_mail") as String
|
||||
val githubAccount = findProperty("publish_github_account") as String? ?: ownerId
|
||||
val licenseName = findProperty("publish_license") as String? ?: "Apache-2.0"
|
||||
val githubRepository = "github.com/$githubAccount/$projectName"
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = project.group.toString()
|
||||
artifactId = project.name
|
||||
version = project.version.toString()
|
||||
|
||||
from(components["java"])
|
||||
|
||||
pom {
|
||||
name = projectName
|
||||
// Lazy so that a description set in the build script body is picked up
|
||||
description = provider { project.description }
|
||||
url = "https://$githubRepository"
|
||||
licenses {
|
||||
license {
|
||||
name = licenseName
|
||||
url = "https://$githubRepository/blob/main/LICENSE"
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = ownerId
|
||||
name = ownerName
|
||||
email = ownerMail
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = "scm:git:git://$githubRepository.git"
|
||||
developerConnection = "scm:git:ssh://$githubRepository.git"
|
||||
url = "https://$githubRepository"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
isRequired = false
|
||||
sign(publishing.publications)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention")
|
||||
}
|
||||
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
// Repositories live in the settings only, a project or plugin declaring its own fails the build
|
||||
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://maven.florianreuth.de/releases")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package de.florianreuth.baseproject
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.ListProperty
|
||||
import org.gradle.api.provider.ValueSource
|
||||
import org.gradle.api.provider.ValueSourceParameters
|
||||
import org.gradle.process.ExecOperations
|
||||
import java.io.ByteArrayOutputStream
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* Short hash of the latest commit, or "unknown" if Git is unavailable.
|
||||
*/
|
||||
fun Project.latestCommitHash(): String = runGitCommand(listOf("rev-parse", "--short", "HEAD"))
|
||||
|
||||
/**
|
||||
* Message of the latest commit, or "unknown" if Git is unavailable.
|
||||
*/
|
||||
fun Project.latestCommitMessage(): String = runGitCommand(listOf("log", "-1", "--pretty=%B"))
|
||||
|
||||
/**
|
||||
* Name of the current branch, or "unknown" if Git is unavailable.
|
||||
*/
|
||||
fun Project.branchName(): String = runGitCommand(listOf("rev-parse", "--abbrev-ref", "HEAD"))
|
||||
|
||||
/**
|
||||
* Runs a Git command through a configuration-cache compatible [ValueSource].
|
||||
*
|
||||
* @param args the arguments passed to `git`
|
||||
* @return the trimmed output, or "unknown" if the command fails or prints nothing
|
||||
*/
|
||||
fun Project.runGitCommand(args: List<String>): String {
|
||||
return providers.of(GitCommand::class.java) { parameters.args.set(args) }.getOrNull() ?: "unknown"
|
||||
}
|
||||
|
||||
abstract class GitCommand : ValueSource<String, GitCommand.GitCommandParameters> {
|
||||
|
||||
@get:Inject
|
||||
abstract val execOperations: ExecOperations
|
||||
|
||||
interface GitCommandParameters : ValueSourceParameters {
|
||||
val args: ListProperty<String>
|
||||
}
|
||||
|
||||
override fun obtain(): String? {
|
||||
try {
|
||||
val output = ByteArrayOutputStream()
|
||||
execOperations.exec {
|
||||
commandLine = listOf("git") + parameters.args.get()
|
||||
standardOutput = output
|
||||
isIgnoreExitValue = true
|
||||
}
|
||||
|
||||
return output.toString(Charsets.UTF_8).trim().takeIf { it.isNotBlank() }
|
||||
} catch (_: Exception) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* This file is part of BaseProject - https://github.com/florianreuth/BaseProject
|
||||
* Copyright (C) 2024-2026 Florian Reuth <git@florianreuth.de>
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
package de.florianreuth.baseproject
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.initialization.Settings
|
||||
|
||||
/**
|
||||
* Includes `<rootProject.name>-<name>` for every name, located in the `<name>` folder.
|
||||
*
|
||||
* @param names the subproject folder names
|
||||
*/
|
||||
fun Settings.setupViaSubprojects(vararg names: String) {
|
||||
names.forEach { name ->
|
||||
include("${rootProject.name}-$name")
|
||||
project(":${rootProject.name}-$name").projectDir = settingsDir.resolve(name)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Version, channel and changelog of a Modrinth / Hangar upload of a ViaVersion project.
|
||||
*
|
||||
* @property isRelease whether the project version has no pre-release suffix
|
||||
* @property isMainBranch whether the current Git branch is the main branch
|
||||
* @property version the project version, suffixed with the GitHub run number for non-releases
|
||||
* @property changelog a link to the GitHub releases for releases, otherwise [commitChangelog]
|
||||
* @property commitChangelog a link to and the message of the latest commit
|
||||
*/
|
||||
class ViaRelease(
|
||||
val isRelease: Boolean,
|
||||
val isMainBranch: Boolean,
|
||||
val version: String,
|
||||
val changelog: String,
|
||||
val commitChangelog: String
|
||||
) {
|
||||
val modrinthVersionType: String
|
||||
get() = if (isRelease) "release" else if (isMainBranch) "beta" else "alpha"
|
||||
|
||||
val hangarChannel: String
|
||||
get() = if (isRelease) "Release" else if (isMainBranch) "Snapshot" else "Alpha"
|
||||
}
|
||||
|
||||
/**
|
||||
* Collects the release information from the project version and Git; the repository is `ViaVersion/<project_name>`.
|
||||
*
|
||||
* @param mainBranch the name of the branch releases are published from
|
||||
* @return the release information of the current build
|
||||
*/
|
||||
fun Project.viaRelease(mainBranch: String): ViaRelease {
|
||||
val baseVersion = version.toString()
|
||||
val isRelease = !baseVersion.contains('-')
|
||||
val repository = "https://github.com/ViaVersion/${property("project_name")}"
|
||||
val commitHash = latestCommitHash()
|
||||
val commitChangelog = "[$commitHash]($repository/commit/$commitHash) ${latestCommitMessage()}"
|
||||
|
||||
return ViaRelease(
|
||||
isRelease = isRelease,
|
||||
isMainBranch = branchName() == mainBranch,
|
||||
version = if (isRelease) baseVersion else baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER"),
|
||||
changelog = if (isRelease) "See [GitHub]($repository) for release notes." else commitChangelog,
|
||||
commitChangelog = commitChangelog
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
plugins {
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "Via"
|
||||
url = uri("https://repo.viaversion.com/")
|
||||
credentials {
|
||||
username = findProperty("ViaUsername") as String?
|
||||
password = findProperty("ViaPassword") as String?
|
||||
}
|
||||
authentication {
|
||||
create<BasicAuthentication>("basic")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
id("publishing.viaversion")
|
||||
}
|
||||
|
||||
// base.maven_publish reads these when applied, so it is applied only after they are set
|
||||
extra["publish_github_account"] = "ViaVersion"
|
||||
extra["publish_license"] = "GPL-3.0"
|
||||
apply(plugin = "base.maven_publish")
|
||||
+10
-28
@@ -1,27 +1,15 @@
|
||||
import de.florianmichael.baseproject.*
|
||||
import de.florianreuth.baseproject.viaRelease
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
id("io.papermc.hangar-publish-plugin")
|
||||
id("de.florianmichael.baseproject.BaseProject")
|
||||
alias(libs.plugins.hangar.publish)
|
||||
id("base.java")
|
||||
id("via.maven_publish")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://repo.viaversion.com")
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven("https://repo.maven.apache.org/maven2/")
|
||||
}
|
||||
|
||||
setupProject()
|
||||
setupViaPublishing()
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.viaversion:viaversion-api:4.10.0")
|
||||
compileOnly("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set("ViaRewind-Legacy-Support")
|
||||
compileOnly(libs.viaversion.api)
|
||||
compileOnly(libs.spigot.api)
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -34,19 +22,13 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
val branch = branchName()
|
||||
val baseVersion = version as String
|
||||
val isRelease = !baseVersion.contains('-')
|
||||
val suffixedVersion = if (isRelease) baseVersion else baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER")
|
||||
val commitHash = latestCommitHash()
|
||||
val changelogContent = "[${commitHash}](https://github.com/ViaVersion/iaRewind-Legacy-Support/commit/${commitHash}) ${latestCommitMessage()}"
|
||||
val isMainBranch = branch == "master"
|
||||
val release = viaRelease("master")
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set(suffixedVersion)
|
||||
version.set(release.version)
|
||||
id.set("ViaRewindLegacySupport")
|
||||
channel.set(if (isRelease) "Release" else if (isMainBranch) "Snapshot" else "Alpha")
|
||||
changelog.set(changelogContent)
|
||||
channel.set(release.hangarChannel)
|
||||
changelog.set(release.commitChangelog)
|
||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||
platforms {
|
||||
paper {
|
||||
|
||||
+7
-6
@@ -4,15 +4,16 @@ org.gradle.parallel=true
|
||||
org.gradle.configuration-cache=true
|
||||
|
||||
# Project Details
|
||||
project_jvm_version=8
|
||||
jvm_version=17
|
||||
|
||||
project_group=com.viaversion
|
||||
project_version=1.5.4
|
||||
project_name=ViaRewind-Legacy-Support
|
||||
project_version=1.5.5-SNAPSHOT
|
||||
project_description=Provides additional features for ViaRewind for Paper servers.
|
||||
|
||||
publishing_dev_id=FlorianMichael
|
||||
publishing_dev_name=EnZaXD
|
||||
publishing_dev_mail=florian.michael07@gmail.com
|
||||
publish_owner_id=florianreuth
|
||||
publish_owner_name=Florian Reuth
|
||||
publish_owner_mail=git@florianreuth.de
|
||||
|
||||
# Hangar Publishing
|
||||
minecraft_version_range=1.8-1.21.11
|
||||
minecraft_version_range=1.8-26.3
|
||||
@@ -0,0 +1,7 @@
|
||||
[libraries]
|
||||
foojay-resolver-convention-plugin = { module = "org.gradle.toolchains.foojay-resolver-convention:org.gradle.toolchains.foojay-resolver-convention.gradle.plugin", version = "1.0.0" }
|
||||
viaversion-api = { module = "com.viaversion:viaversion-api", version = "5.10.0" }
|
||||
spigot-api = { module = "org.spigotmc:spigot-api", version = "1.16.5-R0.1-SNAPSHOT" }
|
||||
|
||||
[plugins]
|
||||
hangar-publish = { id = "io.papermc.hangar-publish-plugin", version = "0.1.4" }
|
||||
Vendored
BIN
Binary file not shown.
+2
-2
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=df67a32e86e3276d011735facb1535f64d0d88df84fa87521e90becc2d735444
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
||||
distributionSha256Sum=21bd5da2de49b642904077f38c0efdc7778e92b3ed0889392dca61b97e389607
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/.
|
||||
|
||||
Vendored
+112
-93
@@ -1,93 +1,112 @@
|
||||
@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
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@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=.
|
||||
@rem This is normally unused
|
||||
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% equ 0 goto execute
|
||||
|
||||
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
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 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!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@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
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
@rem Catch executions from older scripts and ensure they exit cleanly.
|
||||
@rem This can be removed once we can be reasonably confident that few people
|
||||
@rem will be migrating directly to this new wrapper.
|
||||
goto afterSafetyNet
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
goto exitWithErrorLevel
|
||||
:afterSafetyNet
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
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% equ 0 goto execute
|
||||
|
||||
1>&2 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.
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto exitWithErrorLevel
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
1>&2 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.
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto exitWithErrorLevel
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel
|
||||
|
||||
@rem This label must not be changed. We rely on old scripts being able to jump to this point.
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
+9
-10
@@ -1,17 +1,16 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("de.florianmichael.baseproject.BaseProject") version "1.1.1"
|
||||
id("io.papermc.hangar-publish-plugin") version "0.1.3"
|
||||
}
|
||||
includeBuild("build-logic")
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
id("base.settings")
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven("https://repo.viaversion.com")
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "viarewind-legacy-support"
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+11
-7
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package com.viaversion.viarewind.legacysupport.feature;
|
||||
|
||||
import com.viaversion.viarewind.legacysupport.util.NMSUtil;
|
||||
import com.viaversion.viarewind.legacysupport.util.ReflectionUtil;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import java.lang.reflect.Constructor;
|
||||
@@ -37,7 +38,9 @@ public class BlockCollisionChanges {
|
||||
|
||||
public static void fixLilyPad(final Logger logger, final ProtocolVersion serverVersion) {
|
||||
try {
|
||||
final Field boundingBoxField = getFieldAccessible(getNMSBlockClass("BlockWaterLily"), serverVersion.olderThanOrEqualTo(ProtocolVersion.v1_20_2) ? "a" : "b");
|
||||
final String BlockWaterLilyClassName = NMSUtil.NEWER_THAN_V26_1 ? "LilyPadBlock" : "BlockWaterLily";
|
||||
final String boundingBoxFieldName = NMSUtil.NEWER_THAN_V26_1 ? "SHAPE" : serverVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_3) ? "b" : "a";
|
||||
final Field boundingBoxField = getFieldAccessible(getNMSBlockClass(BlockWaterLilyClassName), boundingBoxFieldName);
|
||||
|
||||
setBoundingBox(boundingBoxField.get(null), 0.0625, 0.0, 0.0625, 0.9375, 0.015625, 0.9375);
|
||||
} catch (Exception ex) {
|
||||
@@ -47,9 +50,10 @@ public class BlockCollisionChanges {
|
||||
|
||||
public static void fixCarpet(final Logger logger, final ProtocolVersion serverVersion) {
|
||||
try {
|
||||
final Class<?> blockCarpetClass = serverVersion.olderThanOrEqualTo(ProtocolVersion.v1_16_4) ? getNMSBlockClass("BlockCarpet") : getNMSBlockClass("CarpetBlock");
|
||||
final String boundingBoxFieldName = NMSUtil.NEWER_THAN_V26_1 ? "SHAPE" : serverVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_3) ? "b" : "a";
|
||||
final String blockCarpetClassName = serverVersion.newerThanOrEqualTo(ProtocolVersion.v1_17) ? "CarpetBlock" : "BlockCarpet";
|
||||
final Field boundingBoxField = getFieldAccessible(getNMSBlockClass(blockCarpetClassName), boundingBoxFieldName);
|
||||
|
||||
final Field boundingBoxField = getFieldAccessible(blockCarpetClass, serverVersion.olderThanOrEqualTo(ProtocolVersion.v1_20_2) ? "a" : "b");
|
||||
setBoundingBox(boundingBoxField.get(0), 0.0D, -0.0000001D, 0.0D, 1.0D, 0.0000001D, 1.0D);
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Could not fix carpet bounding box.", ex);
|
||||
@@ -59,9 +63,9 @@ public class BlockCollisionChanges {
|
||||
public static void fixLadder(final Logger logger, final ProtocolVersion serverVersion) {
|
||||
try {
|
||||
if (serverVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_5)) {
|
||||
final Class<?> blockLadderClass = getNMSBlockClass("BlockLadder");
|
||||
final Class<?> blockLadderClass = getNMSBlockClass(NMSUtil.NEWER_THAN_V26_1 ? "LadderBlock" : "BlockLadder");
|
||||
|
||||
final Map<String, double[]> overrides = new HashMap<String, double[]>();
|
||||
final Map<String, double[]> overrides = new HashMap<>();
|
||||
overrides.put("EAST", new double[]{0.0D, 0.0D, 0.0D, 0.125D, 1.0D, 1.0D});
|
||||
overrides.put("WEST", new double[]{0.875D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D});
|
||||
overrides.put("SOUTH", new double[]{0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D});
|
||||
@@ -187,7 +191,7 @@ public class BlockCollisionChanges {
|
||||
// Handle Paper voxel shape caching by clearing the cache
|
||||
final Class<?> voxelShape = voxelShapeArray.getClass().getSuperclass();
|
||||
|
||||
final Field shape = getFieldAccessible(voxelShape, "a");
|
||||
final Field shape = getFieldAccessible(voxelShape, NMSUtil.NEWER_THAN_V26_1 ? "shape" : "a");
|
||||
final Field cachedShapeData = getFieldAccessible(shape.getType(), "cachedShapeData");
|
||||
if (cachedShapeData == null) { // No Paper or too old version
|
||||
return;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,7 +41,7 @@ public class ElytraVelocityEmulator implements Listener {
|
||||
if (nmsPlayer == null) return false;
|
||||
|
||||
try {
|
||||
final Method getFlag = ReflectionUtil.getMethod(nmsPlayer.getClass(), "getFlag", int.class);
|
||||
final Method getFlag = ReflectionUtil.findMethod(nmsPlayer.getClass(), new String[]{"getSharedFlag", "getFlag"}, int.class);
|
||||
return (boolean) getFlag.invoke(nmsPlayer, 7);
|
||||
} catch (Exception e) {
|
||||
BukkitPlugin.getInstance().getLogger().log(Level.SEVERE, "Failed to get player flag", e);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,7 +30,9 @@ import static com.viaversion.viarewind.legacysupport.util.ReflectionUtil.failSaf
|
||||
|
||||
public class NMSUtil {
|
||||
|
||||
public static final boolean NEWER_THAN_V26_1 = BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v26_1);
|
||||
public static final boolean NEWER_THAN_V1_20_5 = BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_20_5);
|
||||
public static final boolean NEWER_THAN_V1_17 = BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17);
|
||||
public static String nmsVersionPackage;
|
||||
private static Field playerConnectionField;
|
||||
|
||||
@@ -41,7 +43,9 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class<?> getBlockPositionClass() {
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V26_1) {
|
||||
return failSafeGetClass("net.minecraft.core.BlockPos");
|
||||
} else if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.core.BlockPosition");
|
||||
} else {
|
||||
return getLegacyNMSClass("BlockPosition");
|
||||
@@ -49,7 +53,7 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class<?> getNMSBlockClass(final String name) {
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.world.level.block." + name);
|
||||
} else {
|
||||
return getLegacyNMSClass(name);
|
||||
@@ -57,7 +61,9 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class getSoundCategoryClass() { // Bypass generics
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V26_1) {
|
||||
return failSafeGetClass("net.minecraft.sounds.SoundSource");
|
||||
} else if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.sounds.SoundCategory");
|
||||
} else {
|
||||
return getLegacyNMSClass("SoundCategory");
|
||||
@@ -65,7 +71,7 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class<?> getPacketClass() {
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.network.protocol.Packet");
|
||||
} else {
|
||||
return getLegacyNMSClass("Packet");
|
||||
@@ -73,7 +79,7 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class<?> getGamePacketClass(final String packet) {
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.network.protocol.game." + packet);
|
||||
} else {
|
||||
return getLegacyNMSClass(packet);
|
||||
@@ -81,7 +87,9 @@ public class NMSUtil {
|
||||
}
|
||||
|
||||
public static Class<?> getPlayerConnectionClass() {
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().newerThanOrEqualTo(ProtocolVersion.v1_17)) {
|
||||
if (NEWER_THAN_V26_1) {
|
||||
return failSafeGetClass("net.minecraft.server.network.ServerGamePacketListenerImpl");
|
||||
} else if (NEWER_THAN_V1_17) {
|
||||
return failSafeGetClass("net.minecraft.server.network.PlayerConnection");
|
||||
} else {
|
||||
return getLegacyNMSClass("PlayerConnection");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
* Copyright (C) 2018-2025 ViaVersion and contributors
|
||||
* Copyright (C) 2018-2026 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,7 @@ description: ${description}
|
||||
main: com.viaversion.viarewind.legacysupport.BukkitPlugin
|
||||
api-version: 1.13
|
||||
|
||||
authors: [FlorianMichael/EnZaXD, Gerrygames]
|
||||
authors: [EnZaXD, Gerrygames]
|
||||
website: https://github.com/ViaVersion/ViaRewind-Legacy-Support
|
||||
|
||||
depend: [ViaRewind]
|
||||
Reference in new issue
Block a user