9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00

Start 1.21.11

This commit is contained in:
Lumine1909
2025-12-18 13:02:08 +08:00
parent d3a2173978
commit 1f600a02e7
268 changed files with 499 additions and 398 deletions

View File

@@ -14,7 +14,7 @@ subprojects {
extensions.configure<JavaPluginExtension> { extensions.configure<JavaPluginExtension> {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(21) languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM //vendor = JvmVendorSpec.ADOPTIUM
} }
} }

View File

@@ -1,10 +1,13 @@
group=org.leavesmc.leaves group=org.leavesmc.leaves
version=1.21.10-R0.1-SNAPSHOT version=1.21.11-R0.1-SNAPSHOT
mcVersion=1.21.10 mcVersion=1.21.11
paperRef=af06383701d3c02e3e3cbd2ef5c5b55e2bbd0742 paperRef=1f94f1f7af8204ec7bbd94f7b0c1a8ba5fcf5ba8
preVersion=true preVersion=true
paper.runDisableWatchdog=true paper.runDisableWatchdog=true
# Set to true while updating Minecraft version
updatingMinecraft=true
org.gradle.configuration-cache=false org.gradle.configuration-cache=false
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@@ -1,6 +1,6 @@
--- a/paper-api/build.gradle.kts --- a/paper-api/build.gradle.kts
+++ b/paper-api/build.gradle.kts +++ b/paper-api/build.gradle.kts
@@ -89,19 +_,33 @@ @@ -91,19 +_,33 @@
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")
} }
@@ -35,7 +35,7 @@
val outgoingVariants = arrayOf("runtimeElements", "apiElements", "sourcesElements", "javadocElements") val outgoingVariants = arrayOf("runtimeElements", "apiElements", "sourcesElements", "javadocElements")
val mainCapability = "${project.group}:${project.name}:${project.version}" val mainCapability = "${project.group}:${project.name}:${project.version}"
@@ -146,6 +_,16 @@ @@ -138,6 +_,16 @@
} }
} }
@@ -49,10 +49,10 @@
+} +}
+// Leaves end - hide irrelevant compilation warnings +// Leaves end - hide irrelevant compilation warnings
+ +
tasks.jar { abstract class GenerateApiVersioningFile : DefaultTask() {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) { @get:OutputFile
into("META-INF/maven/${project.group}/${project.name}") abstract val outputFile: RegularFileProperty
@@ -165,7 +_,7 @@ @@ -183,7 +_,7 @@
tasks.withType<Javadoc>().configureEach { tasks.withType<Javadoc>().configureEach {
val options = options as StandardJavadocDocletOptions val options = options as StandardJavadocDocletOptions
@@ -61,7 +61,7 @@
options.use() options.use()
options.isDocFilesSubDirs = true options.isDocFilesSubDirs = true
options.links( options.links(
@@ -198,16 +_,18 @@ @@ -216,16 +_,18 @@
} }
// workaround for https://github.com/gradle/gradle/issues/4046 // workaround for https://github.com/gradle/gradle/issues/4046

View File

@@ -0,0 +1,84 @@
--- a/paper-api/build.gradle.kts
+++ b/paper-api/build.gradle.kts
@@ -91,19 +_,33 @@
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath() // Leaves - build change
idea {
module {
generatedSourceDirs.add(generatedDir.toFile())
}
}
+// Leaves start - build change
sourceSets {
main {
java {
srcDir(generatedDir)
+ srcDir(file("../paper-api/src/main/java"))
+ }
+ resources {
+ srcDir(file("../paper-api/src/main/resources"))
+ }
+ }
+ test {
+ java {
+ srcDir(file("../paper-api/src/test/java"))
+ }
+ resources {
+ srcDir(file("../paper-api/src/test/resources"))
}
}
}
+// Leaves end - build change
val outgoingVariants = arrayOf("runtimeElements", "apiElements", "sourcesElements", "javadocElements")
val mainCapability = "${project.group}:${project.name}:${project.version}"
@@ -152,6 +_,16 @@
}
}
+// Leaves start - hide irrelevant compilation warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
+ compilerArgs.add("-Xlint:-removal")
+ compilerArgs.add("-Xlint:-dep-ann")
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // Leaves - SIMD support
+}
+// Leaves end - hide irrelevant compilation warnings
+
abstract class GenerateApiVersioningFile : DefaultTask() {
@get:OutputFile
abstract val outputFile: RegularFileProperty
@@ -165,7 +_,7 @@
tasks.withType<Javadoc>().configureEach {
val options = options as StandardJavadocDocletOptions
- options.overview = "src/main/javadoc/overview.html"
+ options.overview = "../paper-api/src/main/javadoc/overview.html" // Leaves - build change
options.use()
options.isDocFilesSubDirs = true
options.links(
@@ -198,16 +_,18 @@
}
// workaround for https://github.com/gradle/gradle/issues/4046
- inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
+ inputs.dir("../paper-api/src/main/javadoc").withPropertyName("javadoc-sourceset") // Leaves - build change
val fsOps = services.fileSystemOperations
doLast {
fsOps.copy {
- from("src/main/javadoc") {
+ from("../paper-api/src/main/javadoc") { // Leaves - build change
include("**/doc-files/**")
}
into("build/docs/javadoc")
}
}
+ options.addStringOption("Xdoclint:none", "-quiet") // Leaves - hide irrelevant compilation warnings
+ options.addStringOption("-add-modules", "jdk.incubator.vector") // Leaves - SIMD support
}
tasks.test {

View File

@@ -5,12 +5,12 @@
import io.papermc.paperweight.attribute.DevBundleOutput import io.papermc.paperweight.attribute.DevBundleOutput
import io.papermc.paperweight.util.* import io.papermc.paperweight.util.*
import java.time.Instant import java.time.Instant
@@ -7,22 +_,34 @@ @@ -7,21 +_,33 @@
`java-library` `java-library`
`maven-publish` `maven-publish`
idea idea
- id("io.papermc.paperweight.core") - id("io.papermc.paperweight.core")
- id("io.papermc.fill.gradle") version "1.0.9" - id("io.papermc.fill.gradle") version "1.0.10"
+ id("org.leavesmc.leavesweight.core") // Leaves - build change + id("org.leavesmc.leavesweight.core") // Leaves - build change
} }
@@ -18,10 +18,9 @@
+val leavesMavenPublicUrl = "https://repo.leavesmc.com/snapshots/" // Leaves - build change +val leavesMavenPublicUrl = "https://repo.leavesmc.com/snapshots/" // Leaves - build change
dependencies { dependencies {
mache("io.papermc:mache:1.21.10+build.9") mache("io.papermc:mache:1.21.11+build.1")
- paperclip("io.papermc:paperclip:3.0.3") - paperclip("io.papermc:paperclip:3.0.3")
+ leavesclip("org.leavesmc:leavesclip:3.0.8") // Leaves - build change + leavesclip("org.leavesmc:leavesclip:3.0.10") // Leaves - build change
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
} }
paperweight { paperweight {
@@ -42,9 +41,20 @@
+ // Leaves end - build change + // Leaves end - build change
+ +
spigot { spigot {
enabled = true enabled = false
buildDataRef = "42d18d4c4653ffc549778dbe223f6994a031d69e" buildDataRef = "42d18d4c4653ffc549778dbe223f6994a031d69e"
@@ -46,6 +_,7 @@ @@ -40,15 +_,18 @@
"org.spigotmc",
)
+ /* Leaves - TEMP
updatingMinecraft {
// oldPaperCommit = "c82b438b5b4ea0b230439b8e690e34708cd11ab3"
}
+ */
}
tasks.generateDevelopmentBundle {
libraryRepositories.addAll( libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/", "https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl, paperMavenPublicUrl,
@@ -85,7 +95,7 @@
+ implementation("commons-lang:commons-lang:2.6") // Leaves - build change + implementation("commons-lang:commons-lang:2.6") // Leaves - build change
+ // Leaves start - linear + // Leaves start - linear
+ implementation("com.github.luben:zstd-jni:1.5.4-1") + implementation("com.github.luben:zstd-jni:1.5.4-1")
+ implementation("org.lz4:lz4-java:1.8.0") + implementation("at.yawk.lz4:lz4-java:1.8.1")
+ implementation("net.openhft:zero-allocation-hashing:0.16") + implementation("net.openhft:zero-allocation-hashing:0.16")
+ // Leaves end - linear + // Leaves end - linear
+ // Leaves start - leaves plugin + // Leaves start - leaves plugin
@@ -105,7 +115,7 @@
runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0") runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0")
runtimeOnly("com.mysql:mysql-connector-j:9.2.0") runtimeOnly("com.mysql:mysql-connector-j:9.2.0")
runtimeOnly("com.lmax:disruptor:3.4.4") runtimeOnly("com.lmax:disruptor:3.4.4")
@@ -185,26 +_,36 @@ @@ -186,26 +_,36 @@
implementation("me.lucko:spark-paper:1.10.152") implementation("me.lucko:spark-paper:1.10.152")
} }
@@ -148,7 +158,7 @@
"Build-Number" to (build ?: ""), "Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(), "Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch, "Git-Branch" to gitBranch,
@@ -263,7 +_,7 @@ @@ -264,7 +_,7 @@
jvmArgumentProviders.add(provider) jvmArgumentProviders.add(provider)
} }
@@ -157,7 +167,7 @@
idea { idea {
module { module {
generatedSourceDirs.add(generatedDir.toFile()) generatedSourceDirs.add(generatedDir.toFile())
@@ -300,6 +_,10 @@ @@ -301,6 +_,10 @@
} }
args("--nogui") args("--nogui")
@@ -168,7 +178,7 @@
systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true) systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") { if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") {
systemProperty("disable.watchdog", true) systemProperty("disable.watchdog", true)
@@ -344,30 +_,26 @@ @@ -345,30 +_,26 @@
classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip }) classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip })
mainClass.set(null as String?) mainClass.set(null as String?)
} }
@@ -189,7 +199,7 @@
- version(paperweight.minecraftVersion) - version(paperweight.minecraftVersion)
- -
- build { - build {
- channel = BuildChannel.STABLE - channel = BuildChannel.ALPHA
- -
- downloads { - downloads {
- register("server:default") { - register("server:default") {

View File

@@ -23,11 +23,11 @@ index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..56fd1ed7ccaf96e7eedea60fbdbf7f93
@Override @Override
public CustomPacketPayload decode(B buffer) { public CustomPacketPayload decode(B buffer) {
ResourceLocation resourceLocation = buffer.readResourceLocation(); Identifier Identifier = buffer.readIdentifier();
- return (CustomPacketPayload)this.findCodec(resourceLocation).decode(buffer); - return (CustomPacketPayload)this.findCodec(Identifier).decode(buffer);
+ // Leaves start - protocol core + // Leaves start - protocol core
+ var payload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(resourceLocation, buffer); + var payload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(Identifier, buffer);
+ return java.util.Objects.requireNonNullElseGet(payload, () -> this.findCodec(resourceLocation).decode(buffer)); + return java.util.Objects.requireNonNullElseGet(payload, () -> this.findCodec(Identifier).decode(buffer));
+ // Leaves end - protocol core + // Leaves end - protocol core
} }
}; };
@@ -74,7 +74,7 @@ index c6db2c96db96453daaf49779f588f75f7c3d3d60..adb26ae4dfd5dc111cc55000b71c15f9
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(org.leavesmc.leaves.protocol.core.ProtocolUtils.createSelector(this), leavesPayload); + org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(org.leavesmc.leaves.protocol.core.ProtocolUtils.createSelector(this), leavesPayload);
+ return; + return;
+ } + }
+ if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.DiscardedPayload(net.minecraft.resources.ResourceLocation id, byte[] data)) { + if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.DiscardedPayload(net.minecraft.resources.Identifier id, byte[] data)) {
+ if (org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleBytebuf(org.leavesmc.leaves.protocol.core.ProtocolUtils.createSelector(this), id, io.netty.buffer.Unpooled.wrappedBuffer(data))) { + if (org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleBytebuf(org.leavesmc.leaves.protocol.core.ProtocolUtils.createSelector(this), id, io.netty.buffer.Unpooled.wrappedBuffer(data))) {
+ return; + return;
+ } + }

View File

@@ -51,7 +51,7 @@ index 8612cdf7161f8ddff60a6478cc901318b8f958ba..07a962d647baa99b0e1bf3898a07cc91
@@ -50,7 +50,7 @@ public class LootTable { @@ -50,7 +50,7 @@ public class LootTable {
public static final LootTable EMPTY = new LootTable(LootContextParamSets.EMPTY, Optional.empty(), List.of(), List.of()); public static final LootTable EMPTY = new LootTable(LootContextParamSets.EMPTY, Optional.empty(), List.of(), List.of());
private final ContextKeySet paramSet; private final ContextKeySet paramSet;
private final Optional<ResourceLocation> randomSequence; private final Optional<Identifier> randomSequence;
- private final List<LootPool> pools; - private final List<LootPool> pools;
+ public final List<LootPool> pools; // Leaves - private -> public + public final List<LootPool> pools; // Leaves - private -> public
private final List<LootItemFunction> functions; private final List<LootItemFunction> functions;

Some files were not shown because too many files have changed in this diff Show More