mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
prepare hard fork environment
This commit is contained in:
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
* text=auto eol=lf
|
||||
|
||||
*.sh text eol=lf
|
||||
gradlew text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
*.jar binary
|
||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,13 +1,16 @@
|
||||
# DivineMC-API and DivineMC-Server changes + paper-api-generator
|
||||
DivineMC-API
|
||||
DivineMC-Server
|
||||
paper-api-generator/*
|
||||
|
||||
# IDE and Gradle things
|
||||
build
|
||||
.gradle
|
||||
run
|
||||
.idea
|
||||
|
||||
# Other files and folders
|
||||
build-data
|
||||
# Server things
|
||||
/divinemc-server/build.gradle.kts
|
||||
/divinemc-server/src/minecraft
|
||||
/paper-server
|
||||
/purpur-server
|
||||
/divinemc-api/build.gradle.kts
|
||||
/paper-api
|
||||
/paper-api-generator
|
||||
/purpur-api
|
||||
*.jar
|
||||
|
||||
@@ -8,3 +8,7 @@
|
||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
|
||||
# mc_data chat_type/chat.json
|
||||
# mc_data dimension_type/overworld.json
|
||||
#
|
||||
|
||||
2
build-data/divinemc.at
Normal file
2
build-data/divinemc.at
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is auto generated, any changes may be overridden!
|
||||
# See CONTRIBUTING.md on how to add access transformers.
|
||||
139
build.gradle.kts
139
build.gradle.kts
@@ -1,43 +1,65 @@
|
||||
import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("io.papermc.paperweight.patcher") version "1.7.7"
|
||||
id("io.papermc.paperweight.patcher") version "2.0.0-beta.11"
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||
content {
|
||||
onlyForConfigurations(PAPERCLIP_CONFIG)
|
||||
paperweight {
|
||||
upstreams.register("purpur") {
|
||||
repo = github("PurpurMC", "Purpur")
|
||||
ref = providers.gradleProperty("purpurRef")
|
||||
|
||||
patchFile {
|
||||
path = "purpur-server/build.gradle.kts"
|
||||
outputFile = file("divinemc-server/build.gradle.kts")
|
||||
patchFile = file("divinemc-server/build.gradle.kts.patch")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
patchFile {
|
||||
path = "purpur-api/build.gradle.kts"
|
||||
outputFile = file("divinemc-api/build.gradle.kts")
|
||||
patchFile = file("divinemc-api/build.gradle.kts.patch")
|
||||
}
|
||||
patchRepo("paperApi") {
|
||||
upstreamPath = "paper-api"
|
||||
patchesDir = file("divinemc-api/paper-patches")
|
||||
outputDir = file("paper-api")
|
||||
}
|
||||
patchRepo("paperApiGenerator") {
|
||||
upstreamPath = "paper-api-generator"
|
||||
patchesDir = file("divinemc-api-generator/paper-patches")
|
||||
outputDir = file("paper-api-generator")
|
||||
}
|
||||
patchDir("purpurApi") {
|
||||
upstreamPath = "purpur-api"
|
||||
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
|
||||
patchesDir = file("divinemc-api/purpur-patches")
|
||||
outputDir = file("purpur-api")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
extensions.configure<JavaPluginExtension> {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
"testRuntimeOnly"("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(21)
|
||||
options.release = 21
|
||||
options.isFork = true
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
@@ -45,64 +67,29 @@ subprojects {
|
||||
tasks.withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
testLogging {
|
||||
showStackTraces = true
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
events(TestLogEvent.STANDARD_OUT)
|
||||
}
|
||||
}
|
||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(paperMavenPublicUrl)
|
||||
maven("https://oss.sonatype.org/content/groups/public/")
|
||||
maven("https://ci.emc.gs/nexus/content/groups/aikar/")
|
||||
maven("https://repo.aikar.co/content/groups/aikar")
|
||||
maven("https://repo.md-5.net/content/repositories/releases/")
|
||||
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
paperweight {
|
||||
serverProject.set(project(":divinemc-server"))
|
||||
|
||||
remapRepo.set("https://maven.fabricmc.net/")
|
||||
decompileRepo.set(paperMavenPublicUrl)
|
||||
|
||||
useStandardUpstream("purpur") {
|
||||
url.set(github("PurpurMC", "Purpur"))
|
||||
ref.set(providers.gradleProperty("purpurRef"))
|
||||
|
||||
withStandardPatcher {
|
||||
apiSourceDirPath.set("Purpur-API")
|
||||
serverSourceDirPath.set("Purpur-Server")
|
||||
|
||||
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
||||
apiOutputDir.set(layout.projectDirectory.dir("DivineMC-API"))
|
||||
|
||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||
serverOutputDir.set(layout.projectDirectory.dir("DivineMC-Server"))
|
||||
}
|
||||
|
||||
patchTasks.register("generatedApi") {
|
||||
isBareDirectory = true
|
||||
upstreamDirPath = "paper-api-generator/generated"
|
||||
patchDir = layout.projectDirectory.dir("patches/generated-api")
|
||||
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.generateDevelopmentBundle {
|
||||
apiCoordinates = "space.bxteam.divinemc:divinemc-api"
|
||||
libraryRepositories.set(
|
||||
listOf(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
paperMavenPublicUrl
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
publishing {
|
||||
if (project.providers.gradleProperty("publishDevBundle").isPresent) {
|
||||
publications.create<MavenPublication>("devBundle") {
|
||||
artifact(tasks.generateDevelopmentBundle) {
|
||||
artifactId = "dev-bundle"
|
||||
extensions.configure<PublishingExtension> {
|
||||
repositories {
|
||||
maven("https://repo.bx-team.space/snapshots") {
|
||||
name = "divinemc"
|
||||
credentials(PasswordCredentials::class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
divinemc-server/build.gradle.kts.patch
Normal file
11
divinemc-server/build.gradle.kts.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/purpur-server/build.gradle.kts
|
||||
+++ b/purpur-server/build.gradle.kts
|
||||
@@ -146,7 +_,7 @@
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api"))
|
||||
+ implementation(project(":divinemc-api")) // DivineMC
|
||||
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
@@ -2,8 +2,9 @@ group = space.bxteam.divinemc
|
||||
|
||||
mcVersion = 1.21.4
|
||||
version = 1.21.4-R0.1-SNAPSHOT
|
||||
purpurRef = 4bf1b988c3e2cc1277ed912e0107e2f34ab36a43
|
||||
purpurRef = e11f9642928cdce00437b6a11cf3fb1881939d9a
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
org.gradle.vfs.watch = false
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
gradlew
vendored
3
gradlew
vendored
@@ -86,8 +86,7 @@ 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || 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.
|
||||
MAX_FD=maximum
|
||||
|
||||
188
gradlew.bat
vendored
188
gradlew.bat
vendored
@@ -1,94 +1,94 @@
|
||||
@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
|
||||
|
||||
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% 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 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
|
||||
|
||||
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% 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
|
||||
|
||||
@@ -2,15 +2,19 @@ import java.util.Locale
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
mavenLocal()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
||||
}
|
||||
|
||||
rootProject.name = "DivineMC"
|
||||
|
||||
for (name in listOf("DivineMC-API", "DivineMC-Server", "paper-api-generator")) {
|
||||
for (name in listOf("divinemc-api", "divinemc-server", "divinemc-api-generator")) {
|
||||
val projName = name.lowercase(Locale.ENGLISH)
|
||||
include(projName)
|
||||
findProject(":$projName")!!.projectDir = file(name)
|
||||
|
||||
Reference in New Issue
Block a user