Skip to content

Commit

Permalink
Merge pull request #7 from Edenor-Minecraft/1.21.4-hard-fork
Browse files Browse the repository at this point in the history
Implement Hard Fork
  • Loading branch information
AltronMaxX authored Jan 16, 2025
2 parents 98e1d0d + 5ecb0f3 commit cfce88f
Show file tree
Hide file tree
Showing 169 changed files with 4,818 additions and 7,101 deletions.
6 changes: 0 additions & 6 deletions .editorconfig

This file was deleted.

14 changes: 9 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
* text=auto
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

*.sh text eol=lf
gradlew text eol=lf
*.bat text eol=crlf
# These are Windows script files and should use crlf
*.bat text eol=crlf

*.jar binary
# Binary files should be left untouched
*.jar binary
14 changes: 4 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,24 @@ jobs:
- name: Checkout Git Repository
uses: actions/checkout@v4

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Configure Git User Details
run: |
git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"
- name: Apply Patches
run: ./gradlew applyPatches
run: ./gradlew applyAllPatches

- name: Build MojmapPaperclip
run: ./gradlew createMojmapPaperclipJar

- name: Build ReobfPaperclip
run: ./gradlew createReobfPaperclipJar

- name: Make release
uses: marvinpinto/action-automatic-releases@master
Expand Down
67 changes: 15 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
.gradle/
build/
# Ignore Gradle project-specific cache directory
.gradle

# Eclipse stuff
.classpath
.project
.settings/
# Ignore Gradle build output directory
build

# VSCode stuff
.vscode/
/run

# netbeans
nbproject/
nbactions.xml
/folia-server/build.gradle.kts
/folia-server/src/minecraft
/foldenor-server/build.gradle.kts
/foldenor-server/src/minecraft
/paper-server
/folia-api/build.gradle.kts
/foldenor-api/build.gradle.kts
/paper-api
/paper-api-generator

# we use maven!
build.xml

# maven
target/
dependency-reduced-pom.xml

# vim
.*.sw[a-p]

# various other potential build files
build/
bin/
dist/
manifest.mf

# Mac filesystem dust
.DS_Store/
.DS_Store

# intellij
*.iml
*.ipr
*.iws
.idea/
out/

# Linux temp files
*~

# other stuff
run/

Folia-Server
Folia-API

!gradle/wrapper/gradle-wrapper.jar
Foldenor-Server/
Foldenor-API/
.патчи
/paper-api-generator/
.idea/
6 changes: 5 additions & 1 deletion build-data/dev-imports.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
# datafixerupper com/mojang/datafixers/util/Either.java
# 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
# 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
#
18 changes: 0 additions & 18 deletions build-data/reobf-mappings-patch.tiny
Original file line number Diff line number Diff line change
@@ -1,18 +0,0 @@
# We would like for paperweight to generate 100% perfect reobf mappings (and deobf mappings for that matter).
# But unfortunately it's not quite there yet - and it may be some time before that happens. Generating perfect mappings
# from Spigot's mappings is extremely difficult due to Spigot's bad tooling and bad mappings. To add insult to injury
# we remap Spigot's _source code_ which is a lot more complex and error-prone than bytecode remapping. So with all that
# said, this file exists to help fill in the gap.
#
# We will continue to improve paperweight and will work on fixing these issues so they don't come up in the first place,
# but these mappings exist to prevent these issues from holding everything else in Paper up while we work through all
# of these issues. Due to the complex nature of mappings generation and the debugging difficulty involved it may take
# a significant amount of time for us to track down every possible issue, so this file will likely be around and in
# use - at least in some capacity - for a long time.
#
# If you are adding mappings patches which are correcting for issues in paperweight's reobf mappings generation,
# unrelated to any changes in your patches, we ask that you PR the mapping to Paper so more users can benefit rather
# than keep the fix for your own fork. If the mappings patch is there to correct reobf for changes made in your patches,
# then obviously it doesn't make any sense to PR them upstream.

tiny 2 0 mojang+yarn spigot
144 changes: 78 additions & 66 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,99 +1,111 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import io.papermc.paperweight.tasks.RebuildGitPatches

plugins {
java
`maven-publish`
id("io.papermc.paperweight.patcher") version "1.7.7"
java // TODO java launcher tasks
id("io.papermc.paperweight.patcher") version "2.0.0-beta.13"
}

val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"

repositories {
mavenCentral()
maven(paperMavenPublicUrl) {
content { onlyForConfigurations(configurations.paperclip.name) }
paperweight {
upstreams.register("Folia") {
repo = github("PaperMC", "Folia")
ref = providers.gradleProperty("foliaRef")

patchFile {
path = "folia-server/build.gradle.kts"
outputFile = file("foldenor-server/build.gradle.kts")
patchFile = file("foldenor-server/build.gradle.kts.patch")
}
patchFile {
path = "folia-api/build.gradle.kts"
outputFile = file("foldenor-api/build.gradle.kts")
patchFile = file("foldenor-api/build.gradle.kts.patch")
}
patchRepo("paperApi") {
upstreamPath = "paper-api"
patchesDir = file("foldenor-api/paper-patches")
outputDir = file("paper-api")
}
patchRepo("paperApiGenerator") {
upstreamPath = "paper-api-generator"
patchesDir = file("foldenor-api-generator/paper-patches")
outputDir = file("paper-api-generator")
}
patchDir("foliaApi") {
upstreamPath = "folia-api"
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
patchesDir = file("foldenor-api/fork-patches")
outputDir = file("folia-api")
}
}
maven("https://maven.nostal.ink/repository/maven-snapshots/")
}

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")
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"

subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
languageVersion = JavaLanguageVersion.of(21)
}
}

/*publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/Edenor-Minecraft/Foldenor")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
publications.register<MavenPublication>("gpr") {
from(components["java"])
}
}
}*/
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
}

subprojects {
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
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()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}

repositories {
mavenCentral()
maven(paperMavenPublicUrl)
extensions.configure<PublishingExtension> {
repositories {
/*
maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "paperSnapshots"
credentials(PasswordCredentials::class)
}
*/
}
}
}

paperweight {
serverProject.set(project(":foldenor-server"))

remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)

useStandardUpstream("Folia") {
url.set(github("PaperMC", "Folia"))
ref.set(providers.gradleProperty("foliaRef"))

withStandardPatcher {
apiSourceDirPath.set("folia-api")
serverSourceDirPath.set("folia-server")

apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Foldenor-api"))
tasks.withType<RebuildGitPatches> {
filterPatches.set(false)
}

serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Foldenor-server"))
}
tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
}
}

patchTasks.register("generatedApi") {
isBareDirectory = true
upstreamDirPath = "paper-api-generator/generated"
patchDir = layout.projectDirectory.dir("patches/generatedApi")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}
tasks.register("printPaperVersion") {
doLast {
println(project.version)
}
}
24 changes: 24 additions & 0 deletions foldenor-api/build.gradle.kts.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- a/folia-api/build.gradle.kts
+++ b/folia-api/build.gradle.kts
@@ -104,17 +_,21 @@
java {
srcDir(generatedApiPath)
srcDir(file("../paper-api/src/main/java"))
+ srcDir(file("../folia-api/src/main/java"))
}
resources {
srcDir(file("../paper-api/src/main/resources"))
+ srcDir(file("../folia-api/src/main/resources"))
}
}
test {
java {
srcDir(file("../paper-api/src/test/java"))
+ srcDir(file("../folia-api/src/test/java"))
}
resources {
srcDir(file("../paper-api/src/test/resources"))
+ srcDir(file("../folia-api/src/test/resources"))
}
}
}
Loading

0 comments on commit cfce88f

Please sign in to comment.