9
0
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:
NONPLAYT
2025-01-05 16:22:31 +03:00
parent f3abe2a72d
commit 8b3914edc6
11 changed files with 202 additions and 184 deletions

7
.gitattributes vendored Normal file
View 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
View File

@@ -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

View File

@@ -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
View File

@@ -0,0 +1,2 @@
# This file is auto generated, any changes may be overridden!
# See CONTRIBUTING.md on how to add access transformers.

View File

@@ -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)
}
}
}

View 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+

View File

@@ -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

View File

@@ -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
View File

@@ -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

View File

@@ -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)