Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
Pan-cakse committed Nov 5, 2023
1 parent 18f74ff commit 3e9ee08
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ out/
# other stuff
run/

forktest-server
forktest-api
netherite-server
netherite-api

!gradle/wrapper/gradle-wrapper.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ForkTest - A Paper fork, using paperweight
# Netherite - A Paper fork, using paperweight

This is an example project, showcasing how to setup a fork of Paper (or any other fork using paperweight), using paperweight.

Expand Down
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ subprojects {
}

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

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

usePaperUpstream(providers.gradleProperty("paperRef")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("forktest-api"))
apiOutputDir.set(layout.projectDirectory.dir("netherite-api"))

serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("forktest-server"))
serverOutputDir.set(layout.projectDirectory.dir("netherite-server"))
}
}
}
Expand All @@ -75,20 +75,20 @@ paperweight {
//

tasks.generateDevelopmentBundle {
apiCoordinates.set("com.example.paperfork:forktest-api")
apiCoordinates.set("com.example.paperfork:netherite-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.set(
listOf(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'com.example.paperfork:forktest-api')
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'org.netherite.netherite:netherite-api')
)
)
}

allprojects {
// Publishing API:
// ./gradlew :ForkTest-API:publish[ToMavenLocal]
// ./gradlew :Netherite-API:publish[ToMavenLocal]
publishing {
repositories {
maven {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group=com.example.netherite
group=org.netherite.netherite
version=1.20.2-R0.1-SNAPSHOT

mcVersion=1.20.2
Expand Down
16 changes: 8 additions & 8 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..361f8409415a160a1f7030193f9aca95
dependencies {
- implementation(project(":paper-api"))
- implementation(project(":paper-mojangapi"))
+ // ForkTest start
+ implementation(project(":forktest-api"))
+ // Netherite start
+ implementation(project(":netherite-api"))
+ implementation("io.papermc.paper:paper-mojangapi:1.20.2-R0.1-SNAPSHOT") {
+ exclude("io.papermc.paper", "paper-api")
+ }
+ // ForkTest end
+ // Netherite end
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
Expand All @@ -28,7 +28,7 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..361f8409415a160a1f7030193f9aca95
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Paper-$implementationVersion",
+ "Implementation-Version" to "git-ForkTest-$implementationVersion", // ForkTest
+ "Implementation-Version" to "git-Netherite-$implementationVersion", // Netherite
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
Expand All @@ -37,7 +37,7 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..361f8409415a160a1f7030193f9aca95
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
- group = "paper"
+ group = "paperweight" // ForkTest
+ group = "paperweight" // Netherite
mainClass.set("org.bukkit.craftbukkit.Main")
standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory
Expand All @@ -50,7 +50,7 @@ index 97745f0bab8d82d397c6c2a5775aed92bca0a034..b17a72020615e790d8f81c52774cbfa3
@DontObfuscate
public String getServerModName() {
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "ForkTest"; // ForkTest - ForkTest > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Netherite"; // Netherite - Netherite > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}

public SystemReport fillSystemReport(SystemReport details) {
Expand All @@ -63,7 +63,7 @@ index b7e7e6ed60f55d2ab5e4fcefb3638ad1768c3b7f..904c7ce28c54a6628874c0a18ded9bf1

public final class CraftServer implements Server {
- private final String serverName = "Paper"; // Paper
+ private final String serverName = "ForkTest"; // ForkTest // Paper
+ private final String serverName = "Netherite"; // Netherite // Paper
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
Expand All @@ -76,7 +76,7 @@ index 774556a62eb240da42e84db4502e2ed43495be17..21f39bd0c33ef2635249298e6a247afb
String result = "Unknown-Version";

- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties");
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.example.paperfork/forktest-api/pom.properties"); // ForkTest
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.example.paperfork/netherite-api/pom.properties"); // Netherite
Properties properties = new Properties();

if (stream != null) {
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = "forktest"
rootProject.name = "netherite"

include("forktest-api", "forktest-server")
include("netherite-api", "netherite-server")

0 comments on commit 3e9ee08

Please sign in to comment.