Compare commits
21 Commits
old/1.20.2
...
release-97
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e101dff34 | ||
|
|
5c9452f565 | ||
|
|
c71fbc8092 | ||
|
|
6fd3e675e9 | ||
|
|
e15fb5b803 | ||
|
|
d1eaa1d8bb | ||
|
|
70bebc57f5 | ||
|
|
964880bb78 | ||
|
|
cd36bdb168 | ||
|
|
7b99e1fb1f | ||
|
|
cb4e4ad8aa | ||
|
|
03abe3290a | ||
|
|
b0b38d4795 | ||
|
|
9c175e796c | ||
|
|
224476289e | ||
|
|
b8bd312430 | ||
|
|
8441c27926 | ||
|
|
ab0fc1acd0 | ||
|
|
25f409e4e7 | ||
|
|
073a7f2411 | ||
|
|
37d1596da8 |
41
README.md
41
README.md
@@ -1,17 +1,15 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
||||||
|
|
||||||
[](README.md)
|
[](https://discord.gg/MmfC52K8A8)
|
||||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.19.4)
|
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.19.4)
|
||||||
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
||||||
|
|
||||||
[](LICENSE)
|
|
||||||
[](https://discord.gg/MmfC52K8A8)
|
|
||||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.19.4)
|
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.19.4)
|
||||||
|
|
||||||
|
[](LICENSE)
|
||||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.19.4)
|
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.19.4)
|
||||||
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
||||||
[](https://github.com/PPlazmaMC/Plazma/network/members)
|
[](https://github.com/PPlazmaMC/Plazma/network/members)
|
||||||
@@ -19,30 +17,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## ⚠️ Warning
|
[main]: https://github.com/PlazmaMC/Plazma
|
||||||
- Plazma may cause **<u>unexpected problems</u>**, so **don't use** it in production server!
|
|
||||||
|
|
||||||
## 💬 About Plazma...
|
### This is the branch for Plazma 1.19.4. If you want to know more about Plazma, please check the [main branch][main].
|
||||||
- **Plazma** is created from the merger of **[Andromeda](https://github.com/TeamEarendel/Andromeda)** and **[Fusion](https://github.com/RuinedTechnologyUnify/Fusion)**
|
이곳은 플라즈마의 1.19.4용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 [main 브랜치][main]를 확인해주세요.
|
||||||
- Compatible and effective patches from other bukkits and mods
|
|
||||||
- We're always trying to keep it compatible and performance high.
|
|
||||||
|
|
||||||
## ⚙️ Features
|
|
||||||
- **Based on [Paper](https://github.com/PaperMC/Paper)** - Most plugins of Bukkit, Craft Bukkit, Spigot, and Paper are available
|
|
||||||
- **Including [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) and [Purpur](https://github.com/PurpurMC/Purpur)** - Provides multiple optimizations and customizations
|
|
||||||
|
|
||||||
## ⬇️ Downloads
|
## ⬇️ Downloads
|
||||||
- You can download the file from [Releases](https://github.com/PlazmaMC/Plazma/releases)
|
### If you don't know about Mojmap or Bundler, download **Reobf Paperclip**
|
||||||
- Direct latest download: [Click here](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-paperclip-1.19.4-R0.1-SNAPSHOT-reobf.jar)
|
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
|
||||||
- NOTE: If you don't know about Mojmap or Bundler, download `plazma-paperclip-*-reobf.jar`
|
|
||||||
|
|
||||||
## ⚖️ License
|
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|
||||||
- This project and all patches are licensed under the [MIT license](LICENSE.md) unless otherwise noted in the patch headers.
|
| :---: | :---: | :---: | :---: |
|
||||||
|
| [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-paperclip-1.19.4-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-paperclip-1.19.4-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-bundler-1.19.4-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-bundler-1.19.4-R0.1-SNAPSHOT-mojmap.jar) |
|
||||||
## 🌀 Sponsorship - Minecraft Development Dictionary (KOREAN)
|
|
||||||
[](https://discord.gg/AZwXTA9Pgx)
|
|
||||||
- 한글로 번역&정리된 Minecraft와 서드파티 버킷들의 소식들을 빠르게 만나볼 수 있습니다.
|
|
||||||
- Skript와 Plugin등 서버 개발과 관련된 질문에 대한 답변을 받으실 수 있습니다.
|
|
||||||
|
|
||||||
## 📈 bStats
|
|
||||||
[](https://bstats.org/plugin/server-implementation/Plazma/18047)
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
remapper("net.fabricmc:tiny-remapper:0.8.7:fat")
|
||||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
paperclip("io.papermc:paperclip:3.0.3")
|
||||||
}
|
}
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <alphakr93@outlook.com>
|
|
||||||
Date: Thu, 22 Dec 2022 20:29:45 +0900
|
|
||||||
Subject: [PATCH] Bump Bungeecord Chat API to 1.19-R0.1-SNAPSHOT
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index b5835fa536f90b7f88a5ee4df78733cf43e1cb23..42de5c470a2fbb1e0bc9b809c033e3afe30502fa 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -25,7 +25,7 @@ dependencies {
|
|
||||||
// api dependencies are listed transitively to API consumers
|
|
||||||
api("com.google.guava:guava:31.1-jre")
|
|
||||||
api("com.google.code.gson:gson:2.10")
|
|
||||||
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
|
|
||||||
+ api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // Plazma
|
|
||||||
api("org.yaml:snakeyaml:1.33")
|
|
||||||
api("org.joml:joml:1.10.5")
|
|
||||||
// Paper start
|
|
||||||
91
patches/api/0004-Bump-Dependencies.patch
Normal file
91
patches/api/0004-Bump-Dependencies.patch
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 12:40:40 +0900
|
||||||
|
Subject: [PATCH] Bump-Dependencies
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
|
index 417c4324af22c870de669e338a1eee5d540184a4..6cb60894c2363d5c6a71b12008421d49d2c128a0 100644
|
||||||
|
--- a/build.gradle.kts
|
||||||
|
+++ b/build.gradle.kts
|
||||||
|
@@ -8,7 +8,7 @@ java {
|
||||||
|
withJavadocJar()
|
||||||
|
}
|
||||||
|
|
||||||
|
-val adventureVersion = "4.13.1"
|
||||||
|
+val adventureVersion = "4.14.0" // Plazma - Bump Dependencies
|
||||||
|
val apiAndDocs: Configuration by configurations.creating {
|
||||||
|
attributes {
|
||||||
|
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||||
|
@@ -23,16 +23,16 @@ configurations.api {
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// api dependencies are listed transitively to API consumers
|
||||||
|
- api("com.google.guava:guava:31.1-jre")
|
||||||
|
- api("com.google.code.gson:gson:2.10")
|
||||||
|
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
|
||||||
|
- api("org.yaml:snakeyaml:1.33")
|
||||||
|
+ api("com.google.guava:guava:32.1.2-jre") // Plazma - Bump Dependencies
|
||||||
|
+ api("com.google.code.gson:gson:2.10.1") // Plazma - Bump Dependencies
|
||||||
|
+ api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // Plazma - Bump Dependencies
|
||||||
|
+ api("org.yaml:snakeyaml:1.33") // Plazma - Bump Dependencies
|
||||||
|
api("org.joml:joml:1.10.5")
|
||||||
|
// Paper start
|
||||||
|
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||||
|
isTransitive = false // includes junit
|
||||||
|
}
|
||||||
|
- api("it.unimi.dsi:fastutil:8.5.6")
|
||||||
|
+ api("it.unimi.dsi:fastutil:8.5.12") // Plazma - Bump Dependencies
|
||||||
|
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
|
||||||
|
apiAndDocs("net.kyori:adventure-api")
|
||||||
|
apiAndDocs("net.kyori:adventure-text-minimessage")
|
||||||
|
@@ -40,34 +40,34 @@ dependencies {
|
||||||
|
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
|
||||||
|
apiAndDocs("net.kyori:adventure-text-serializer-plain")
|
||||||
|
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||||
|
- api("org.apache.logging.log4j:log4j-api:2.17.1")
|
||||||
|
- api("org.slf4j:slf4j-api:1.8.0-beta4")
|
||||||
|
- api("io.sentry:sentry:5.4.0") // Pufferfish
|
||||||
|
+ api("org.apache.logging.log4j:log4j-api:2.20.0") // Plazma - Bump Dependencies
|
||||||
|
+ api("org.slf4j:slf4j-api:2.0.9") // Plazma - Bump Dependencies
|
||||||
|
+ api("io.sentry:sentry:6.28.0") // Pufferfish // Plazma - Bump Dependencies
|
||||||
|
|
||||||
|
- implementation("org.ow2.asm:asm:9.4")
|
||||||
|
- implementation("org.ow2.asm:asm-commons:9.4")
|
||||||
|
+ implementation("org.ow2.asm:asm:9.5") // Plazma - Bump Dependencies
|
||||||
|
+ implementation("org.ow2.asm:asm-commons:9.5") // Plazma - Bump Dependencies
|
||||||
|
// Paper end
|
||||||
|
|
||||||
|
- api("org.apache.maven:maven-resolver-provider:3.8.5") // Paper, expose
|
||||||
|
- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||||
|
- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||||
|
- compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
|
||||||
|
+ api("org.apache.maven:maven-resolver-provider:3.9.4") // Paper, expose // Plazma - Bump Dependencies
|
||||||
|
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
|
||||||
|
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
|
||||||
|
+ compileOnly("com.google.code.findbugs:jsr305:3.0.2") // Paper // Plazma - Bump Dependencies
|
||||||
|
|
||||||
|
- val annotations = "org.jetbrains:annotations:23.0.0" // Paper - we don't want Java 5 annotations...
|
||||||
|
+ val annotations = "org.jetbrains:annotations:24.0.1" // Paper - we don't want Java 5 annotations... // Plazma - Bump Dependencies
|
||||||
|
compileOnly(annotations)
|
||||||
|
testCompileOnly(annotations)
|
||||||
|
|
||||||
|
// Paper start - add checker
|
||||||
|
- val checkerQual = "org.checkerframework:checker-qual:3.21.0"
|
||||||
|
+ val checkerQual = "org.checkerframework:checker-qual:3.38.0" // Plazma - Bump Dependencies
|
||||||
|
compileOnlyApi(checkerQual)
|
||||||
|
testCompileOnly(checkerQual)
|
||||||
|
// Paper end
|
||||||
|
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - add mockito
|
||||||
|
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - add mockito // Plazma - Bump Dependencies
|
||||||
|
|
||||||
|
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||||
|
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
|
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||||
|
- testImplementation("org.ow2.asm:asm-tree:9.4")
|
||||||
|
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
||||||
|
+ testImplementation("org.ow2.asm:asm-tree:9.5") // Plazma - Bump Dependencies
|
||||||
|
}
|
||||||
|
|
||||||
|
configure<PublishingExtension> {
|
||||||
79
patches/api/0006-Optimize-spigot-event-bus.patch
Normal file
79
patches/api/0006-Optimize-spigot-event-bus.patch
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 15:04:25 +0900
|
||||||
|
Subject: [PATCH] Optimize-spigot-event-bus
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
|
||||||
|
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c01cb205e 100644
|
||||||
|
--- a/src/main/java/org/bukkit/event/Event.java
|
||||||
|
+++ b/src/main/java/org/bukkit/event/Event.java
|
||||||
|
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
|
*/
|
||||||
|
public abstract class Event {
|
||||||
|
private String name;
|
||||||
|
- private final boolean async;
|
||||||
|
+ private final net.kyori.adventure.util.TriState async; // Plazma - Optimize spigot event bus
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default constructor is defined for cleaner code. This constructor
|
||||||
|
@@ -32,9 +32,35 @@ public abstract class Event {
|
||||||
|
* by default from default constructor
|
||||||
|
*/
|
||||||
|
public Event(boolean isAsync) {
|
||||||
|
+ this(net.kyori.adventure.util.TriState.byBoolean(isAsync)); // Plazma - Optimize spigot event bus
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Plazma start - Optimize spigot event bus
|
||||||
|
+ /**
|
||||||
|
+ * This constructor is used to explicitly declare an event as synchronous
|
||||||
|
+ * or asynchronous or potentially unset.
|
||||||
|
+ *
|
||||||
|
+ * @param isAsync true indicates the event will fire asynchronously, false
|
||||||
|
+ * by default from default constructor, unset indicates that the event may be called on either the server thread or off the server
|
||||||
|
+ * thread.
|
||||||
|
+ */
|
||||||
|
+ public Event(@NotNull final net.kyori.adventure.util.TriState isAsync) {
|
||||||
|
this.async = isAsync;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /**
|
||||||
|
+ * Returns a tristate that, when resolving to true or false, has the exact indications defined by {@link #isAsynchronous()}.
|
||||||
|
+ * <p>
|
||||||
|
+ * If the tristate resolves to NOT_SET, the event may or may not have been fired off the main thread, meaning a plugin would have
|
||||||
|
+ * to validate what thread the spigot event bus was called on.
|
||||||
|
+ *
|
||||||
|
+ * @return the tristate enum.
|
||||||
|
+ */
|
||||||
|
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
|
||||||
|
+ return this.async;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
+
|
||||||
|
// Paper start
|
||||||
|
/**
|
||||||
|
* Calls the event and tests if cancelled.
|
||||||
|
@@ -92,7 +118,7 @@ public abstract class Event {
|
||||||
|
* @return false by default, true if the event fires asynchronously
|
||||||
|
*/
|
||||||
|
public final boolean isAsynchronous() {
|
||||||
|
- return async;
|
||||||
|
+ return this.async == net.kyori.adventure.util.TriState.TRUE; // Plazma - Optimize spigot event bus
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Result {
|
||||||
|
diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||||
|
index 3b3d9642a8d63798dc28f2f8df77f0466451cbff..0702e1692f7e671188ac18e22ca29f369b0b6352 100644
|
||||||
|
--- a/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||||
|
+++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||||
|
@@ -62,8 +62,8 @@ public class RegisteredListener {
|
||||||
|
* @throws EventException If an event handler throws an exception.
|
||||||
|
*/
|
||||||
|
public void callEvent(@NotNull final Event event) throws EventException {
|
||||||
|
- if (event instanceof Cancellable) {
|
||||||
|
- if (((Cancellable) event).isCancelled() && isIgnoringCancelled()) {
|
||||||
|
+ if (isIgnoringCancelled()) { // Plazma - Optimize spigot event bus
|
||||||
|
+ if (event instanceof Cancellable cancellable && cancellable.isCancelled()) { // Plazma - Optimize spigot event bus
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -153,7 +153,7 @@ index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52
|
|||||||
stringbuilder.append("// ");
|
stringbuilder.append("// ");
|
||||||
stringbuilder.append(CrashReport.getErrorComment());
|
stringbuilder.append(CrashReport.getErrorComment());
|
||||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||||
index cdbf10339a8e8846a8c364de483a0ccd95cd225a..5ed7acb332b8982a724e5002e12f18fe32dd4dd4 100644
|
index cdbf10339a8e8846a8c364de483a0ccd95cd225a..1a125a0a2bbcc1e3e54746ec97abe24c53f69819 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Main.java
|
--- a/src/main/java/net/minecraft/server/Main.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||||
@@ -81,6 +81,17 @@ public class Main {
|
@@ -81,6 +81,17 @@ public class Main {
|
||||||
@@ -169,7 +169,7 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..5ed7acb332b8982a724e5002e12f18fe
|
|||||||
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
||||||
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛
|
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛
|
||||||
+ """);
|
+ """);
|
||||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so DO NOT USE it on a production server!");
|
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
SharedConstants.tryDetectVersion();
|
SharedConstants.tryDetectVersion();
|
||||||
/* CraftBukkit start - Replace everything
|
/* CraftBukkit start - Replace everything
|
||||||
|
|||||||
84
patches/server/0006-Bump-Dependencies.patch
Normal file
84
patches/server/0006-Bump-Dependencies.patch
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 11:41:06 +0900
|
||||||
|
Subject: [PATCH] Bump-Dependencies
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
|
index 46fda579a95f9ab92a1ba61cad8218024a722208..5f38d64b1bcd9468ebdd6de6ef30580c6cfecadc 100644
|
||||||
|
--- a/build.gradle.kts
|
||||||
|
+++ b/build.gradle.kts
|
||||||
|
@@ -10,7 +10,7 @@ dependencies {
|
||||||
|
implementation(project(":plazma-api")) // Purpur
|
||||||
|
implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur
|
||||||
|
// Paper start
|
||||||
|
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
|
+ implementation("org.jline:jline-terminal-jansi:3.23.0") // Plazma - Bump Dependencies
|
||||||
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
|
/*
|
||||||
|
Required to add the missing Log4j2Plugins.dat file from log4j-core
|
||||||
|
@@ -18,22 +18,22 @@ dependencies {
|
||||||
|
all its classes to check if they are plugins.
|
||||||
|
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||||
|
*/
|
||||||
|
- implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
|
||||||
|
- annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
|
||||||
|
- implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol
|
||||||
|
+ implementation("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - implementation // Plazma - Bump Dependencies
|
||||||
|
+ annotationProcessor("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - Needed to generate meta for our Log4j plugins // Plazma - Bump Dependencies
|
||||||
|
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol // Plazma - Bump Dependencies
|
||||||
|
// Paper end
|
||||||
|
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||||
|
- implementation("org.ow2.asm:asm:9.4")
|
||||||
|
- implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||||
|
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||||
|
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0") // Paper - remove exclusion // Plazma - Bump Dependencies
|
||||||
|
+ implementation("org.ow2.asm:asm:9.5") // Plazma - Bump Dependencies
|
||||||
|
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation // Plazma - Bump Dependencies
|
||||||
|
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - switch to mockito // Plazma - Bump Dependencies
|
||||||
|
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||||
|
implementation("commons-lang:commons-lang:2.6")
|
||||||
|
- implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||||
|
- runtimeOnly("org.xerial:sqlite-jdbc:3.41.2.2")
|
||||||
|
- runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
|
||||||
|
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation // Plazma - Bump Dependencies
|
||||||
|
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") // Plazma - Bump Dependencies
|
||||||
|
+ runtimeOnly("com.mysql:mysql-connector-j:8.0.33") // Plazma - Bump Dependencies
|
||||||
|
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||||
|
// Paper start - Use Velocity cipher
|
||||||
|
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
|
||||||
|
+ implementation("com.velocitypowered:velocity-native:3.2.0-SNAPSHOT") { // Plazma - Bump Dependencies
|
||||||
|
isTransitive = false
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
@@ -42,22 +42,22 @@ dependencies {
|
||||||
|
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
||||||
|
implementation("dev.omega24:upnp4j:1.0") // Purpur
|
||||||
|
|
||||||
|
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||||
|
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||||
|
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||||
|
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.4") // Plazma - Bump Dependencies
|
||||||
|
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
|
||||||
|
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
|
||||||
|
|
||||||
|
// Pufferfish start
|
||||||
|
- implementation("org.yaml:snakeyaml:1.32")
|
||||||
|
- implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8.2") {
|
||||||
|
+ implementation("org.yaml:snakeyaml:1.33") // Plazma - Bump Dependencies
|
||||||
|
+ implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Plazma - Bump Dependencies
|
||||||
|
exclude(group="org.yaml", module="snakeyaml")
|
||||||
|
}
|
||||||
|
// Pufferfish end
|
||||||
|
|
||||||
|
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||||
|
+ testImplementation("io.github.classgraph:classgraph:4.8.162") // Paper - mob goal test // Plazma - Bump Dependencies
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
|
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||||
|
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
||||||
|
|
||||||
|
- implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty
|
||||||
|
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty // Plazma - Bump Dependencies
|
||||||
|
}
|
||||||
|
|
||||||
|
val craftbukkitPackageVersion = "1_19_R3" // Paper
|
||||||
@@ -649,7 +649,7 @@ index 0000000000000000000000000000000000000000..857ddc62dd9affbbebcd7cde8a6d675d
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..b1104778995a3734f3b6df71d59172e546e152a2
|
index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca5751bc0b35
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||||
@@ -0,0 +1,304 @@
|
@@ -0,0 +1,304 @@
|
||||||
@@ -706,7 +706,7 @@ index 0000000000000000000000000000000000000000..b1104778995a3734f3b6df71d59172e5
|
|||||||
+
|
+
|
||||||
+ private static final Logger LOGGER = LogUtils.getLogger();
|
+ private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
+ static final String GLOBAL_CONFIGURATION_FILE_NAME= "plazma-global.yml";
|
+ static final String GLOBAL_CONFIGURATION_FILE_NAME= "plazma-global.yml";
|
||||||
+ static final String LEVEL_DEFAULT_CONFIGURATION_FILE_NAME = "plazma-level-dafaults.yml";
|
+ static final String LEVEL_DEFAULT_CONFIGURATION_FILE_NAME = "plazma-level-defaults.yml";
|
||||||
+ static final String LEVEL_CONFIGURATION_FILE_NAME = "plazma-configuration.yml";
|
+ static final String LEVEL_CONFIGURATION_FILE_NAME = "plazma-configuration.yml";
|
||||||
+
|
+
|
||||||
+ private static final String HEADER_START = """
|
+ private static final String HEADER_START = """
|
||||||
@@ -16,7 +16,7 @@ index 857ddc62dd9affbbebcd7cde8a6d675dbb5f68ae..8ba1c5b6731d43c02b415e4d79a20c1d
|
|||||||
+ public ChunkSending chunkSending;
|
+ public ChunkSending chunkSending;
|
||||||
+ public class ChunkSending extends ConfigurationPart {
|
+ public class ChunkSending extends ConfigurationPart {
|
||||||
+
|
+
|
||||||
+ public boolean enabled = true;
|
+ public boolean enabled = DO_OPTIMIZE;
|
||||||
+ public int maxChunksPerTick = 5;
|
+ public int maxChunksPerTick = 5;
|
||||||
+
|
+
|
||||||
+ }
|
+ }
|
||||||
@@ -7,7 +7,7 @@ Original: someaddons/chunksending
|
|||||||
Copyright (C) 2023 someaddons
|
Copyright (C) 2023 someaddons
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
index 904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e..7f749579fe056a8436e6625204ae31f1fcc15f32 100644
|
index 904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e..005491785e5e776d8721362ecde5f85bad6ae4de 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||||
@@ -362,15 +362,14 @@ public class ChunkHolder {
|
@@ -362,15 +362,14 @@ public class ChunkHolder {
|
||||||
@@ -17,16 +17,16 @@ index 904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e..7f749579fe056a8436e6625204ae31f1
|
|||||||
- for (int i = 0, len = backingSet.length; i < len; ++i) {
|
- for (int i = 0, len = backingSet.length; i < len; ++i) {
|
||||||
- if (!(backingSet[i] instanceof ServerPlayer player)) {
|
- if (!(backingSet[i] instanceof ServerPlayer player)) {
|
||||||
- continue;
|
- continue;
|
||||||
- }
|
+ // Plazma start - Implement ChunkSending
|
||||||
|
+ for (Object o : backingSet) {
|
||||||
|
+ if (o instanceof ServerPlayer player && this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)) {
|
||||||
|
+ if (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet)) continue;
|
||||||
|
+ player.connection.send(packet);
|
||||||
|
}
|
||||||
- if (!this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)) {
|
- if (!this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)) {
|
||||||
- continue;
|
- continue;
|
||||||
- }
|
- }
|
||||||
+ // Plazma start - Implement ChunkSending
|
- player.connection.send(packet);
|
||||||
+ for (Object o : backingSet) {
|
|
||||||
+ if (!(o instanceof ServerPlayer player)
|
|
||||||
+ || !this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)
|
|
||||||
+ || (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet))) continue;
|
|
||||||
player.connection.send(packet);
|
|
||||||
}
|
}
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
// Paper end - per player view distance
|
// Paper end - per player view distance
|
||||||
@@ -18,7 +18,7 @@ index 591163d8f8300b084ac734800efee902c4def958..d74401ca3182145d136ad668704f5c04
|
|||||||
double d1 = (double) (center.y - maxRange);
|
double d1 = (double) (center.y - maxRange);
|
||||||
double d2 = (double) (center.x + maxRange);
|
double d2 = (double) (center.x + maxRange);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 40eda117db2e3f578ad9d25522b6aadfe319b5cc..ef624a99c971aa5c4ce3869d10e2435c0bc8e0a4 100644
|
index 4668eebc0776a470a42de94de1752986f76250d3..2cf146a1d749fc965e5469988bbb95172383ae1c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -405,7 +405,7 @@ public class ServerPlayer extends Player {
|
@@ -405,7 +405,7 @@ public class ServerPlayer extends Player {
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: IPECTER <ipectert@gmail.com>
|
||||||
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
||||||
Subject: [PATCH] Implement MemoryLeakFix
|
Subject: [PATCH] Improve BiomeTemperatureCache
|
||||||
|
|
||||||
Original: fxmorin/MemoryLeakFix
|
|
||||||
Copyright (C) 2023 fxmorin
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
|
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
@@ -67,7 +67,7 @@ public final class Biome {
|
@@ -67,7 +67,7 @@ public final class Biome {
|
||||||
@@ -15,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
|||||||
private final BiomeSpecialEffects specialEffects;
|
private final BiomeSpecialEffects specialEffects;
|
||||||
// Pufferfish start - use our cache
|
// Pufferfish start - use our cache
|
||||||
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
|
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
|
||||||
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - MemoryLeakFix
|
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve BiomeTemperatureCache
|
||||||
return Util.make(() -> {
|
return Util.make(() -> {
|
||||||
/*
|
/*
|
||||||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||||
@@ -24,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
|||||||
long l = blockPos.asLong();
|
long l = blockPos.asLong();
|
||||||
// Pufferfish start
|
// Pufferfish start
|
||||||
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
|
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
|
||||||
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - MemoryLeakFix
|
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve BiomeTemperatureCache
|
||||||
float f = cache.getValue(l);
|
float f = cache.getValue(l);
|
||||||
if (!Float.isNaN(f)) {
|
if (!Float.isNaN(f)) {
|
||||||
return f;
|
return f;
|
||||||
@@ -6,10 +6,16 @@ Subject: [PATCH] Optimize VarInts
|
|||||||
https://github.com/PaperMC/Paper/pull/8418
|
https://github.com/PaperMC/Paper/pull/8418
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817f096e2eb 100644
|
index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..8bb552410207b39a3b4160a5df51410455107fcf 100644
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -104,7 +104,20 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -99,12 +99,26 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
|
private static final Gson GSON = new Gson();
|
||||||
|
|
||||||
|
public static boolean hasItemSerializeEvent = false; // Purpur
|
||||||
|
+ public static boolean optimizeVarInts = false; // Plazma
|
||||||
|
|
||||||
|
public FriendlyByteBuf(ByteBuf parent) {
|
||||||
this.source = parent;
|
this.source = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,18 +30,18 @@ index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817
|
|||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
public static int getVarIntSize(int value) {
|
public static int getVarIntSize(int value) {
|
||||||
+ // Plazma start - Optimize VarInts
|
+ // Plazma start - Optimize VarInts
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.optimizeVarInts)
|
+ if (optimizeVarInts)
|
||||||
+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)];
|
+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)];
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
for (int j = 1; j < 5; ++j) {
|
for (int j = 1; j < 5; ++j) {
|
||||||
if ((value & -1 << j * 7) == 0) {
|
if ((value & -1 << j * 7) == 0) {
|
||||||
return j;
|
return j;
|
||||||
@@ -620,6 +633,25 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -620,6 +634,25 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
public FriendlyByteBuf writeVarInt(int value) {
|
public FriendlyByteBuf writeVarInt(int value) {
|
||||||
+ // Plazma start - Optimize VarInts
|
+ // Plazma start - Optimize VarInts
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.optimizeVarInts) {
|
+ if (optimizeVarInts) {
|
||||||
+ // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
|
+ // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
|
||||||
+ // that the proxy will write, to improve inlining.
|
+ // that the proxy will write, to improve inlining.
|
||||||
+ if ((value & (0xFFFFFFFF << 7)) == 0) {
|
+ if ((value & (0xFFFFFFFF << 7)) == 0) {
|
||||||
@@ -57,14 +63,25 @@ index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817
|
|||||||
this.writeByte(value & 127 | 128);
|
this.writeByte(value & 127 | 128);
|
||||||
value >>>= 7;
|
value >>>= 7;
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
index 39eca4acefa8f9cf143398cfc6cf157e8489947e..754ed13a04631c69e3fb2421a12b17d0a6f732c6 100644
|
index 39eca4acefa8f9cf143398cfc6cf157e8489947e..f473bd844210eb4372a617f499dcb3ce2f6ab6e9 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
@@ -37,11 +37,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Misc misc;
|
||||||
|
- public class Misc extends ConfigurationPart {
|
||||||
|
+ public class Misc extends ConfigurationPart.Post {
|
||||||
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||||
+ public boolean optimizeVarInts = DO_OPTIMIZE;
|
+ public boolean optimizeVarInts = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void postProcess() {
|
||||||
|
+ net.minecraft.network.FriendlyByteBuf.optimizeVarInts = optimizeVarInts;
|
||||||
|
+ }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
31
patches/server/0039-Skip-event-if-no-listeners.patch
Normal file
31
patches/server/0039-Skip-event-if-no-listeners.patch
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Thu, 29 Jun 2023 05:49:26 +0000
|
||||||
|
Subject: [PATCH] Skip event if no listeners
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..32305a34bcebd53aa523102a6da59bc2eb765055 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
@@ -36,15 +36,17 @@ class PaperEventManager {
|
||||||
|
|
||||||
|
// SimplePluginManager
|
||||||
|
public void callEvent(@NotNull Event event) {
|
||||||
|
+ // Plazma start
|
||||||
|
+ HandlerList handlers = event.getHandlers();
|
||||||
|
+ RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||||
|
+ if (listeners.length == 0) return;
|
||||||
|
+ // Plazma end
|
||||||
|
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||||
|
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
|
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||||
|
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||||
|
}
|
||||||
|
|
||||||
|
- HandlerList handlers = event.getHandlers();
|
||||||
|
- RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||||
|
-
|
||||||
|
for (RegisteredListener registration : listeners) {
|
||||||
|
if (!registration.getPlugin().isEnabled()) {
|
||||||
|
continue;
|
||||||
33
patches/server/0040-Optimize-spigot-event-bus.patch
Normal file
33
patches/server/0040-Optimize-spigot-event-bus.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 14:55:37 +0900
|
||||||
|
Subject: [PATCH] Optimize-spigot-event-bus
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
index 32305a34bcebd53aa523102a6da59bc2eb765055..6feb88b90831ec7106c9d777bdfa68fa185f1b89 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
@@ -41,12 +41,17 @@ class PaperEventManager {
|
||||||
|
RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||||
|
if (listeners.length == 0) return;
|
||||||
|
// Plazma end
|
||||||
|
- if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||||
|
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
|
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||||
|
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||||
|
+ // Plazma start - Optimize spigot event bus
|
||||||
|
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
|
||||||
|
+ final boolean isAsync = event.isAsynchronous();
|
||||||
|
+ final boolean onPrimaryThread = this.server.isPrimaryThread();
|
||||||
|
+ if (isAsync && onPrimaryThread) {
|
||||||
|
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
|
+ } else if (!isAsync && !onPrimaryThread && !this.server.isStopping()) {
|
||||||
|
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+ // Plazma end
|
||||||
|
for (RegisteredListener registration : listeners) {
|
||||||
|
if (!registration.getPlugin().isEnabled()) {
|
||||||
|
continue;
|
||||||
40
patches/server/0042-CarpetFixes-Configuration.patch
Normal file
40
patches/server/0042-CarpetFixes-Configuration.patch
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 15:40:34 +0900
|
||||||
|
Subject: [PATCH] CarpetFixes-Configuration
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index f473bd844210eb4372a617f499dcb3ce2f6ab6e9..7040b1c97292bd58ce531065078fb2df2533e562 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -75,4 +75,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
public int timerTimeOut = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public CarpetFixes carpetFixes;
|
||||||
|
+
|
||||||
|
+ public class CarpetFixes extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean enabled = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index 7d5bfd3a5aa5135596f3f1ae7c504a51b02798ef..b0deec445b5ea3cd3e4802eca04e99818b539bd8 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -131,4 +131,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public CarpetFixes carpetFixes;
|
||||||
|
+
|
||||||
|
+ public class CarpetFixes extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean enabled = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
}
|
||||||
179
patches/server/0043-CarpetFixes-Optimizations-BiomeManager.patch
Normal file
179
patches/server/0043-CarpetFixes-Optimizations-BiomeManager.patch
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 15:53:37 +0900
|
||||||
|
Subject: [PATCH] CarpetFixes-Optimizations-BiomeManager
|
||||||
|
|
||||||
|
Original: fxmorin/carpet-fixes
|
||||||
|
Copyright (C) 2023 fxmorin
|
||||||
|
|
||||||
|
Optimized getBiome call: Reduce the number of calls to the mess of
|
||||||
|
LinearCongruentialGenerator#next(long, long) which is pretty heavy on performance.
|
||||||
|
|
||||||
|
We are able to do this by skipping around 370 of 512 possible calls to getBiome() by predicting the outcome
|
||||||
|
before doing the seed mixing. This seems to be around 25% - 75% faster depending on the use case.
|
||||||
|
We can predict much faster than the seed mixing.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||||
|
index 5695c5116c8a338b2e41aafcb2dc9f2146856970..b2291854b9803fe01d40e8a1d76d6ff358cea114 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||||
|
@@ -12,6 +12,7 @@ public class BiomeManager {
|
||||||
|
private static final int ZOOM_BITS = 2;
|
||||||
|
private static final int ZOOM = 4;
|
||||||
|
private static final int ZOOM_MASK = 3;
|
||||||
|
+ private static final double maxOffset = 0.4500000001D; // Plazma - CarpetFixes
|
||||||
|
private final BiomeManager.NoiseBiomeSource noiseBiomeSource;
|
||||||
|
private final long biomeZoomSeed;
|
||||||
|
|
||||||
|
@@ -29,39 +30,104 @@ public class BiomeManager {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Holder<Biome> getBiome(BlockPos pos) {
|
||||||
|
- int i = pos.getX() - 2;
|
||||||
|
- int j = pos.getY() - 2;
|
||||||
|
- int k = pos.getZ() - 2;
|
||||||
|
- int l = i >> 2;
|
||||||
|
- int m = j >> 2;
|
||||||
|
- int n = k >> 2;
|
||||||
|
- double d = (double)(i & 3) / 4.0D;
|
||||||
|
- double e = (double)(j & 3) / 4.0D;
|
||||||
|
- double f = (double)(k & 3) / 4.0D;
|
||||||
|
- int o = 0;
|
||||||
|
- double g = Double.POSITIVE_INFINITY;
|
||||||
|
-
|
||||||
|
- for(int p = 0; p < 8; ++p) {
|
||||||
|
- boolean bl = (p & 4) == 0;
|
||||||
|
- boolean bl2 = (p & 2) == 0;
|
||||||
|
- boolean bl3 = (p & 1) == 0;
|
||||||
|
- int q = bl ? l : l + 1;
|
||||||
|
- int r = bl2 ? m : m + 1;
|
||||||
|
- int s = bl3 ? n : n + 1;
|
||||||
|
- double h = bl ? d : d - 1.0D;
|
||||||
|
- double t = bl2 ? e : e - 1.0D;
|
||||||
|
- double u = bl3 ? f : f - 1.0D;
|
||||||
|
- double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||||
|
- if (g > v) {
|
||||||
|
- o = p;
|
||||||
|
- g = v;
|
||||||
|
+ // Plazma start - CarpetFixes - Optimized getBiome call
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedBiomeAccess()) {
|
||||||
|
+ int xMinus2 = pos.getX() - 2;
|
||||||
|
+ int yMinus2 = pos.getY() - 2;
|
||||||
|
+ int zMinus2 = pos.getZ() - 2;
|
||||||
|
+ int x = xMinus2 >> 2; // BlockPos to BiomePos
|
||||||
|
+ int y = yMinus2 >> 2;
|
||||||
|
+ int z = zMinus2 >> 2;
|
||||||
|
+ double quartX = (double) (xMinus2 & 3) / 4.0D; // quartLocal divided by 4
|
||||||
|
+ double quartY = (double) (yMinus2 & 3) / 4.0D; // 0/4, 1/4, 2/4, 3/4
|
||||||
|
+ double quartZ = (double) (zMinus2 & 3) / 4.0D; // [0, 0.25, 0.5, 0.75]
|
||||||
|
+ int smallestX = 0;
|
||||||
|
+ double smallestDist = Double.POSITIVE_INFINITY;
|
||||||
|
+ for (int biomeX = 0; biomeX < 8; ++biomeX) {
|
||||||
|
+ boolean everyOtherQuad = (biomeX & 4) == 0; // 1 1 1 1 0 0 0 0
|
||||||
|
+ boolean everyOtherPair = (biomeX & 2) == 0; // 1 1 0 0 1 1 0 0
|
||||||
|
+ boolean everyOther = (biomeX & 1) == 0; // 1 0 1 0 1 0 1 0
|
||||||
|
+ double quartXX = everyOtherQuad ? quartX : quartX - 1.0D; //[-1.0,-0.75,-0.5,-0.25,0.0,0.25,0.5,0.75]
|
||||||
|
+ double quartYY = everyOtherPair ? quartY : quartY - 1.0D;
|
||||||
|
+ double quartZZ = everyOther ? quartZ : quartZ - 1.0D;
|
||||||
|
+
|
||||||
|
+ //This code block is new
|
||||||
|
+ double maxQuartYY = 0.0D, maxQuartZZ = 0.0D;
|
||||||
|
+ if (biomeX != 0) {
|
||||||
|
+ maxQuartYY = Mth.square(Math.max(quartYY + maxOffset, Math.abs(quartYY - maxOffset)));
|
||||||
|
+ maxQuartZZ = Mth.square(Math.max(quartZZ + maxOffset, Math.abs(quartZZ - maxOffset)));
|
||||||
|
+ double maxQuartXX = Mth.square(Math.max(quartXX + maxOffset, Math.abs(quartXX - maxOffset)));
|
||||||
|
+ if (smallestDist < maxQuartXX + maxQuartYY + maxQuartZZ) continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ int xx = everyOtherQuad ? x : x + 1;
|
||||||
|
+ int yy = everyOtherPair ? y : y + 1;
|
||||||
|
+ int zz = everyOther ? z : z + 1;
|
||||||
|
+
|
||||||
|
+ //I transferred the code from method_38106 to here, so I could call continue halfway through
|
||||||
|
+ long seed = LinearCongruentialGenerator.next(this.biomeZoomSeed, xx);
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, xx);
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||||
|
+ double offsetX = getFiddle(seed);
|
||||||
|
+ double sqrX = Mth.square(quartXX + offsetX);
|
||||||
|
+ if (biomeX != 0 && smallestDist < sqrX + maxQuartYY + maxQuartZZ) continue; //skip the rest of the loop
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||||
|
+ double offsetY = getFiddle(seed);
|
||||||
|
+ double sqrY = Mth.square(quartYY + offsetY);
|
||||||
|
+ if (biomeX != 0 && smallestDist < sqrX + sqrY + maxQuartZZ) continue; // skip the rest of the loop
|
||||||
|
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||||
|
+ double offsetZ = getFiddle(seed);
|
||||||
|
+ double biomeDist = sqrX + sqrY + Mth.square(quartZZ + offsetZ);
|
||||||
|
+
|
||||||
|
+ if (smallestDist > biomeDist) {
|
||||||
|
+ smallestX = biomeX;
|
||||||
|
+ smallestDist = biomeDist;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
+ return this.noiseBiomeSource.getNoiseBiome(
|
||||||
|
+ (smallestX & 4) == 0 ? x : x + 1,
|
||||||
|
+ (smallestX & 2) == 0 ? y : y + 1,
|
||||||
|
+ (smallestX & 1) == 0 ? z : z + 1
|
||||||
|
+ );
|
||||||
|
+ } else {
|
||||||
|
+ int i = pos.getX() - 2;
|
||||||
|
+ int j = pos.getY() - 2;
|
||||||
|
+ int k = pos.getZ() - 2;
|
||||||
|
+ int l = i >> 2;
|
||||||
|
+ int m = j >> 2;
|
||||||
|
+ int n = k >> 2;
|
||||||
|
+ double d = (double) (i & 3) / 4.0D;
|
||||||
|
+ double e = (double) (j & 3) / 4.0D;
|
||||||
|
+ double f = (double) (k & 3) / 4.0D;
|
||||||
|
+ int o = 0;
|
||||||
|
+ double g = Double.POSITIVE_INFINITY;
|
||||||
|
+
|
||||||
|
+ for (int p = 0; p < 8; ++p) {
|
||||||
|
+ boolean bl = (p & 4) == 0;
|
||||||
|
+ boolean bl2 = (p & 2) == 0;
|
||||||
|
+ boolean bl3 = (p & 1) == 0;
|
||||||
|
+ int q = bl ? l : l + 1;
|
||||||
|
+ int r = bl2 ? m : m + 1;
|
||||||
|
+ int s = bl3 ? n : n + 1;
|
||||||
|
+ double h = bl ? d : d - 1.0D;
|
||||||
|
+ double t = bl2 ? e : e - 1.0D;
|
||||||
|
+ double u = bl3 ? f : f - 1.0D;
|
||||||
|
+ double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||||
|
+ if (g > v) {
|
||||||
|
+ o = p;
|
||||||
|
+ g = v;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- int w = (o & 4) == 0 ? l : l + 1;
|
||||||
|
- int x = (o & 2) == 0 ? m : m + 1;
|
||||||
|
- int y = (o & 1) == 0 ? n : n + 1;
|
||||||
|
- return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||||
|
+ int w = (o & 4) == 0 ? l : l + 1;
|
||||||
|
+ int x = (o & 2) == 0 ? m : m + 1;
|
||||||
|
+ int y = (o & 1) == 0 ? n : n + 1;
|
||||||
|
+ return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
}
|
||||||
|
|
||||||
|
public Holder<Biome> getNoiseBiomeAtPosition(double x, double y, double z) {
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index 7040b1c97292bd58ce531065078fb2df2533e562..bf323df50bc07e19ec6e3a4a11f3b7db466064c9 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -81,6 +81,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
public class CarpetFixes extends ConfigurationPart {
|
||||||
|
|
||||||
|
public boolean enabled = DO_OPTIMIZE;
|
||||||
|
+ boolean optimizedBiomeAccess = true;
|
||||||
|
+
|
||||||
|
+ public boolean optimizedBiomeAccess() {
|
||||||
|
+ return enabled && optimizedBiomeAccess;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
127
patches/server/0044-CarpetFixes-Optimizations-Sheep.patch
Normal file
127
patches/server/0044-CarpetFixes-Optimizations-Sheep.patch
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: IPECTER <ipectert@gmail.com>
|
||||||
|
Date: Wed, 6 Sep 2023 16:35:34 +0900
|
||||||
|
Subject: [PATCH] CarpetFixes-Optimizations-Sheep
|
||||||
|
|
||||||
|
Original: fxmorin/carpet-fixes
|
||||||
|
Copyright (C) 2023 fxmorin
|
||||||
|
|
||||||
|
The game determines the child sheep's color by getting a wool block from the parents, putting them in a crafting
|
||||||
|
recipe, getting the output wool and getting the color from that.
|
||||||
|
I don't know in what world we would consider a data-driven method with that much overhead as a smart idea. Instead,
|
||||||
|
we used a prebaked list of all the possible colors and combinations, however this means that you can't use a
|
||||||
|
datapack to change it.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||||
|
index 9399361c8d26a140fa6042988a30a1d3d552e418..5bfb246bfabf82feb805665b0be1a36ce62996ca 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||||
|
@@ -431,19 +431,27 @@ public class Sheep extends Animal implements Shearable {
|
||||||
|
}
|
||||||
|
|
||||||
|
private DyeColor getOffspringColor(Animal firstParent, Animal secondParent) {
|
||||||
|
+ // Plazma start - CarpetFixes - Optimized sheep chile color
|
||||||
|
DyeColor enumcolor = ((Sheep) firstParent).getColor();
|
||||||
|
DyeColor enumcolor1 = ((Sheep) secondParent).getColor();
|
||||||
|
- CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||||
|
- Optional<Item> optional = this.level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||||
|
- return recipecrafting.assemble(inventorycrafting, this.level.registryAccess());
|
||||||
|
- }).map(ItemStack::getItem);
|
||||||
|
-
|
||||||
|
- Objects.requireNonNull(DyeItem.class);
|
||||||
|
- optional = optional.filter(DyeItem.class::isInstance);
|
||||||
|
- Objects.requireNonNull(DyeItem.class);
|
||||||
|
- return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||||
|
- return this.level.random.nextBoolean() ? enumcolor : enumcolor1;
|
||||||
|
- });
|
||||||
|
+ if (this.level.plazmaLevelConfiguration().carpetFixes.optimizedSheepChildColor()) {
|
||||||
|
+ DyeColor col = org.plazmamc.plazma.util.CarpetFixesUtils.properDyeMixin(enumcolor, enumcolor1);
|
||||||
|
+ if (col == null) col = this.level.random.nextBoolean() ? enumcolor : enumcolor1;
|
||||||
|
+ return col;
|
||||||
|
+ } else {
|
||||||
|
+ CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||||
|
+ Optional<Item> optional = this.level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||||
|
+ return recipecrafting.assemble(inventorycrafting, this.level.registryAccess());
|
||||||
|
+ }).map(ItemStack::getItem);
|
||||||
|
+
|
||||||
|
+ Objects.requireNonNull(DyeItem.class);
|
||||||
|
+ optional = optional.filter(DyeItem.class::isInstance);
|
||||||
|
+ Objects.requireNonNull(DyeItem.class);
|
||||||
|
+ return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||||
|
+ return this.level.random.nextBoolean() ? enumcolor : enumcolor1;
|
||||||
|
+ });
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CraftingContainer makeContainer(DyeColor firstColor, DyeColor secondColor) {
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..de1fa9ccb088597d059e8dc7fbb0c8788e3815fc 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public class CarpetFixes extends ConfigurationPart {
|
||||||
|
|
||||||
|
public boolean enabled = DO_OPTIMIZE;
|
||||||
|
+ boolean optimizedSheepChildColor = false;
|
||||||
|
+
|
||||||
|
+ public boolean optimizedSheepChildColor() {
|
||||||
|
+ return enabled && optimizedSheepChildColor;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..aae3cf170bca4b3e6cdd0a964967dfafe2759f65
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||||
|
@@ -0,0 +1,48 @@
|
||||||
|
+package org.plazmamc.plazma.util;
|
||||||
|
+
|
||||||
|
+import net.minecraft.world.item.DyeColor;
|
||||||
|
+
|
||||||
|
+public class CarpetFixesUtils {
|
||||||
|
+
|
||||||
|
+ //If I was actually implementing this, the color values would have been binary in order for fast calculations.
|
||||||
|
+ //Never do this in a production build, although this is better than using the RecipeManager xD
|
||||||
|
+ public static DyeColor properDyeMixin(DyeColor col1, DyeColor col2) {
|
||||||
|
+ if (col1.equals(col2)) return col1;
|
||||||
|
+ switch(col1) {
|
||||||
|
+ case WHITE -> {
|
||||||
|
+ switch(col2) {
|
||||||
|
+ case BLUE -> {return DyeColor.LIGHT_BLUE;}
|
||||||
|
+ case GRAY -> {return DyeColor.LIGHT_GRAY;}
|
||||||
|
+ case BLACK -> {return DyeColor.GRAY;}
|
||||||
|
+ case GREEN -> {return DyeColor.LIME;}
|
||||||
|
+ case RED -> {return DyeColor.PINK;}
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ case BLUE -> {
|
||||||
|
+ switch(col2) {
|
||||||
|
+ case WHITE -> {return DyeColor.LIGHT_BLUE;}
|
||||||
|
+ case GREEN -> {return DyeColor.CYAN;}
|
||||||
|
+ case RED -> {return DyeColor.PURPLE;}
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ case RED -> {
|
||||||
|
+ switch(col2) {
|
||||||
|
+ case YELLOW -> {return DyeColor.ORANGE;}
|
||||||
|
+ case WHITE -> {return DyeColor.PINK;}
|
||||||
|
+ case BLUE -> {return DyeColor.PURPLE;}
|
||||||
|
+ }
|
||||||
|
+ }case GREEN -> {
|
||||||
|
+ switch(col2) {
|
||||||
|
+ case BLUE -> {return DyeColor.CYAN;}
|
||||||
|
+ case WHITE -> {return DyeColor.LIME;}
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ case YELLOW -> {if (col2.equals(DyeColor.RED)) return DyeColor.ORANGE;}
|
||||||
|
+ case PURPLE -> {if (col2.equals(DyeColor.PINK)) return DyeColor.MAGENTA;}
|
||||||
|
+ case PINK -> {if (col2.equals(DyeColor.PURPLE)) return DyeColor.MAGENTA;}
|
||||||
|
+ case GRAY -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.LIGHT_GRAY;}
|
||||||
|
+ case BLACK -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.GRAY;}
|
||||||
|
+ }
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
1367
patches/server/0045-Async-PathProcessing.patch
Normal file
1367
patches/server/0045-Async-PathProcessing.patch
Normal file
File diff suppressed because it is too large
Load Diff
BIN
res/logo-450.png
BIN
res/logo-450.png
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB |
BIN
res/logo-64.png
BIN
res/logo-64.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB |
BIN
res/logo-900.png
BIN
res/logo-900.png
Binary file not shown.
|
Before Width: | Height: | Size: 176 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 231 KiB |
Reference in New Issue
Block a user