Compare commits
36 Commits
release-82
...
dev-1.20.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63c63f844e | ||
|
|
0f0f925cb8 | ||
|
|
c0273a9343 | ||
|
|
326a88dca5 | ||
|
|
cb3099170e | ||
|
|
a2120f0c82 | ||
|
|
1c33d683c8 | ||
|
|
ff30483d2c | ||
|
|
3884819fff | ||
|
|
41df279b8b | ||
|
|
8730a4d0a5 | ||
|
|
c357668334 | ||
|
|
9cde439cce | ||
|
|
0290b04ffd | ||
|
|
d63b408e89 | ||
|
|
5efc27e381 | ||
|
|
4042f69c8d | ||
|
|
617172ab6c | ||
|
|
7737cd805a | ||
|
|
4c26d69762 | ||
|
|
078fbd108c | ||
|
|
318376a16f | ||
|
|
74c593fa04 | ||
|
|
c6c048c34f | ||
|
|
017f695244 | ||
|
|
ecbebeb403 | ||
|
|
5bf8a8124e | ||
|
|
3e35bff9a0 | ||
|
|
cb7a348e89 | ||
|
|
eea08a3ecd | ||
|
|
b49ad3f336 | ||
|
|
3ba3fe9814 | ||
|
|
2adeb25bff | ||
|
|
c93e0ff16a | ||
|
|
5c5d10ae4e | ||
|
|
057b293ed5 |
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
ORG_NAME: PlazmaMC
|
ORG_NAME: PlazmaMC
|
||||||
MC_VERSION: 1.20.1
|
MC_VERSION: 1.20.2
|
||||||
MAIN_BRANCH: ver/1.20.1
|
MAIN_BRANCH: ver/1.20.1
|
||||||
DEBUG: 'false'
|
DEBUG: 'false'
|
||||||
|
|
||||||
@@ -84,6 +84,7 @@ jobs:
|
|||||||
Plazma-API/build/docs/javadoc
|
Plazma-API/build/docs/javadoc
|
||||||
|
|
||||||
- name: Get Release Number
|
- name: Get Release Number
|
||||||
|
if: startsWith(github.ref_name, 'ver/')
|
||||||
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
|
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Release Artifacts
|
- name: Release Artifacts
|
||||||
@@ -96,7 +97,7 @@ jobs:
|
|||||||
files: build/libs/*.jar
|
files: build/libs/*.jar
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
- name: Release Artifacts (Latest)
|
- name: Release Artifacts (Latest/Stable)
|
||||||
if: startsWith(github.ref_name, 'ver/')
|
if: startsWith(github.ref_name, 'ver/')
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
with:
|
with:
|
||||||
@@ -105,3 +106,13 @@ jobs:
|
|||||||
repo_token: "${{ secrets.GH_PAT }}"
|
repo_token: "${{ secrets.GH_PAT }}"
|
||||||
files: build/libs/*.jar
|
files: build/libs/*.jar
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Release Artifacts (Latest/Development)
|
||||||
|
if: startsWith(github.ref_name, 'dev/')
|
||||||
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
|
with:
|
||||||
|
title: "Development build for ${{ env.MC_VERSION }}"
|
||||||
|
automatic_release_tag: dev-${{ env.MC_VERSION }}
|
||||||
|
repo_token: "${{ secrets.GH_PAT }}"
|
||||||
|
files: build/libs/*.jar
|
||||||
|
prerelease: true
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
purpurCommit = d527ade824e6fa48ccbbb002af273ca22b7f8d7e
|
purpurCommit = 6a6706d3b4f934845a44ecd7533bf53966e4857c
|
||||||
pufferfishCommit = e32a780bcab6821e3804846a63a9153fdeee44f4
|
pufferfishCommit = 2c3f3fd4e1df97dc7ff8d770061138144847850e
|
||||||
|
|||||||
46
README.md
46
README.md
@@ -1,15 +1,15 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||

|
[](https://github.com/PlazmaMC/Plazma)
|
||||||
|
|
||||||
### 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)
|
||||||
|
|
||||||
[](LICENSE)
|
[](https://discord.gg/MmfC52K8A8)
|
||||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
|
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
|
||||||
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
||||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
|
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
|
||||||
|
|
||||||
[](https://discord.gg/MmfC52K8A8)
|
[](LICENSE)
|
||||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
|
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
|
||||||
[](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)
|
||||||
@@ -17,39 +17,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## ⚠️ Warning
|
[main]: https://github.com/PlazmaMC/Plazma
|
||||||
- Plazma may cause **<u>unexpected problems</u>**, so be sure to test it thoroughly before using it on a public server.
|
|
||||||
|
|
||||||
## 💬 About Plazma...
|
### This is the branch for Plazma 1.20.2. 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.20.2용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 [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
|
||||||
| Version | Direct | Bundler Mojmap | Bundler Reobf | Paperclip Mojmap | Paperclip Reobf |
|
### If you don't know about Mojmap or Bundler, download **Reobf Paperclip**
|
||||||
| :---: | :---: | :---: | :---: | :---: | :---: |
|
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
|
||||||
| [1.20.1](https://github.com/PlazmaMC/Plazma/tree/ver/1.20.1) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar) |
|
|
||||||
| [1.19.4](https://github.com/PlazmaMC/Plazma/tree/ver/1.19.4) | [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-bundler-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-paperclip-1.19.4-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-paperclip-1.19.4-R0.1-SNAPSHOT-reobf.jar) |
|
|
||||||
- If you don't know about Mojmap or Bundler, download **Direct**
|
|
||||||
- Old Builds: [Releases](https://github.com/PlazmaMC/Plazma/releases)
|
|
||||||
|
|
||||||
## ⚖️ 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.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-mojmap.jar) |
|
||||||
## 🔧 Support Status
|
|
||||||
| Version | Support | Stability | Progress |
|
|
||||||
| :---: | :---: | :---: | :---: |
|
|
||||||
| [1.20.1](https://github.com/PlazmaMC/Plazma/tree/ver/1.20.1) | Active | Good | 100% |
|
|
||||||
| [1.19.4](https://github.com/PlazmaMC/Plazma/tree/ver/1.19.4) | Active | Good | 100% |
|
|
||||||
|
|
||||||
## 🌀 Sponsorship - Minecraft Development Dictionary (KOREAN)
|
|
||||||
[](https://discord.gg/AZwXTA9Pgx)
|
|
||||||
- 한글로 번역&정리된 Minecraft와 서드파티 버킷들의 소식들을 빠르게 만나볼 수 있습니다.
|
|
||||||
- Skript와 Plugin등 서버 개발과 관련된 질문에 대한 답변을 받으실 수 있습니다.
|
|
||||||
|
|
||||||
## 📈 bStats
|
|
||||||
[](https://bstats.org/plugin/server-implementation/Plazma/18047)
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ plugins {
|
|||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("io.papermc.paperweight.patcher") version "1.5.5"
|
id("io.papermc.paperweight.patcher") version "1.5.7-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -18,7 +18,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.8.9:fat")
|
remapper("net.fabricmc:tiny-remapper:0.8.10: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")
|
||||||
}
|
}
|
||||||
@@ -26,30 +26,27 @@ dependencies {
|
|||||||
subprojects {
|
subprojects {
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|
||||||
java {
|
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
toolchain {
|
|
||||||
languageVersion.set(JavaLanguageVersion.of(17))
|
tasks {
|
||||||
|
withType<JavaCompile>().configureEach {
|
||||||
|
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
options.release.set(17)
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<Javadoc> {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<ProcessResources> {
|
||||||
|
filteringCharset = Charsets.UTF_8.name()
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<Test> {
|
||||||
|
minHeapSize = "2g"
|
||||||
|
maxHeapSize = "2g"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects {
|
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
options.release.set(17)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
|
||||||
options.encoding = Charsets.UTF_8.name()
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<ProcessResources> {
|
|
||||||
filteringCharset = Charsets.UTF_8.name()
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test> {
|
|
||||||
minHeapSize = "2g"
|
|
||||||
maxHeapSize = "2g"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
0
FixupAPI.sh → fxapi.sh
Normal file → Executable file
0
FixupAPI.sh → fxapi.sh
Normal file → Executable file
0
FixupServer.sh → fxsrv.sh
Normal file → Executable file
0
FixupServer.sh → fxsrv.sh
Normal file → Executable file
@@ -1,7 +1,7 @@
|
|||||||
group = org.plazmamc.plazma
|
group = org.plazmamc.plazma
|
||||||
version = 1.20.1-R0.1-SNAPSHOT
|
version = 1.20.2-R0.1-SNAPSHOT
|
||||||
|
|
||||||
paperCommit = fb06829845db10be0405966f874a16f135f73229
|
paperCommit = 38376f43a0c268e5223746cab13910f55e5ecf41
|
||||||
|
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
|
|||||||
0
PatchAPI.sh → mkapi.sh
Normal file → Executable file
0
PatchAPI.sh → mkapi.sh
Normal file → Executable file
0
PatchServer.sh → mksrv.sh
Normal file → Executable file
0
PatchServer.sh → mksrv.sh
Normal file → Executable file
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
Date: Mon, 11 Sep 2023 23:17:28 +0000
|
Date: Sat, 30 Sep 2023 09:45:48 +0000
|
||||||
Subject: [PATCH] Pufferfish API Changes
|
Subject: [PATCH] Pufferfish API Changes
|
||||||
|
|
||||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 8045f92ffdfb4164bcbef99c41359590c45f9006..3676035ba011fb874ad6bb8995940d9bb2a0f0ae 100644
|
index 639651972fddce4dff63a0f0a7e566a15b9e2dd6..6c0df825238ca037abeb2ba619983b6f554180ea 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -46,6 +46,7 @@ dependencies {
|
@@ -46,6 +46,7 @@ dependencies {
|
||||||
@@ -31,26 +31,21 @@ index 8045f92ffdfb4164bcbef99c41359590c45f9006..3676035ba011fb874ad6bb8995940d9b
|
|||||||
|
|
||||||
implementation("org.ow2.asm:asm:9.4")
|
implementation("org.ow2.asm:asm:9.4")
|
||||||
implementation("org.ow2.asm:asm-commons:9.4")
|
implementation("org.ow2.asm:asm-commons:9.4")
|
||||||
@@ -89,6 +90,13 @@ val generateApiVersioningFile by tasks.registering {
|
@@ -102,6 +103,8 @@ tasks.jar {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+// Pufferfish Start
|
tasks.withType<Javadoc> {
|
||||||
+tasks.withType<JavaCompile> {
|
val options = options as StandardJavadocDocletOptions
|
||||||
+ val compilerArgs = options.compilerArgs
|
+ options.addStringOption("-add-modules", "jdk.incubator.vector") // Pufferfish
|
||||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
+ options.addStringOption("Xdoclint:none", "-quiet") // Pufferfish
|
||||||
+}
|
options.overview = "src/main/javadoc/overview.html"
|
||||||
+// Pufferfish End
|
options.use()
|
||||||
+
|
options.isDocFilesSubDirs = true
|
||||||
tasks.jar {
|
|
||||||
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
|
||||||
into("META-INF/maven/${project.group}/${project.name}")
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a
|
index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b196a10948
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
||||||
@@ -0,0 +1,161 @@
|
@@ -0,0 +1,162 @@
|
||||||
+package gg.pufferfish.pufferfish.sentry;
|
+package gg.pufferfish.pufferfish.sentry;
|
||||||
+
|
+
|
||||||
+import com.google.gson.Gson;
|
+import com.google.gson.Gson;
|
||||||
@@ -66,6 +61,7 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
|
|||||||
+import org.bukkit.event.player.PlayerEvent;
|
+import org.bukkit.event.player.PlayerEvent;
|
||||||
+import org.bukkit.plugin.Plugin;
|
+import org.bukkit.plugin.Plugin;
|
||||||
+import org.bukkit.plugin.RegisteredListener;
|
+import org.bukkit.plugin.RegisteredListener;
|
||||||
|
+import org.jetbrains.annotations.NotNull;
|
||||||
+import org.jetbrains.annotations.Nullable;
|
+import org.jetbrains.annotations.Nullable;
|
||||||
+
|
+
|
||||||
+public class SentryContext {
|
+public class SentryContext {
|
||||||
@@ -98,7 +94,7 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
|
|||||||
+ ThreadContext.remove("pufferfishsentry_playerid");
|
+ ThreadContext.remove("pufferfishsentry_playerid");
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static void setEventContext(Event event, RegisteredListener registration) {
|
+ public static void setEventContext(@NotNull Event event, @NotNull RegisteredListener registration) {
|
||||||
+ setPluginContext(registration.getPlugin());
|
+ setPluginContext(registration.getPlugin());
|
||||||
+
|
+
|
||||||
+ try {
|
+ try {
|
||||||
@@ -171,43 +167,43 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
|
|||||||
+ private Event event;
|
+ private Event event;
|
||||||
+ private RegisteredListener registeredListener;
|
+ private RegisteredListener registeredListener;
|
||||||
+
|
+
|
||||||
+ public Plugin getPlugin() {
|
+ public @Nullable Plugin getPlugin() {
|
||||||
+ return plugin;
|
+ return plugin;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setPlugin(Plugin plugin) {
|
+ public void setPlugin(@Nullable Plugin plugin) {
|
||||||
+ this.plugin = plugin;
|
+ this.plugin = plugin;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public Command getCommand() {
|
+ public @Nullable Command getCommand() {
|
||||||
+ return command;
|
+ return command;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setCommand(Command command) {
|
+ public void setCommand(@Nullable Command command) {
|
||||||
+ this.command = command;
|
+ this.command = command;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public String getCommandLine() {
|
+ public @Nullable String getCommandLine() {
|
||||||
+ return commandLine;
|
+ return commandLine;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setCommandLine(String commandLine) {
|
+ public void setCommandLine(@Nullable String commandLine) {
|
||||||
+ this.commandLine = commandLine;
|
+ this.commandLine = commandLine;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public Event getEvent() {
|
+ public @Nullable Event getEvent() {
|
||||||
+ return event;
|
+ return event;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setEvent(Event event) {
|
+ public void setEvent(@Nullable Event event) {
|
||||||
+ this.event = event;
|
+ this.event = event;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public RegisteredListener getRegisteredListener() {
|
+ public @Nullable RegisteredListener getRegisteredListener() {
|
||||||
+ return registeredListener;
|
+ return registeredListener;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setRegisteredListener(RegisteredListener registeredListener) {
|
+ public void setRegisteredListener(@Nullable RegisteredListener registeredListener) {
|
||||||
+ this.registeredListener = registeredListener;
|
+ this.registeredListener = registeredListener;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Mon, 11 Sep 2023 23:19:23 +0000
|
Date: Sat, 30 Sep 2023 09:53:53 +0000
|
||||||
Subject: [PATCH] Purpur API Changes
|
Subject: [PATCH] Purpur API Changes
|
||||||
|
|
||||||
Original: PurpurMC
|
Original: PurpurMC
|
||||||
@@ -24,19 +24,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 3676035ba011fb874ad6bb8995940d9bb2a0f0ae..0c557f34ed438980c6fd9d6a8bce7c1152468735 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -109,6 +109,8 @@ tasks.jar {
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
|
||||||
+ (options as StandardJavadocDocletOptions).addStringOption("-add-modules", "jdk.incubator.vector") // Purpur - our javadocs need this for pufferfish's SIMD patch
|
|
||||||
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Paper's bajillion javadoc warnings
|
|
||||||
val options = options as StandardJavadocDocletOptions
|
|
||||||
options.overview = "src/main/javadoc/overview.html"
|
|
||||||
options.use()
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||||
index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72 100644
|
index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72 100644
|
||||||
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||||
@@ -169,10 +156,10 @@ index e801e79fa57c44b2e5d359647c920f88064826f1..1abfcee0f6d632f4cd8d74b4994a90c9
|
|||||||
new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||||
index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..b1f35c68373edfe666ca05b50f0ec022a1859ce9 100644
|
index 0c4dbb9ef63fa8575b5546239443cb2bd91ba847..b347224c223569297ee67ac630a710fdf28748ea 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||||
@@ -201,6 +201,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
@@ -198,6 +198,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||||
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
|
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
|
||||||
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));
|
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));
|
||||||
|
|
||||||
@@ -189,7 +176,7 @@ index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..b1f35c68373edfe666ca05b50f0ec022
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
/**
|
/**
|
||||||
* @deprecated removed in 1.16
|
* @deprecated removed in 1.20.2
|
||||||
*/
|
*/
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||||
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
|
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
|
||||||
@@ -431,10 +418,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||||
index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da3026ed0f8e 100644
|
index da6e36a16e609272b60fc41ff69a6fa3c34926c0..eba4e7ebe3530fd8cb3ecbe72f703932df8721c9 100644
|
||||||
--- a/src/main/java/org/bukkit/Material.java
|
--- a/src/main/java/org/bukkit/Material.java
|
||||||
+++ b/src/main/java/org/bukkit/Material.java
|
+++ b/src/main/java/org/bukkit/Material.java
|
||||||
@@ -11047,4 +11047,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
@@ -11050,4 +11050,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||||
public boolean isEnabledByFeature(@NotNull World world) {
|
public boolean isEnabledByFeature(@NotNull World world) {
|
||||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||||
}
|
}
|
||||||
@@ -724,10 +711,10 @@ index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||||
index 6917931966377c51db88a3364997a110dd987970..bf39c6602cfca70a6352519fa26059cd79143cdd 100644
|
index da524a71af74b02515b037f7fe09ba6988e2c8bf..3679c3b8d31ab8de08ecabd56bf92ffc062f971c 100644
|
||||||
--- a/src/main/java/org/bukkit/World.java
|
--- a/src/main/java/org/bukkit/World.java
|
||||||
+++ b/src/main/java/org/bukkit/World.java
|
+++ b/src/main/java/org/bukkit/World.java
|
||||||
@@ -3992,6 +3992,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
@@ -4008,6 +4008,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||||
@Nullable
|
@Nullable
|
||||||
public DragonBattle getEnderDragonBattle();
|
public DragonBattle getEnderDragonBattle();
|
||||||
|
|
||||||
@@ -1200,10 +1187,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index f9dd00210c1762a40259f823aeb8d8a5ddc78e3e..9193288438671409cc3cf92033ef7cb60d798b69 100644
|
index 20fa1024f9ad8f478a347be5c554b5e45b398a1c..0df709ed758401f04b3f565dc1f6492a55f5363c 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -3271,4 +3271,143 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@@ -3278,4 +3278,122 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
@Override
|
@Override
|
||||||
Spigot spigot();
|
Spigot spigot();
|
||||||
// Spigot end
|
// Spigot end
|
||||||
@@ -1236,27 +1223,6 @@ index f9dd00210c1762a40259f823aeb8d8a5ddc78e3e..9193288438671409cc3cf92033ef7cb6
|
|||||||
+ void resetIdleTimer();
|
+ void resetIdleTimer();
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
|
|
||||||
+ *
|
|
||||||
+ * @return True if invulnerable
|
|
||||||
+ */
|
|
||||||
+ boolean isSpawnInvulnerable();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get invulnerable ticks remaining
|
|
||||||
+ *
|
|
||||||
+ * @return Invulnerable ticks
|
|
||||||
+ */
|
|
||||||
+ int getSpawnInvulnerableTicks();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Set invulnerable ticks remaining
|
|
||||||
+ *
|
|
||||||
+ * @param invulnerableTicks Invulnerable ticks remaining
|
|
||||||
+ */
|
|
||||||
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||||
+ * <p>
|
+ * <p>
|
||||||
+ * Clients may be inconsistent in displaying it.
|
+ * Clients may be inconsistent in displaying it.
|
||||||
@@ -1491,7 +1457,7 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79bae12d95 100644
|
index 0af73cc04edb93b9772136d4d808f657ea40e733..c733206b769d7a55076d863757fcac1a129033b7 100644
|
||||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||||
@@ -1513,8 +1479,8 @@ index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a stack of items.
|
* Represents a stack of items.
|
||||||
@@ -986,4 +998,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
@@ -1005,4 +1017,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||||
return livingEntity.damageItemStack(this, amount);
|
return type.isAir() || amount <= 0;
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
+
|
+
|
||||||
@@ -2266,18 +2232,10 @@ index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a
|
|||||||
{
|
{
|
||||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|
||||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
|
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||||
index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f026703cb80 100644
|
index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf235eba7e89 100644
|
||||||
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
|
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||||
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
|
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||||
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
|
@@ -32,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
import java.util.Map;
|
|
||||||
import java.util.NoSuchElementException;
|
|
||||||
import org.bukkit.Color;
|
|
||||||
+import org.bukkit.NamespacedKey;
|
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
|
||||||
import org.bukkit.configuration.serialization.SerializableAs;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
@@ -31,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
|
|
||||||
private static final String AMBIENT = "ambient";
|
private static final String AMBIENT = "ambient";
|
||||||
private static final String PARTICLES = "has-particles";
|
private static final String PARTICLES = "has-particles";
|
||||||
private static final String ICON = "has-icon";
|
private static final String ICON = "has-icon";
|
||||||
@@ -2292,7 +2250,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a potion effect.
|
* Creates a potion effect.
|
||||||
@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -50,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
||||||
*/
|
*/
|
||||||
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
|
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
|
||||||
@@ -2329,7 +2287,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.duration = duration;
|
this.duration = duration;
|
||||||
@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -57,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
this.ambient = ambient;
|
this.ambient = ambient;
|
||||||
this.particles = particles;
|
this.particles = particles;
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
@@ -2337,7 +2295,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -104,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
* @param map the map to deserialize from
|
* @param map the map to deserialize from
|
||||||
*/
|
*/
|
||||||
public PotionEffect(@NotNull Map<String, Object> map) {
|
public PotionEffect(@NotNull Map<String, Object> map) {
|
||||||
@@ -2387,8 +2345,8 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
+
|
+
|
||||||
@NotNull
|
@NotNull
|
||||||
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
|
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
|
||||||
int type = getInt(map, TYPE);
|
PotionEffectType effect;
|
||||||
@@ -159,17 +200,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -166,17 +206,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2407,21 +2365,16 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
@NotNull
|
@NotNull
|
||||||
public Map<String, Object> serialize() {
|
public Map<String, Object> serialize() {
|
||||||
- return ImmutableMap.<String, Object>builder()
|
- return ImmutableMap.<String, Object>builder()
|
||||||
- .put(TYPE, type.getId())
|
|
||||||
- .put(DURATION, duration)
|
|
||||||
- .put(AMPLIFIER, amplifier)
|
|
||||||
- .put(AMBIENT, ambient)
|
|
||||||
- .put(PARTICLES, particles)
|
|
||||||
- .put(ICON, icon)
|
|
||||||
- .build();
|
|
||||||
+ // Purpur start - add key, don't serialize if null.
|
+ // Purpur start - add key, don't serialize if null.
|
||||||
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
|
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
|
||||||
+ .put(TYPE, type.getId())
|
.put(TYPE, type.getKey().toString())
|
||||||
+ .put(DURATION, duration)
|
.put(DURATION, duration)
|
||||||
+ .put(AMPLIFIER, amplifier)
|
.put(AMPLIFIER, amplifier)
|
||||||
+ .put(AMBIENT, ambient)
|
.put(AMBIENT, ambient)
|
||||||
+ .put(PARTICLES, particles)
|
.put(PARTICLES, particles)
|
||||||
+ .put(ICON, icon);
|
- .put(ICON, icon)
|
||||||
|
- .build();
|
||||||
|
+ .put(ICON, icon);
|
||||||
+ if(key != null) {
|
+ if(key != null) {
|
||||||
+ builder.put(KEY, key.toString());
|
+ builder.put(KEY, key.toString());
|
||||||
+ }
|
+ }
|
||||||
@@ -2430,7 +2383,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -200,7 +256,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PotionEffect that = (PotionEffect) obj;
|
PotionEffect that = (PotionEffect) obj;
|
||||||
@@ -2439,7 +2392,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -296,6 +352,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2464,7 +2417,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 1;
|
int hash = 1;
|
||||||
@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
@@ -310,6 +384,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@@ -4128,18 +4081,3 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6ce
|
|||||||
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
|
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
|
||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
|
||||||
index 06e96e5c98f1a7a68c8b4b5e527314c1aa774e38..49bba9a7a02b9cf3a552583315eff2b7dbe060c0 100644
|
|
||||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
|
||||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
|
||||||
@@ -47,6 +47,10 @@ public class AnnotationTest {
|
|
||||||
"org/bukkit/plugin/java/PluginClassLoader",
|
|
||||||
// Generic functional interface
|
|
||||||
"org/bukkit/util/Consumer",
|
|
||||||
+ // Purpur start
|
|
||||||
+ "gg/pufferfish/pufferfish/sentry/SentryContext",
|
|
||||||
+ "gg/pufferfish/pufferfish/sentry/SentryContext$State",
|
|
||||||
+ // Purpur end
|
|
||||||
// Paper start
|
|
||||||
"io/papermc/paper/util/TransformingRandomAccessList",
|
|
||||||
"io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator",
|
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Wed, 6 Sep 2023 12:43:06 +0900
|
|
||||||
Subject: [PATCH] Bump-Dependencies
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 0c557f34ed438980c6fd9d6a8bce7c1152468735..8f1fbec343461c83a6df141f7aa939e26e6e139e 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -11,8 +11,8 @@ java {
|
|
||||||
val annotationsVersion = "24.0.1"
|
|
||||||
val bungeeCordChatVersion = "1.20-R0.1"
|
|
||||||
val adventureVersion = "4.14.0"
|
|
||||||
-val slf4jVersion = "1.8.0-beta4"
|
|
||||||
-val log4jVersion = "2.17.1"
|
|
||||||
+val slf4jVersion = "2.0.9" // Plazma - Bump Dependencies
|
|
||||||
+val log4jVersion = "2.20.0" // Plazma - Bump Dependencies
|
|
||||||
val apiAndDocs: Configuration by configurations.creating {
|
|
||||||
attributes {
|
|
||||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
|
||||||
@@ -27,16 +27,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("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:$bungeeCordChatVersion-deprecated+build.14") // Paper
|
|
||||||
- api("org.yaml:snakeyaml:2.0")
|
|
||||||
+ api("org.yaml:snakeyaml:2.2") // 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")
|
|
||||||
@@ -46,31 +46,31 @@ dependencies {
|
|
||||||
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
|
||||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
|
||||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
|
||||||
- api("io.sentry:sentry:5.4.0") // Pufferfish
|
|
||||||
+ 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")
|
|
||||||
- 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") // 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:$annotationsVersion" // Paper - we don't want Java 5 annotations...
|
|
||||||
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("junit:junit:4.13.2")
|
|
||||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
|
||||||
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
|
|
||||||
+ testImplementation("junit:junit:4.13.2") // Plazma - Bump Dependencies
|
|
||||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
|
||||||
testImplementation("org.ow2.asm:asm-tree:9.5")
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Publish-Packages
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 1261dbb7a1c22860922afd0ac8c341aea3569df3..299ce875ee51294d87b31571b624a7991e0fdb1c 100644
|
index 6c0df825238ca037abeb2ba619983b6f554180ea..54da0cab8681daac2dd9fbf0eb94de471819d4c8 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -163,3 +163,22 @@ tasks.check {
|
@@ -171,3 +171,22 @@ tasks.check {
|
||||||
dependsOn(scanJar)
|
dependsOn(scanJar)
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
19
patches/api/0006-Implement-No-Chat-Reports.patch
Normal file
19
patches/api/0006-Implement-No-Chat-Reports.patch
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Thu, 28 Sep 2023 12:21:36 +0900
|
||||||
|
Subject: [PATCH] Implement No Chat Reports
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||||
|
index 2eb13c049fa917d41fa9ad17fdec9ec4c33701a8..5d50f83a76affc74f989870ca1bc8d7a75f3b2ba 100644
|
||||||
|
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||||
|
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||||
|
@@ -215,6 +215,8 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
||||||
|
* Fallback cause
|
||||||
|
*/
|
||||||
|
UNKNOWN,
|
||||||
|
+
|
||||||
|
+ NCR_NOT_INSTALLED, // Plazma - Implement No Chat Reports
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,28 @@ Date: Tue, 30 May 2023 12:12:29 +0900
|
|||||||
Subject: [PATCH] MC Dev fixes
|
Subject: [PATCH] MC Dev fixes
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
index b0b2cbd8d9db1772d43a285eca9060f3879acab0..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644
|
||||||
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
@@ -604,15 +604,6 @@ public class Metrics {
|
||||||
|
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||||
|
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||||
|
metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||||
|
- final String paperVersion;
|
||||||
|
- final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
||||||
|
- if (implVersion != null) {
|
||||||
|
- final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||||
|
- paperVersion = "git-Pufferfish-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Pufferfish
|
||||||
|
- } else {
|
||||||
|
- paperVersion = "unknown";
|
||||||
|
- }
|
||||||
|
- metrics.addCustomChart(new Metrics.SimplePie("pufferfish_version", () -> paperVersion)); // Pufferfish
|
||||||
|
|
||||||
|
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||||
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||||
index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b4bf154a8 100644
|
index 733134401fcba393053c7a2dfa1d0d44f8f79ff5..17d931ef47846b59e28dc0c5b5ae91396a1d3e7d 100644
|
||||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
--- a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
+++ b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||||
@@ -71,14 +71,14 @@ public class LeavesFix extends DataFix {
|
@@ -71,14 +71,14 @@ public class LeavesFix extends DataFix {
|
||||||
@@ -15,15 +35,15 @@ index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b
|
|||||||
- Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed) -> {
|
- Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed) -> {
|
||||||
- Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed.getAllTyped(opticFinder3).stream().map((typedx) -> {
|
- Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed.getAllTyped(opticFinder3).stream().map((typedx) -> {
|
||||||
- return new LeavesFix.LeavesSection(typedx, this.getInputSchema());
|
- return new LeavesFix.LeavesSection(typedx, this.getInputSchema());
|
||||||
+ Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed2x) -> {
|
+ Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed2x) -> { // Plazma - decompile fix
|
||||||
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> {
|
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> { // Plazma - decompile fix
|
||||||
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema());
|
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema()); // Plazma - decompile fix
|
||||||
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
|
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
|
||||||
return leavesSection;
|
return leavesSection;
|
||||||
})));
|
})));
|
||||||
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
|
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
|
||||||
- return typed;
|
- return typed;
|
||||||
+ return typed2x;
|
+ return typed2x; // Plazma - decompile fix
|
||||||
} else {
|
} else {
|
||||||
List<IntSet> list = Lists.newArrayList();
|
List<IntSet> list = Lists.newArrayList();
|
||||||
|
|
||||||
@@ -33,8 +53,8 @@ index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b
|
|||||||
|
|
||||||
- return typed.updateTyped(opticFinder3, (typedx) -> {
|
- return typed.updateTyped(opticFinder3, (typedx) -> {
|
||||||
- return int2ObjectMap.get(typedx.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx);
|
- return int2ObjectMap.get(typedx.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx);
|
||||||
+ return typed.updateTyped(opticFinder3, (typedx2) -> {
|
+ return typed.updateTyped(opticFinder3, (typedx2) -> { // Plazma - decompile fix
|
||||||
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2);
|
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2); // Plazma - decompile fix
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -44,8 +64,8 @@ index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b
|
|||||||
Optional<List<Pair<String, Dynamic<?>>>> optional = typed.getOptional(this.paletteFinder);
|
Optional<List<Pair<String, Dynamic<?>>>> optional = typed.getOptional(this.paletteFinder);
|
||||||
- this.palette = optional.map((list) -> {
|
- this.palette = optional.map((list) -> {
|
||||||
- return list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
- return list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
||||||
+ this.palette = (java.util.List)optional.map((list) -> {
|
+ this.palette = (List) optional.map((list) -> { // Plazma - decompile fix
|
||||||
+ return (java.util.List)list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
+ return (List) list.stream().map(Pair::getSecond).collect(Collectors.toList()); // Plazma - decompile fix
|
||||||
}).orElse(ImmutableList.of());
|
}).orElse(ImmutableList.of());
|
||||||
Dynamic<?> dynamic = typed.get(DSL.remainderFinder());
|
Dynamic<?> dynamic = typed.get(DSL.remainderFinder());
|
||||||
this.index = dynamic.get("Y").asInt(0);
|
this.index = dynamic.get("Y").asInt(0);
|
||||||
@@ -54,22 +74,7 @@ index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b
|
|||||||
return this.isSkippable() ? typed : typed.update(DSL.remainderFinder(), (dynamic) -> {
|
return this.isSkippable() ? typed : typed.update(DSL.remainderFinder(), (dynamic) -> {
|
||||||
return dynamic.set("BlockStates", dynamic.createLongList(Arrays.stream(this.storage.getRaw())));
|
return dynamic.set("BlockStates", dynamic.createLongList(Arrays.stream(this.storage.getRaw())));
|
||||||
- }).set(this.paletteFinder, this.palette.stream().map((dynamic) -> {
|
- }).set(this.paletteFinder, this.palette.stream().map((dynamic) -> {
|
||||||
+ }).set(this.paletteFinder, (java.util.List)this.palette.stream().map((dynamic) -> {
|
+ }).set(this.paletteFinder, (List) this.palette.stream().map((dynamic) -> { // Plazma - decompile fix
|
||||||
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java b/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
|
||||||
index 6e971a9891e43b971d439c3ca11eff8965f3dae9..da1b5c6b68f14969b85472826d3d36ca673a0e5a 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
|
||||||
@@ -31,8 +31,8 @@ public class EntryGroup extends CompositeEntryBase {
|
|
||||||
};
|
|
||||||
default:
|
|
||||||
return (context, lootChoiceExpander) -> {
|
|
||||||
- for(ComposableEntryContainer composableEntryContainer : children) {
|
|
||||||
- composableEntryContainer.expand(context, lootChoiceExpander);
|
|
||||||
+ for(ComposableEntryContainer composableEntryContainer3 : children) { // Plazma - decompile fix
|
|
||||||
+ composableEntryContainer3.expand(context, lootChoiceExpander);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 139e2b17b899da6f0147bb8b4412e2e54e817be4..d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7 100644
|
index 393dab1ece76e0ca1e0b58c0b2c72d5c1c41a84d..cfb74b11743ce2f7a78a6a8085f9dd05b65a3152 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
||||||
@@ -17,7 +17,7 @@ index 139e2b17b899da6f0147bb8b4412e2e54e817be4..d8b27e3f2fa1ede41125ec27e129b1e1
|
|||||||
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||||
exclude("io.papermc.paper", "paper-api")
|
exclude("io.papermc.paper", "paper-api")
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ tasks.jar {
|
@@ -87,7 +87,7 @@ tasks.jar {
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
"Implementation-Title" to "CraftBukkit",
|
||||||
@@ -131,7 +131,7 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..19d1d136fc28d6c114f6bc44c6450d2d
|
|||||||
.completer(new ConsoleCommandCompleter(this.server))
|
.completer(new ConsoleCommandCompleter(this.server))
|
||||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
||||||
index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52658f0689 100644
|
index ed3527612315e6e0649182ce4e1ae2834b0918a9..ae02c029f0169d30a34d4a4e65ea6cb4fa498111 100644
|
||||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
+++ b/src/main/java/net/minecraft/CrashReport.java
|
||||||
@@ -35,7 +35,7 @@ public class CrashReport {
|
@@ -35,7 +35,7 @@ public class CrashReport {
|
||||||
@@ -153,13 +153,13 @@ 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 dae36c6452ccd57a436dd918547b64d59957ab0a..a8bf67cf0c579c407befe17d735440f1128d98c4 100644
|
index 27a238cc56702297c88fde0f379178222ccf6c5b..30fc258faa6f087cf3c91411b48116a3ac416031 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
|
||||||
@@ -112,6 +112,18 @@ public class Main {
|
@@ -108,6 +108,18 @@ public class Main {
|
||||||
|
*/ // CraftBukkit end
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
+ // Plazma start - Branding
|
+ // Plazma start - Branding
|
||||||
+ System.out.println("""
|
+ System.out.println("""
|
||||||
+ \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\s
|
+ \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\s
|
||||||
@@ -172,14 +172,14 @@ index dae36c6452ccd57a436dd918547b64d59957ab0a..a8bf67cf0c579c407befe17d735440f1
|
|||||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public 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
|
||||||
+
|
+
|
||||||
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
|
// Paper start
|
||||||
|
if (Boolean.getBoolean("Paper.isRunDev")) {
|
||||||
if (path != null) {
|
net.minecraft.server.packs.VanillaPackResourcesBuilder.developmentConfig = builder -> {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index e6ddf69ade7ae51640569150f7db10d1afa63691..77b40f3d7162befe4da29a60b3de2b93b261412c 100644
|
index 8c3942d9ce4f8a102a47bec74af5911760fda4e3..cf9f7d52b07cffd41293ba5a6fab3a7f77a2cf03 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -925,7 +925,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -914,7 +914,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
shutdownThread = Thread.currentThread();
|
shutdownThread = Thread.currentThread();
|
||||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
if (!isSameThread()) {
|
if (!isSameThread()) {
|
||||||
@@ -220,10 +220,10 @@ index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326
|
|||||||
servergui.runFinalizers();
|
servergui.runFinalizers();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 80ab17142c34d576409e5fb353ff31db9673b2c0..32bd43692b701b49776c10d9c4332bb41322b9fa 100644
|
index 75622ee77096d7eb311df0fd16b70c0f6dae3ccc..0325eada6271f021b4cc6e398b6e3e75b915f8aa 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1034,7 +1034,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1321,7 +1321,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
||||||
// Spigot start
|
// Spigot start
|
||||||
if (tickingblockentity == null) {
|
if (tickingblockentity == null) {
|
||||||
@@ -233,10 +233,10 @@ index 80ab17142c34d576409e5fb353ff31db9673b2c0..32bd43692b701b49776c10d9c4332bb4
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
index 81554c321a78258ff78da3801f00d0fb90b9e113..ba2eab8a835c2396fca25d7993443d5db26c9c16 100644
|
index db571f658f636cdda1dcdbaffa0c4da67fae11ad..0ba8a251bf1f5a7a6f27823686bf0d636feba769 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -156,7 +156,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -153,7 +153,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||||
@@ -246,10 +246,10 @@ index 81554c321a78258ff78da3801f00d0fb90b9e113..ba2eab8a835c2396fca25d7993443d5d
|
|||||||
|
|
||||||
private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
|
private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index b08d4a2a74392b1d59b1eeeab3108103d83ad96c..8833a66f43e9a4ac486fa67db9e8147007917e15 100644
|
index a7081f2ce7e001c9a75b620c55703a0218f6dc28..005c854a10f343cd7488b282de002249bf5c4ced 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -267,7 +267,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
import javax.annotation.Nonnull; // Paper
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
@@ -259,7 +259,7 @@ index b08d4a2a74392b1d59b1eeeab3108103d83ad96c..8833a66f43e9a4ac486fa67db9e81470
|
|||||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||||
private final Logger logger = Logger.getLogger("Minecraft");
|
private final Logger logger = Logger.getLogger("Minecraft");
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
index b473f89c59c0fc080fadd0d4db320895e917fd41..cdf28d1b5da2f602b020142d5bfc37922e315718 100644
|
index 465e63a5849e224d86e82ef6c31c99846245e63b..2a384f70d14189af1690caba35b8202da519caf9 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
@@ -335,7 +335,7 @@ index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa453
|
|||||||
serverModName = getString("settings.server-mod-name", serverModName);
|
serverModName = getString("settings.server-mod-name", serverModName);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
index 0801dea155048ac5383295f4fef9bd597b678535..efd83400279df0beafd3b8f0e82d0f3af209554a 100644
|
index dbd502761ff6e6efb252bb41376a7ff028c73895..c765cb5dd8c3c1b668b7031e6c784ed9cf2d58e1 100644
|
||||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Wed, 6 Sep 2023 13:31:43 +0900
|
|
||||||
Subject: [PATCH] Bump-Dependencies
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7..2c59ed16ea909b6535df3d1d40d83b065c03d041 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -20,7 +20,7 @@ dependencies {
|
|
||||||
}
|
|
||||||
// Purpur end
|
|
||||||
// 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")
|
|
||||||
implementation("net.kyori:adventure-text-serializer-ansi:4.14.0") // Keep in sync with adventureVersion from Paper-API build file
|
|
||||||
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
|
|
||||||
@@ -30,48 +30,48 @@ 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.19.0") // Paper - implementation
|
|
||||||
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
|
|
||||||
+ implementation("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - implementation
|
|
||||||
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - Needed to generate meta for our Log4j plugins
|
|
||||||
runtimeOnly(log4jPlugins.output)
|
|
||||||
alsoShade(log4jPlugins.output)
|
|
||||||
- implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol
|
|
||||||
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
|
|
||||||
// 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
|
|
||||||
+ implementation("org.ow2.asm:asm:9.5")
|
|
||||||
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
|
|
||||||
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - switch to mockito
|
|
||||||
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.42.0.0")
|
|
||||||
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation
|
|
||||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
|
||||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
|
||||||
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") {
|
|
||||||
isTransitive = false
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
- 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")
|
|
||||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15")
|
|
||||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15")
|
|
||||||
|
|
||||||
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
|
||||||
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
|
||||||
implementation("dev.omega24:upnp4j:1.0") // Purpur
|
|
||||||
|
|
||||||
// Pufferfish start
|
|
||||||
- implementation("org.yaml:snakeyaml:1.32")
|
|
||||||
+ implementation("org.yaml:snakeyaml:2.2")
|
|
||||||
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
|
||||||
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
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
|
||||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
|
||||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2")
|
|
||||||
|
|
||||||
- implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty
|
|
||||||
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty
|
|
||||||
}
|
|
||||||
|
|
||||||
val craftbukkitPackageVersion = "1_20_R1" // Paper
|
|
||||||
@@ -225,3 +225,6 @@ tasks.registerRunTask("runDev") {
|
|
||||||
description = "Spin up a non-relocated Mojang-mapped test server"
|
|
||||||
classpath(sourceSets.main.map { it.runtimeClasspath })
|
|
||||||
}
|
|
||||||
+repositories {
|
|
||||||
+ mavenCentral()
|
|
||||||
+}
|
|
||||||
@@ -104,10 +104,10 @@ index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..28a1d21900dbff4b9d1887b9aa4e68f4
|
|||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abdd74a489f 100644
|
index 9b5c2abaa28fa60cedd9f0111e5eb018f93a0561..c09baea03786075d1a6e3f53d7f9820e23cc57cf 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
@@ -135,7 +135,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
@@ -136,7 +136,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||||
SpigotConfig.readConfig(SpigotWorldConfig.class, this);
|
SpigotConfig.readConfig(SpigotWorldConfig.class, this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -116,7 +116,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
|||||||
|
|
||||||
|
|
||||||
public PaperConfigurations(final Path globalFolder) {
|
public PaperConfigurations(final Path globalFolder) {
|
||||||
@@ -300,7 +300,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
@@ -308,7 +308,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,12 +125,10 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
|||||||
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig);
|
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,18 +399,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
@@ -409,17 +409,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||||
|
|
||||||
private static boolean needsConverting(final Path legacyConfig) {
|
|
||||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||||
- }
|
}
|
||||||
-
|
|
||||||
- @Deprecated
|
- @Deprecated
|
||||||
- public YamlConfiguration createLegacyObject(final MinecraftServer server) {
|
- public YamlConfiguration createLegacyObject(final MinecraftServer server) {
|
||||||
- YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
|
- YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
|
||||||
@@ -141,11 +139,11 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
|||||||
- }
|
- }
|
||||||
- return global;
|
- return global;
|
||||||
- }
|
- }
|
||||||
+ }
|
-
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||||
@@ -434,9 +423,15 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
YamlConfiguration config = new YamlConfiguration();
|
||||||
|
@@ -442,9 +431,15 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Symlinks are not correctly checked in createDirectories
|
// Symlinks are not correctly checked in createDirectories
|
||||||
@@ -158,15 +156,15 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
|||||||
+
|
+
|
||||||
+ // Plazma start
|
+ // Plazma start
|
||||||
+ protected int getWorldConfigurationCurrentVersion() {
|
+ protected int getWorldConfigurationCurrentVersion() {
|
||||||
+ return WorldConfiguration.CURRENT_VERSION;
|
+ return WorldConfiguration.CURRENT_VERSION;
|
||||||
+ }
|
+ }
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 77b40f3d7162befe4da29a60b3de2b93b261412c..0acbaa18a61d1cfdb894c6c756d2b9bdc3599b82 100644
|
index cf9f7d52b07cffd41293ba5a6fab3a7f77a2cf03..11de2f237e6dd950b8ddba3d5cfe9066d09f0903 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -301,6 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public final double[] recentTps = new double[ 4 ]; // Purpur
|
public final double[] recentTps = new double[ 4 ]; // Purpur
|
||||||
// Spigot end
|
// Spigot end
|
||||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
||||||
@@ -174,14 +172,14 @@ index 77b40f3d7162befe4da29a60b3de2b93b261412c..0acbaa18a61d1cfdb894c6c756d2b9bd
|
|||||||
public static long currentTickLong = 0L; // Paper
|
public static long currentTickLong = 0L; // Paper
|
||||||
public boolean lagging = false; // Purpur
|
public boolean lagging = false; // Purpur
|
||||||
protected boolean upnp = false; // Purpur
|
protected boolean upnp = false; // Purpur
|
||||||
@@ -412,6 +413,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -411,6 +412,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Paper end
|
|
||||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||||
|
// CraftBukkit end
|
||||||
this.paperConfigurations = services.paperConfigurations(); // Paper
|
this.paperConfigurations = services.paperConfigurations(); // Paper
|
||||||
+ this.plazmaConfigurations = services.plazmaConfigurations(); // Plazma
|
+ this.plazmaConfigurations = services.plazmaConfigurations(); // Plazma
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
|
private void readScoreboard(DimensionDataStorage persistentStateManager) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
|
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
|
||||||
index a9b2c8cd4dcd3f884e4306bebee9334d3848fce5..203c34342f19c6afb3020364baf0cc48554fa912 100644
|
index a9b2c8cd4dcd3f884e4306bebee9334d3848fce5..203c34342f19c6afb3020364baf0cc48554fa912 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Services.java
|
--- a/src/main/java/net/minecraft/server/Services.java
|
||||||
@@ -227,21 +225,19 @@ index a9b2c8cd4dcd3f884e4306bebee9334d3848fce5..203c34342f19c6afb3020364baf0cc48
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 2a70abb9e0af502885593df1e732887cd9d2ce4d..e6f14bb0825e3b6987ebb2ec782c8316e3b7c094 100644
|
index a9f74eeb5b6300a0b7a940da9c17bd7582b0925d..a970e00482952318c258fc406cb7c39a229b65bc 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -209,6 +209,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -209,6 +209,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
|
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
|
||||||
paperConfigurations.initializeGlobalConfiguration();
|
paperConfigurations.initializeGlobalConfiguration();
|
||||||
paperConfigurations.initializeWorldDefaultsConfiguration();
|
paperConfigurations.initializeWorldDefaultsConfiguration();
|
||||||
+ // Plazma start
|
+ plazmaConfigurations.initializeGlobalConfiguration(); // Plazma
|
||||||
+ plazmaConfigurations.initializeGlobalConfiguration();
|
+ plazmaConfigurations.initializeWorldDefaultsConfiguration(); // Plazma
|
||||||
+ plazmaConfigurations.initializeWorldDefaultsConfiguration();
|
|
||||||
+ // Plazma end
|
|
||||||
// Paper start - moved up to right after PlayerList creation but before file load/save
|
// Paper start - moved up to right after PlayerList creation but before file load/save
|
||||||
if (this.convertOldUsers()) {
|
if (this.convertOldUsers()) {
|
||||||
this.getProfileCache().save(false); // Paper
|
this.getProfileCache().save(false); // Paper
|
||||||
@@ -218,6 +222,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -218,6 +220,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash);
|
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash);
|
||||||
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
|
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
||||||
@@ -250,10 +246,10 @@ index 2a70abb9e0af502885593df1e732887cd9d2ce4d..e6f14bb0825e3b6987ebb2ec782c8316
|
|||||||
// Purpur start
|
// Purpur start
|
||||||
try {
|
try {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 221d1d0e1b4b46de6ebca5faac09bbda875fae17..e009dba395779e2c89a36fe4524e5d40474a29e6 100644
|
index 670d7649d25f7704b071d27157173a3139481207..e7efdd572716e50ecca217898b8a368e5829f925 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -650,7 +650,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -694,7 +694,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||||
|
|
||||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||||
@@ -263,7 +259,7 @@ index 221d1d0e1b4b46de6ebca5faac09bbda875fae17..e009dba395779e2c89a36fe4524e5d40
|
|||||||
this.convertable = convertable_conversionsession;
|
this.convertable = convertable_conversionsession;
|
||||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 9fb140b3b6a0c621466b85a6ec7df765a4e823b0..08f9af1d7aebba943096b59b6452818a1aafc94c 100644
|
index 0325eada6271f021b4cc6e398b6e3e75b915f8aa..e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -174,7 +174,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -174,7 +174,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@@ -280,12 +276,12 @@ index 9fb140b3b6a0c621466b85a6ec7df765a4e823b0..08f9af1d7aebba943096b59b6452818a
|
|||||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||||
@@ -328,9 +333,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -254,9 +259,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@Override public final int getHeight() { return this.height; }
|
|
||||||
// Pufferfish end
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
||||||
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma
|
||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||||
+ this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma
|
+ this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma
|
||||||
@@ -293,10 +289,10 @@ index 9fb140b3b6a0c621466b85a6ec7df765a4e823b0..08f9af1d7aebba943096b59b6452818a
|
|||||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||||
this.generator = gen;
|
this.generator = gen;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e179452bf4f6c 100644
|
index 005c854a10f343cd7488b282de002249bf5c4ced..3e8f42811e9254567f2522e68b6018704bd63ae2 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1071,6 +1071,7 @@ public final class CraftServer implements Server {
|
@@ -1053,6 +1053,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
@@ -304,7 +300,7 @@ index 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e1794
|
|||||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
@@ -3004,6 +3005,13 @@ public final class CraftServer implements Server {
|
@@ -2986,6 +2987,13 @@ public final class CraftServer implements Server {
|
||||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +315,7 @@ index 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e1794
|
|||||||
@Override
|
@Override
|
||||||
public YamlConfiguration getPurpurConfig() {
|
public YamlConfiguration getPurpurConfig() {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 9a3374a1236164194ef0df43ed639296cbe1c731..affd4c6267f60cbae75b6e6a09990144a1f1e1f0 100644
|
index 01f581e6c3dfacb0ec6aff05c08539bbd2e580c7..f1b754fbf72cbf3c10a74192c66a9432d8218d4b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -173,6 +173,14 @@ public class Main {
|
@@ -173,6 +173,14 @@ public class Main {
|
||||||
@@ -582,39 +578,59 @@ index 0000000000000000000000000000000000000000..85002144e0b350c4ae044e1a4a4c1734
|
|||||||
+}
|
+}
|
||||||
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
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..6714947455c1e4c887a5f13ba1a3aeb57324ee0a
|
index 0000000000000000000000000000000000000000..d506e0c2b37f91e46e682652bd134ad91db28f84
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
@@ -0,0 +1,23 @@
|
@@ -0,0 +1,43 @@
|
||||||
+package org.plazmamc.plazma.configurations;
|
+package org.plazmamc.plazma.configurations;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.configuration.Configuration;
|
+import io.papermc.paper.configuration.Configuration;
|
||||||
+import io.papermc.paper.configuration.ConfigurationPart;
|
+import io.papermc.paper.configuration.ConfigurationPart;
|
||||||
|
+import org.jetbrains.annotations.NotNull;
|
||||||
+import org.spongepowered.configurate.objectmapping.meta.Setting;
|
+import org.spongepowered.configurate.objectmapping.meta.Setting;
|
||||||
+
|
+
|
||||||
+@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
|
+@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"})
|
||||||
+public class GlobalConfiguration extends ConfigurationPart {
|
+public class GlobalConfiguration extends ConfigurationPart {
|
||||||
+ static final int CURRENT_VERSION = 1;
|
+ static final int CURRENT_VERSION = 1;
|
||||||
+ static final boolean DO_OPTIMIZE = !Boolean.getBoolean("Plazma.disableConfigOptimization");
|
+ static final boolean DO_OPTIMIZE = PlazmaConfigurations.doOptimize();
|
||||||
+ private static GlobalConfiguration instance;
|
+ private static GlobalConfiguration instance;
|
||||||
+
|
+
|
||||||
+ public static GlobalConfiguration get() {
|
+ public static GlobalConfiguration get() {
|
||||||
+ return instance;
|
+ return instance;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ static void set(GlobalConfiguration instance) {
|
+ static void set(@NotNull GlobalConfiguration instance, boolean test) {
|
||||||
+ GlobalConfiguration.instance = instance;
|
+ GlobalConfiguration.instance = instance;
|
||||||
|
+ if (test) {
|
||||||
|
+
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Setting(Configuration.VERSION_FIELD)
|
+ @Setting(Configuration.VERSION_FIELD)
|
||||||
+ public int version = CURRENT_VERSION;
|
+ public int version = CURRENT_VERSION;
|
||||||
|
+
|
||||||
|
+ public Misc misc;
|
||||||
|
+ public class Misc extends ConfigurationPart.Post {
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void postProcess() {
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public Player player;
|
||||||
|
+ public class Player extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..857ddc62dd9affbbebcd7cde8a6d675dbb5f68ae
|
index 0000000000000000000000000000000000000000..d990c031255daf0d43541efe175c5b52736a6990
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
@@ -0,0 +1,25 @@
|
@@ -0,0 +1,45 @@
|
||||||
+package org.plazmamc.plazma.configurations;
|
+package org.plazmamc.plazma.configurations;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.configuration.Configuration;
|
+import io.papermc.paper.configuration.Configuration;
|
||||||
@@ -623,10 +639,10 @@ index 0000000000000000000000000000000000000000..857ddc62dd9affbbebcd7cde8a6d675d
|
|||||||
+import net.minecraft.resources.ResourceLocation;
|
+import net.minecraft.resources.ResourceLocation;
|
||||||
+import org.spongepowered.configurate.objectmapping.meta.Setting;
|
+import org.spongepowered.configurate.objectmapping.meta.Setting;
|
||||||
+
|
+
|
||||||
+@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
|
+@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"})
|
||||||
+public class LevelConfigurations extends ConfigurationPart {
|
+public class LevelConfigurations extends ConfigurationPart {
|
||||||
+ public static final int CURRENT_VERSION = 1;
|
+ public static final int CURRENT_VERSION = 1;
|
||||||
+ private static final boolean DO_OPTIMIZE = !Boolean.getBoolean("Plazma.disableConfigOptimization");
|
+ private static final boolean DO_OPTIMIZE = PlazmaConfigurations.doOptimize();
|
||||||
+
|
+
|
||||||
+ private transient final ResourceLocation worldKey;
|
+ private transient final ResourceLocation worldKey;
|
||||||
+ public LevelConfigurations(ResourceLocation worldKey) {
|
+ public LevelConfigurations(ResourceLocation worldKey) {
|
||||||
@@ -639,13 +655,33 @@ index 0000000000000000000000000000000000000000..857ddc62dd9affbbebcd7cde8a6d675d
|
|||||||
+
|
+
|
||||||
+ @Setting(Configuration.VERSION_FIELD)
|
+ @Setting(Configuration.VERSION_FIELD)
|
||||||
+ public int version = CURRENT_VERSION;
|
+ public int version = CURRENT_VERSION;
|
||||||
|
+
|
||||||
|
+ public Misc misc;
|
||||||
|
+ public class Misc extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public Entity entity;
|
||||||
|
+ public class Entity extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public Structure structure;
|
||||||
|
+ public class Structure extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public NetherPortal netherPortal;
|
||||||
|
+ public class NetherPortal extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
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..481392f3ed3b746172dbf319a583ca5751bc0b35
|
index 0000000000000000000000000000000000000000..295578fddc8f897763d0af9836cdd93b0d3cef31
|
||||||
--- /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,309 @@
|
||||||
+package org.plazmamc.plazma.configurations;
|
+package org.plazmamc.plazma.configurations;
|
||||||
+
|
+
|
||||||
+import com.google.common.collect.Table;
|
+import com.google.common.collect.Table;
|
||||||
@@ -675,6 +711,8 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+import net.minecraft.world.entity.EntityType;
|
+import net.minecraft.world.entity.EntityType;
|
||||||
+import net.minecraft.world.item.Item;
|
+import net.minecraft.world.item.Item;
|
||||||
+import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
+import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||||
|
+import org.jetbrains.annotations.Contract;
|
||||||
|
+import org.jetbrains.annotations.NotNull;
|
||||||
+import org.jetbrains.annotations.VisibleForTesting;
|
+import org.jetbrains.annotations.VisibleForTesting;
|
||||||
+import org.slf4j.Logger;
|
+import org.slf4j.Logger;
|
||||||
+import org.spongepowered.configurate.*;
|
+import org.spongepowered.configurate.*;
|
||||||
@@ -701,6 +739,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ 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-defaults.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";
|
||||||
|
+ static final boolean OPTIMIZE_CONFIG = !Boolean.getBoolean("Plazma.disableConfigOptimization");
|
||||||
+
|
+
|
||||||
+ private static final String HEADER_START = """
|
+ private static final String HEADER_START = """
|
||||||
+ # English
|
+ # English
|
||||||
@@ -725,8 +764,6 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+
|
+
|
||||||
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
|
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
|
||||||
+ Discord: https://discord.gg/MmfC52K8A8
|
+ Discord: https://discord.gg/MmfC52K8A8
|
||||||
+ Twitter: *COMMING SOON*
|
|
||||||
+ Naver Cafe: *COMMING SOON*
|
|
||||||
+ """;
|
+ """;
|
||||||
+
|
+
|
||||||
+ private static final Function<Configurations.ContextMap, String> LEVEL_SPECIFIC_HEADER = map -> String.format("""
|
+ private static final Function<Configurations.ContextMap, String> LEVEL_SPECIFIC_HEADER = map -> String.format("""
|
||||||
@@ -750,8 +787,6 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+
|
+
|
||||||
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
|
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
|
||||||
+ Discord: https://discord.gg/MmfC52K8A8
|
+ Discord: https://discord.gg/MmfC52K8A8
|
||||||
+ Twitter: *COMMING SOON*
|
|
||||||
+ Naver Cafe: *COMMING SOON*
|
|
||||||
+ """, PaperConfigurations.CONFIG_DIR, LEVEL_DEFAULT_CONFIGURATION_FILE_NAME, PaperConfigurations.CONFIG_DIR, LEVEL_DEFAULT_CONFIGURATION_FILE_NAME,
|
+ """, PaperConfigurations.CONFIG_DIR, LEVEL_DEFAULT_CONFIGURATION_FILE_NAME, PaperConfigurations.CONFIG_DIR, LEVEL_DEFAULT_CONFIGURATION_FILE_NAME,
|
||||||
+ map.require(WORLD_NAME), map.require(WORLD_KEY));
|
+ map.require(WORLD_NAME), map.require(WORLD_KEY));
|
||||||
+
|
+
|
||||||
@@ -782,7 +817,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // Create Loader Builder
|
+ // Create Loader Builder
|
||||||
+ private static ConfigurationOptions defaultOptions(ConfigurationOptions options) {
|
+ private static ConfigurationOptions defaultOptions(@NotNull ConfigurationOptions options) {
|
||||||
+ return options.serializers(builder -> builder
|
+ return options.serializers(builder -> builder
|
||||||
+ .register(MapSerializer.TYPE, new MapSerializer(false))
|
+ .register(MapSerializer.TYPE, new MapSerializer(false))
|
||||||
+ .register(new EnumValueSerializer())
|
+ .register(new EnumValueSerializer())
|
||||||
@@ -796,7 +831,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // Create Global Object Mapper Factory Builder
|
+ // Create Global Object Mapper Factory Builder
|
||||||
+ private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.Builder builder) {
|
+ private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.@NotNull Builder builder) {
|
||||||
+ return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
|
+ return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -806,7 +841,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // Create Global Loader Builder
|
+ // Create Global Loader Builder
|
||||||
+ private static ConfigurationOptions defaultGlobalOptions(ConfigurationOptions options) {
|
+ private static ConfigurationOptions defaultGlobalOptions(@NotNull ConfigurationOptions options) {
|
||||||
+ return options.header(GLOBAL_HEADER).serializers(builder -> builder.register(new PacketClassSerializer()));
|
+ return options.header(GLOBAL_HEADER).serializers(builder -> builder.register(new PacketClassSerializer()));
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -819,7 +854,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public GlobalConfiguration initializeGlobalConfiguration() throws ConfigurateException {
|
+ public GlobalConfiguration initializeGlobalConfiguration() throws ConfigurateException {
|
||||||
+ GlobalConfiguration configuration = super.initializeGlobalConfiguration();
|
+ GlobalConfiguration configuration = super.initializeGlobalConfiguration();
|
||||||
+ GlobalConfiguration.set(configuration);
|
+ GlobalConfiguration.set(configuration, false);
|
||||||
+ return configuration;
|
+ return configuration;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -859,7 +894,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ );
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private void applyTransformations(final NodePath[] paths, final ConfigurationNode node) throws ConfigurateException {
|
+ private void applyTransformations(final NodePath @NotNull [] paths, final ConfigurationNode node) throws ConfigurateException {
|
||||||
+ if (paths.length > 0) {
|
+ if (paths.length > 0) {
|
||||||
+ ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder();
|
+ ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder();
|
||||||
+
|
+
|
||||||
@@ -876,7 +911,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node) throws ConfigurateException {
|
+ protected void applyWorldConfigTransformations(final @NotNull ContextMap contextMap, final @NotNull ConfigurationNode node) throws ConfigurateException {
|
||||||
+ final ConfigurationNode version = node.node(Configuration.VERSION_FIELD);
|
+ final ConfigurationNode version = node.node(Configuration.VERSION_FIELD);
|
||||||
+ final String world = contextMap.require(WORLD_NAME);
|
+ final String world = contextMap.require(WORLD_NAME);
|
||||||
+
|
+
|
||||||
@@ -903,7 +938,7 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public LevelConfigurations createWorldConfig(final ContextMap contextMap) {
|
+ public LevelConfigurations createWorldConfig(final @NotNull ContextMap contextMap) {
|
||||||
+ final String levelName = contextMap.require(WORLD_NAME);
|
+ final String levelName = contextMap.require(WORLD_NAME);
|
||||||
+ try {
|
+ try {
|
||||||
+ return super.createWorldConfig(contextMap);
|
+ return super.createWorldConfig(contextMap);
|
||||||
@@ -923,14 +958,15 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @VisibleForTesting
|
+ @VisibleForTesting
|
||||||
+ static ConfigurationNode createForTesting() {
|
+ static @NotNull ConfigurationNode createForTesting() {
|
||||||
+ ObjectMapper.Factory factory = defaultGlobalFactoryBuilder(ObjectMapper.factoryBuilder()).build();
|
+ ObjectMapper.Factory factory = defaultGlobalFactoryBuilder(ObjectMapper.factoryBuilder()).build();
|
||||||
+ ConfigurationOptions options = defaultGlobalOptions(defaultOptions(ConfigurationOptions.defaults()))
|
+ ConfigurationOptions options = defaultGlobalOptions(defaultOptions(ConfigurationOptions.defaults()))
|
||||||
+ .serializers(builder -> builder.register(type -> ConfigurationPart.class.isAssignableFrom(erase(type)), factory.asTypeSerializer()));
|
+ .serializers(builder -> builder.register(type -> ConfigurationPart.class.isAssignableFrom(erase(type)), factory.asTypeSerializer()));
|
||||||
+ return BasicConfigurationNode.root(options);
|
+ return BasicConfigurationNode.root(options);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static PlazmaConfigurations setup(final Path configurationDir) throws Exception {
|
+ @Contract("_ -> new")
|
||||||
|
+ public static @NotNull PlazmaConfigurations setup(final Path configurationDir) throws Exception {
|
||||||
+ try {
|
+ try {
|
||||||
+ PaperConfigurations.createDirectoriesSymlinkAware(configurationDir);
|
+ PaperConfigurations.createDirectoriesSymlinkAware(configurationDir);
|
||||||
+ return new PlazmaConfigurations(configurationDir);
|
+ return new PlazmaConfigurations(configurationDir);
|
||||||
@@ -949,6 +985,11 @@ index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca57
|
|||||||
+ throw new RuntimeException("Could not reload Plazma configuration files", e);
|
+ throw new RuntimeException("Could not reload Plazma configuration files", e);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ public static boolean optimizeConfig() {
|
||||||
|
+ return OPTIMIZE_CONFIG;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
@@ -968,20 +1009,20 @@ index 0000000000000000000000000000000000000000..469100cd86e6742eeebad22923097782
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||||
index d1fd4cf65c31bc00d0bffa3123fc2223f1498a34..0aebabc83eea721e4f373fb00f4ee80b659efe83 100644
|
index 8174b6bb78553cbe124b499ffa235368179d1564..a5f8a128b27906daba5aeb293851bb03402ca9c2 100644
|
||||||
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||||
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||||
@@ -63,6 +63,7 @@ public abstract class AbstractTestingBase {
|
@@ -64,6 +64,7 @@ public abstract class AbstractTestingBase {
|
||||||
|
|
||||||
DummyEnchantments.setup();
|
DummyEnchantments.setup();
|
||||||
io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper
|
io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper
|
||||||
+ org.plazmamc.plazma.configurations.GlobalConfigurationTestingBase.setupGlobalConfigurationForTest(); // Plazma
|
+ org.plazmamc.plazma.configurations.GlobalConfigurationTestingBase.setupGlobalConfigurationForTest(); // Plazma
|
||||||
|
|
||||||
ImmutableList.Builder<Material> builder = ImmutableList.builder();
|
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
|
||||||
for (Material m : Material.values()) {
|
|
||||||
diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
|
diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..2b9a17a2e04f7fb6b801920ed04133db9478f984
|
index 0000000000000000000000000000000000000000..adf57600250b05e1d7cf617d7f58797d2663bca9
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
|
+++ b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
|
||||||
@@ -0,0 +1,18 @@
|
@@ -0,0 +1,18 @@
|
||||||
@@ -996,7 +1037,7 @@ index 0000000000000000000000000000000000000000..2b9a17a2e04f7fb6b801920ed04133db
|
|||||||
+ ConfigurationNode node = PlazmaConfigurations.createForTesting();
|
+ ConfigurationNode node = PlazmaConfigurations.createForTesting();
|
||||||
+ try {
|
+ try {
|
||||||
+ GlobalConfiguration globalConfiguration = node.require(GlobalConfiguration.class);
|
+ GlobalConfiguration globalConfiguration = node.require(GlobalConfiguration.class);
|
||||||
+ GlobalConfiguration.set(globalConfiguration);
|
+ GlobalConfiguration.set(globalConfiguration, true);
|
||||||
+ } catch (SerializationException e) {
|
+ } catch (SerializationException e) {
|
||||||
+ throw new RuntimeException(e);
|
+ throw new RuntimeException(e);
|
||||||
+ }
|
+ }
|
||||||
68
patches/server/0007-Add-more-metrics.patch
Normal file
68
patches/server/0007-Add-more-metrics.patch
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 16:02:29 +0900
|
||||||
|
Subject: [PATCH] Add more metrics
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..fa88d48adc3aefcd823f431f099e46c94fd071a1 100644
|
||||||
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
|
@@ -636,16 +636,51 @@ public class Metrics {
|
||||||
|
return map;
|
||||||
|
}));
|
||||||
|
|
||||||
|
+ // Plazma start - Add more metrics
|
||||||
|
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
|
||||||
|
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
|
||||||
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
|
||||||
|
+
|
||||||
|
+ if (datapacks == 0) return Collections.singletonMap("0", entry);
|
||||||
|
+ else if (datapacks <= 5) return Collections.singletonMap("1-5", entry);
|
||||||
|
+ else if (datapacks <= 10) return Collections.singletonMap("6-10", entry);
|
||||||
|
+ else if (datapacks <= 25) return Collections.singletonMap("11-25", entry);
|
||||||
|
+ else if (datapacks <= 50) return Collections.singletonMap("26-50", entry);
|
||||||
|
+ return Collections.singletonMap("50+", entry);
|
||||||
|
+ }));
|
||||||
|
+
|
||||||
|
+ List<Plugin> plugins = Arrays.stream(Bukkit.getPluginManager().getPlugins()).toList();
|
||||||
|
+
|
||||||
|
+ metrics.addCustomChart(new DrilldownPie("plugins", () -> {
|
||||||
|
+ int pluginCount = (int) plugins.stream().filter(Plugin::isEnabled).count();
|
||||||
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(pluginCount), 1);
|
||||||
|
+
|
||||||
|
+ if (pluginCount == 0) return Collections.singletonMap("0", entry);
|
||||||
|
+ else if (pluginCount <= 5) return Collections.singletonMap("1-5", entry);
|
||||||
|
+ else if (pluginCount <= 10) return Collections.singletonMap("6-10", entry);
|
||||||
|
+ else if (pluginCount <= 25) return Collections.singletonMap("11-25", entry);
|
||||||
|
+ else if (pluginCount <= 50) return Collections.singletonMap("26-50", entry);
|
||||||
|
+ return Collections.singletonMap("50+", entry);
|
||||||
|
+ }));
|
||||||
|
+
|
||||||
|
+ metrics.addCustomChart(new DrilldownPie("disabled_plugins", () -> {
|
||||||
|
+ int disabled = (int) plugins.stream().filter(java.util.function.Predicate.not(Plugin::isEnabled)).count();
|
||||||
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(disabled), 1);
|
||||||
|
+
|
||||||
|
+ if (disabled == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry);
|
||||||
|
+ else if (disabled <= 5) return Collections.singletonMap("1-5", entry);
|
||||||
|
+ else if (disabled <= 10) return Collections.singletonMap("6-10", entry);
|
||||||
|
+ else if (disabled <= 25) return Collections.singletonMap("11-25", entry);
|
||||||
|
+ else if (disabled <= 50) return Collections.singletonMap("26-50", entry);
|
||||||
|
+ return Collections.singletonMap("50+ \uD83D\uDE2D", entry);
|
||||||
|
+ }));
|
||||||
|
+ // Plazma end
|
||||||
|
+
|
||||||
|
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||||
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||||
|
|
||||||
|
// count legacy plugins
|
||||||
|
- int legacy = 0;
|
||||||
|
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||||
|
- if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
||||||
|
- legacy++;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ int legacy = (int) plugins.stream().filter(p -> CraftMagicNumbers.isLegacy(p.getDescription())).count(); // Plazma
|
||||||
|
|
||||||
|
// insert real value as lower dimension
|
||||||
|
Map<String, Integer> entry = new HashMap<>();
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Fri, 24 Mar 2023 23:54:51 +0900
|
|
||||||
Subject: [PATCH] Add more metrics
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
||||||
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..067bcbcb81802a3a52ecff737ddf2c033696ecfb 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
||||||
@@ -636,12 +636,63 @@ public class Metrics {
|
|
||||||
return map;
|
|
||||||
}));
|
|
||||||
|
|
||||||
+ // Plazma start
|
|
||||||
+ metrics.addCustomChart(new Metrics.DrilldownPie("datapacks", () -> {
|
|
||||||
+ Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
||||||
+ int datapacks = Bukkit.getServer().getDatapackManager().getEnabledPacks().size();
|
|
||||||
+ Map<String, Integer> entry = new HashMap<>();
|
|
||||||
+ entry.put(String.valueOf(datapacks), 1);
|
|
||||||
+
|
|
||||||
+ if (datapacks == 0)
|
|
||||||
+ map.put("0", entry);
|
|
||||||
+ else if (datapacks <= 5)
|
|
||||||
+ map.put("1-5", entry);
|
|
||||||
+ else if (datapacks <= 10)
|
|
||||||
+ map.put("6-10", entry);
|
|
||||||
+ else if (datapacks <= 25)
|
|
||||||
+ map.put("11-25", entry);
|
|
||||||
+ else
|
|
||||||
+ map.put("26+", entry);
|
|
||||||
+
|
|
||||||
+ return map;
|
|
||||||
+ }));
|
|
||||||
+
|
|
||||||
+ List<Plugin> plugins = new ArrayList<>();
|
|
||||||
+ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
|
||||||
+ if (plugin.isEnabled()) {
|
|
||||||
+ plugins.add(plugin);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ metrics.addCustomChart(new Metrics.DrilldownPie("plugins", () -> {
|
|
||||||
+ Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
||||||
+ int plugins1 = plugins.size();
|
|
||||||
+ Map<String, Integer> entry = new HashMap<>();
|
|
||||||
+ entry.put(String.valueOf(plugins1), 1);
|
|
||||||
+
|
|
||||||
+ if (plugins1 == 0)
|
|
||||||
+ map.put("0", entry);
|
|
||||||
+ else if (plugins1 <= 5)
|
|
||||||
+ map.put("1-5", entry);
|
|
||||||
+ else if (plugins1 <= 10)
|
|
||||||
+ map.put("6-10", entry);
|
|
||||||
+ else if (plugins1 <= 25)
|
|
||||||
+ map.put("11-25", entry);
|
|
||||||
+ else if (plugins1 <= 50)
|
|
||||||
+ map.put("26-50", entry);
|
|
||||||
+ else
|
|
||||||
+ map.put("51+", entry);
|
|
||||||
+
|
|
||||||
+ return map;
|
|
||||||
+ }));
|
|
||||||
+ // Plazma end
|
|
||||||
+
|
|
||||||
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
|
||||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
||||||
|
|
||||||
// count legacy plugins
|
|
||||||
int legacy = 0;
|
|
||||||
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
|
||||||
+ for (Plugin plugin : plugins) { // Plazma
|
|
||||||
if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
|
||||||
legacy++;
|
|
||||||
}
|
|
||||||
@@ -1,70 +1,73 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Tue, 7 Mar 2023 12:28:34 +0900
|
Date: Wed, 27 Sep 2023 16:42:17 +0900
|
||||||
Subject: [PATCH] Optimize Default Configurations
|
Subject: [PATCH] Optimize default configurations
|
||||||
|
|
||||||
Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC
|
Reference: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC
|
||||||
Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment
|
|
||||||
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||||
index bff1b41501c040487583a5a279fc7800fc6aedca..2d7e1ffa117fa2581ab2a42cd04d062f25559b11 100644
|
index 5f223856b06e901b100fcca8e6dd968e0b2e3a8e..13df89e7cc219cdb80c4114d05148c685ad2ecee 100644
|
||||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||||
@@ -211,8 +211,8 @@ public class PufferfishConfig {
|
@@ -72,7 +72,7 @@ public class PufferfishConfig {
|
||||||
|
getString("info.version", "1.0");
|
||||||
|
setComment("info",
|
||||||
|
"Pufferfish Configuration",
|
||||||
|
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
|
||||||
|
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - no advertisement
|
||||||
|
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
|
||||||
|
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
|
||||||
|
|
||||||
|
@@ -219,7 +219,7 @@ public class PufferfishConfig {
|
||||||
public static int maxProjectileLoadsPerTick;
|
public static int maxProjectileLoadsPerTick;
|
||||||
public static int maxProjectileLoadsPerProjectile;
|
public static int maxProjectileLoadsPerProjectile;
|
||||||
private static void projectileLoading() {
|
private static void projectileLoading() {
|
||||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||||
- maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
|
||||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma
|
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||||
+ maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
|
||||||
|
|
||||||
setComment("projectile", "Optimizes projectile settings");
|
setComment("projectile", "Optimizes projectile settings");
|
||||||
}
|
@@ -233,7 +233,7 @@ public class PufferfishConfig {
|
||||||
@@ -225,16 +225,16 @@ public class PufferfishConfig {
|
|
||||||
public static int activationDistanceMod;
|
public static int activationDistanceMod;
|
||||||
|
|
||||||
private static void dynamicActivationOfBrains() throws IOException {
|
private static void dynamicActivationOfBrains() throws IOException {
|
||||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||||
- startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()); // Purpur // Plazma - Optimize default configurations
|
||||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Purpur // Plazma
|
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||||
+ startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
|
||||||
"This value determines how far away an entity has to be",
|
"This value determines how far away an entity has to be",
|
||||||
"from the player to start being effected by DEAR.");
|
"from the player to start being effected by DEAR.");
|
||||||
startDistanceSquared = startDistance * startDistance;
|
@@ -241,7 +241,7 @@ public class PufferfishConfig {
|
||||||
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
||||||
"This value defines how often in ticks, the furthest entity",
|
"This value defines how often in ticks, the furthest entity",
|
||||||
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||||
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
||||||
- "This value defines how much distance modifies an entity's",
|
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 7 : 8, // Plazma - Optimize default configurations
|
||||||
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 7, // Plazma
|
"This value defines how much distance modifies an entity's",
|
||||||
+ "This value defines how much distance modifies an entity's",
|
|
||||||
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
|
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
|
||||||
"If you want further away entities to tick less often, use 7.",
|
"If you want further away entities to tick less often, use 7.",
|
||||||
"If you want further away entities to tick more often, try 9.");
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||||
index 019d3bbd78fb0b06861979d223915fedb6c99442..553127c9a38612005530cffdb25544585e6c8234 100644
|
index c69892a5f31895b85e530beadd8864ac32470ba7..5f652268dadaca96a98203ad12d7a0ba0b19563b 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||||
@@ -142,7 +142,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
@@ -154,7 +154,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
public class Watchdog extends ConfigurationPart {
|
public class Watchdog extends ConfigurationPart {
|
||||||
public int earlyWarningEvery = 5000;
|
public int earlyWarningEvery = 5000;
|
||||||
- public int earlyWarningDelay = 10000;
|
- public int earlyWarningDelay = 10000;
|
||||||
+ public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations
|
+ public int earlyWarningDelay = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 180000 : 10000; // Plazma - Optimize default configurations
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpamLimiter spamLimiter;
|
public SpamLimiter spamLimiter;
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec6520ed09 100644
|
index ec5e23136423e42e4f55e6ea646b8285c1ca14e2..a1d22ad65fc751fa93384f59853434ab65836133 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
@@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -88,15 +88,27 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
public class AntiXray extends ConfigurationPart {
|
public class AntiXray extends ConfigurationPart {
|
||||||
public boolean enabled = false;
|
public boolean enabled = false;
|
||||||
- public EngineMode engineMode = EngineMode.HIDE;
|
- public EngineMode engineMode = EngineMode.HIDE;
|
||||||
+ public EngineMode engineMode = Boolean.getBoolean("Plazma.disableConfigOptimization") ? EngineMode.HIDE : EngineMode.OBFUSCATE_LAYER; // Plazma - Optimize Default Configurations
|
+ public EngineMode engineMode = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? EngineMode.OBFUSCATE_LAYER : EngineMode.HIDE; // Plazma - Optimize default configurations
|
||||||
public int maxBlockHeight = 64;
|
public int maxBlockHeight = 64;
|
||||||
public int updateRadius = 2;
|
public int updateRadius = 2;
|
||||||
public boolean lavaObscures = false;
|
public boolean lavaObscures = false;
|
||||||
@@ -73,52 +76,73 @@ index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
|||||||
- "coal_ore", "deepslate_coal_ore", "lapis_ore", "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "deepslate_diamond_ore",
|
- "coal_ore", "deepslate_coal_ore", "lapis_ore", "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "deepslate_diamond_ore",
|
||||||
- "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore", "deepslate_emerald_ore", "ender_chest"); // TODO update type to List<Block>
|
- "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore", "deepslate_emerald_ore", "ender_chest"); // TODO update type to List<Block>
|
||||||
- public List<String> replacementBlocks = List.of("stone", "oak_planks", "deepslate"); // TODO update type to List<Block>
|
- public List<String> replacementBlocks = List.of("stone", "oak_planks", "deepslate"); // TODO update type to List<Block>
|
||||||
+ // Plazma start - Optimize Default Configurations
|
+ // Plazma start - Optimize default configurations
|
||||||
+ public List<String> hiddenBlocks = List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "diamond_ore", "deepslate_diamond_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", "raw_iron_block", "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore"); // TODO update type to List<Block>
|
+ public List<String> hiddenBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ?
|
||||||
+ public List<String> replacementBlocks = List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore", "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "deepslate_emerald_ore", "granite", "gravel", "oak_planks", "smooth_basalt", "stone", "tuff"); // TODO update type to List<Block>
|
+ List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "iron_ore",
|
||||||
|
+ "deepslate_iron_ore", "raw_iron_block", "gold_ore", "deepslate_gold_ore", "raw_gold_block",
|
||||||
|
+ "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore", "diamond_ore",
|
||||||
|
+ "deepslate_diamond_ore") :
|
||||||
|
+ List.of("copper_ore", "deepslate_copper_ore","gold_ore", "deepslate_gold_ore",
|
||||||
|
+ "iron_ore", "deepslate_iron_ore", "coal_ore", "deepslate_coal_ore", "lapis_ore",
|
||||||
|
+ "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore",
|
||||||
|
+ "deepslate_diamond_ore", "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore",
|
||||||
|
+ "deepslate_emerald_ore", "ender_chest");; // TODO update type to List<Block>
|
||||||
|
+ public List<String> replacementBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ?
|
||||||
|
+ List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore",
|
||||||
|
+ "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "granite", "gravel",
|
||||||
|
+ "oak_planks", "smooth_basalt", "stone", "tuff") : List.of("stone", "oak_planks", "deepslate"); // TODO update type to List<Block>
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -150,7 +162,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
@MergeMap
|
@MergeMap
|
||||||
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
||||||
@MergeMap
|
@MergeMap
|
||||||
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
|
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
|
||||||
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations
|
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
|
||||||
|
|
||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public record DespawnRange(@Required int soft, @Required int hard) {
|
public record DespawnRange(@Required int soft, @Required int hard) {
|
||||||
@@ -371,7 +371,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -375,7 +387,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
public class Environment extends ConfigurationPart {
|
public class Environment extends ConfigurationPart {
|
||||||
public boolean disableThunder = false;
|
public boolean disableThunder = false;
|
||||||
public boolean disableIceAndSnow = false;
|
public boolean disableIceAndSnow = false;
|
||||||
- public boolean optimizeExplosions = false;
|
- public boolean optimizeExplosions = false;
|
||||||
+ public boolean optimizeExplosions = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean optimizeExplosions = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
public boolean disableExplosionKnockback = false;
|
public boolean disableExplosionKnockback = false;
|
||||||
public boolean generateFlatBedrock = false;
|
public boolean generateFlatBedrock = false;
|
||||||
public FrostedIce frostedIce;
|
public FrostedIce frostedIce;
|
||||||
@@ -451,9 +451,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -427,7 +439,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
|
public Fixes fixes;
|
||||||
|
|
||||||
|
public class Fixes extends ConfigurationPart {
|
||||||
|
- public boolean fixItemsMergingThroughWalls = false;
|
||||||
|
+ public boolean fixItemsMergingThroughWalls = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
|
public boolean disableUnloadedChunkEnderpearlExploit = true;
|
||||||
|
public boolean preventTntFromMovingInWater = false;
|
||||||
|
public boolean splitOverstackedLoot = true;
|
||||||
|
@@ -455,9 +467,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
public class Collisions extends ConfigurationPart {
|
public class Collisions extends ConfigurationPart {
|
||||||
public boolean onlyPlayersCollide = false;
|
public boolean onlyPlayersCollide = false;
|
||||||
public boolean allowVehicleCollisions = true;
|
public boolean allowVehicleCollisions = true;
|
||||||
- public boolean fixClimbingBypassingCrammingRule = false;
|
- public boolean fixClimbingBypassingCrammingRule = false;
|
||||||
+ public boolean fixClimbingBypassingCrammingRule = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean fixClimbingBypassingCrammingRule = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
|
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
|
||||||
- public int maxEntityCollisions = 8;
|
- public int maxEntityCollisions = 8;
|
||||||
+ public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations
|
+ public int maxEntityCollisions = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 2 : 8; // Plazma - Optimize default configurations
|
||||||
public boolean allowPlayerCrammingDamage = false;
|
public boolean allowPlayerCrammingDamage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,18 +461,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -465,18 +477,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
public class Chunks extends ConfigurationPart {
|
public class Chunks extends ConfigurationPart {
|
||||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||||
- public int maxAutoSaveChunksPerTick = 24;
|
- public int maxAutoSaveChunksPerTick = 24;
|
||||||
+ public int maxAutoSaveChunksPerTick = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 24 : 8; // Plazma - Optimize Default Configurations
|
+ public int maxAutoSaveChunksPerTick = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 24; // Plazma - Optimize default configurations
|
||||||
public int fixedChunkInhabitedTime = -1;
|
public int fixedChunkInhabitedTime = -1;
|
||||||
- public boolean preventMovingIntoUnloadedChunks = false;
|
- public boolean preventMovingIntoUnloadedChunks = false;
|
||||||
+ public boolean preventMovingIntoUnloadedChunks = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean preventMovingIntoUnloadedChunks = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
public Duration delayChunkUnloadsBy = Duration.of("10s");
|
public Duration delayChunkUnloadsBy = Duration.of("10s");
|
||||||
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
|
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
|
||||||
- map.defaultReturnValue(-1);
|
- map.defaultReturnValue(-1);
|
||||||
@@ -128,8 +152,8 @@ index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
|||||||
- map.put(EntityType.ARROW, -1);
|
- map.put(EntityType.ARROW, -1);
|
||||||
- map.put(EntityType.FIREBALL, -1);
|
- map.put(EntityType.FIREBALL, -1);
|
||||||
- map.put(EntityType.SMALL_FIREBALL, -1);
|
- map.put(EntityType.SMALL_FIREBALL, -1);
|
||||||
+ // Plazma start - Optimize Default Configurations
|
+ // Plazma start - Optimize default configurations
|
||||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
|
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()) {
|
||||||
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
|
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
|
||||||
+ map.put(EntityType.ARROW, 16);
|
+ map.put(EntityType.ARROW, 16);
|
||||||
+ map.put(EntityType.DRAGON_FIREBALL, 3);
|
+ map.put(EntityType.DRAGON_FIREBALL, 3);
|
||||||
@@ -160,76 +184,77 @@ index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
|||||||
});
|
});
|
||||||
public boolean flushRegionsOnSave = false;
|
public boolean flushRegionsOnSave = false;
|
||||||
}
|
}
|
||||||
@@ -487,9 +509,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -491,9 +525,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
public TickRates tickRates;
|
public TickRates tickRates;
|
||||||
|
|
||||||
public class TickRates extends ConfigurationPart {
|
public class TickRates extends ConfigurationPart {
|
||||||
- public int grassSpread = 1;
|
- public int grassSpread = 1;
|
||||||
+ public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations
|
+ public int grassSpread = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 1; // Plazma - Optimize default configurations
|
||||||
public int containerUpdate = 1;
|
public int containerUpdate = 1;
|
||||||
- public int mobSpawner = 1;
|
- public int mobSpawner = 1;
|
||||||
+ public int mobSpawner = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 2; // Plazma - Optimize Default Configurations
|
+ public int mobSpawner = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 2 : 1; // Plazma - Optimize default configurations
|
||||||
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
||||||
public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
|
public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
|
||||||
}
|
}
|
||||||
@@ -513,9 +535,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -517,9 +551,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
public class Misc extends ConfigurationPart {
|
public class Misc extends ConfigurationPart {
|
||||||
public int lightQueueSize = 20;
|
public int lightQueueSize = 20;
|
||||||
- public boolean updatePathfindingOnBlockUpdate = true;
|
- public boolean updatePathfindingOnBlockUpdate = true;
|
||||||
+ public boolean updatePathfindingOnBlockUpdate = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
||||||
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
||||||
+ public RedstoneImplementation redstoneImplementation = Boolean.getBoolean("Plazma.disableConfigOptimization") ? RedstoneImplementation.VANILLA : RedstoneImplementation.ALTERNATE_CURRENT; // Plazma - Optimize Default Configurations
|
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
|
||||||
public boolean disableEndCredits = false;
|
public boolean disableEndCredits = false;
|
||||||
public float maxLeashDistance = 10f;
|
public float maxLeashDistance = 10f;
|
||||||
public boolean disableSprintInterruptionOnAttack = false;
|
public boolean disableSprintInterruptionOnAttack = false;
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||||
index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c1a2bfdec 100644
|
index 24763d3d270c29c95e0b3e85111145234f660a62..ba7cf430cdff947a74ae067fc79020ae01e7e457 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
+++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||||
@@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int {
|
@@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int fallback() {
|
protected int fallback() {
|
||||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations
|
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()) return 100; // Plazma - Optimize default configurations
|
||||||
return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate;
|
return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 903da36aeec8e8c7d1f3101d1e93f87412a7eed5..79593800173ad2b837b081e6091e98adfa41fb99 100644
|
index 30fc258faa6f087cf3c91411b48116a3ac416031..a32a1787cbcacb0d3ed6f0d751a04e8fa9d11dd6 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
|
||||||
@@ -155,7 +155,7 @@ public class Main {
|
@@ -163,7 +163,7 @@ public class Main {
|
||||||
File configFile = (File) optionset.valueOf("bukkit-settings");
|
File configFile = (File) optionset.valueOf("bukkit-settings");
|
||||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
|
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
|
||||||
configuration.options().copyDefaults(true);
|
configuration.options().copyDefaults(true);
|
||||||
- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||||
+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations
|
+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||||
configuration.save(configFile);
|
configuration.save(configFile);
|
||||||
|
|
||||||
File commandFile = (File) optionset.valueOf("commands-settings");
|
File commandFile = (File) optionset.valueOf("commands-settings");
|
||||||
|
@@ -177,8 +177,7 @@ public class Main {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spigot Start
|
||||||
|
- boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
|
||||||
|
- eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev");
|
||||||
|
+ boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" ) || Boolean.getBoolean("Paper.isRunDev"); // Plazma
|
||||||
|
if ( eulaAgreed )
|
||||||
|
{
|
||||||
|
System.err.println( "You have used the Spigot command line EULA agreement flag." );
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d76d390d0f 100644
|
index cda4544ae96a4fcb5c6c4483df67a59f1b53fd27..54f2c5187322c6dea70c4e0e63cce2e68e7ac647 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
@@ -120,7 +120,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
@@ -130,15 +130,15 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||||
this.levelName = this.get("level-name", "world");
|
|
||||||
this.serverPort = this.get("server-port", 25565);
|
|
||||||
this.announcePlayerAchievements = this.getLegacyBoolean("announce-player-achievements");
|
|
||||||
- this.enableQuery = this.get("enable-query", false);
|
|
||||||
+ this.enableQuery = this.get("enable-query", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Plazma - Optimize Default Configurations
|
|
||||||
this.queryPort = this.get("query.port", 25565);
|
|
||||||
this.enableRcon = this.get("enable-rcon", false);
|
|
||||||
this.rconPort = this.get("rcon.port", 25575);
|
|
||||||
@@ -129,15 +129,15 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
|
||||||
this.allowNether = this.get("allow-nether", true);
|
this.allowNether = this.get("allow-nether", true);
|
||||||
this.spawnMonsters = this.get("spawn-monsters", true);
|
this.spawnMonsters = this.get("spawn-monsters", true);
|
||||||
this.useNativeTransport = this.get("use-native-transport", true);
|
this.useNativeTransport = this.get("use-native-transport", true);
|
||||||
- this.enableCommandBlock = this.get("enable-command-block", false);
|
- this.enableCommandBlock = this.get("enable-command-block", false);
|
||||||
- this.spawnProtection = this.get("spawn-protection", 16);
|
- this.spawnProtection = this.get("spawn-protection", 16);
|
||||||
+ this.enableCommandBlock = this.get("enable-command-block", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Plazma - Optimize Default Configurations
|
+ this.enableCommandBlock = this.get("enable-command-block", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()); // Plazma - Optimize default configurations
|
||||||
+ this.spawnProtection = this.get("spawn-protection", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 0); // Plazma - Optimize Default Configurations
|
+ this.spawnProtection = this.get("spawn-protection", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 0 : 16); // Plazma - Optimize default configurations
|
||||||
this.opPermissionLevel = this.get("op-permission-level", 4);
|
this.opPermissionLevel = this.get("op-permission-level", 4);
|
||||||
this.functionPermissionLevel = this.get("function-permission-level", 2);
|
this.functionPermissionLevel = this.get("function-permission-level", 2);
|
||||||
this.maxTickTime = this.get("max-tick-time", TimeUnit.MINUTES.toMillis(1L));
|
this.maxTickTime = this.get("max-tick-time", TimeUnit.MINUTES.toMillis(1L));
|
||||||
@@ -237,77 +262,86 @@ index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d7
|
|||||||
this.rateLimitPacketsPerSecond = this.get("rate-limit", 0);
|
this.rateLimitPacketsPerSecond = this.get("rate-limit", 0);
|
||||||
- this.viewDistance = this.get("view-distance", 10);
|
- this.viewDistance = this.get("view-distance", 10);
|
||||||
- this.simulationDistance = this.get("simulation-distance", 10);
|
- this.simulationDistance = this.get("simulation-distance", 10);
|
||||||
+ this.viewDistance = this.get("view-distance", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 7); // Plazma - Optimize Default Configurations
|
+ this.viewDistance = this.get("view-distance", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 7 : 10); // Plazma - Optimize default configurations
|
||||||
+ this.simulationDistance = this.get("simulation-distance", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 4); // Plazma - Optimize Default Configurations
|
+ this.simulationDistance = this.get("simulation-distance", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 10); // Plazma - Optimize default configurations
|
||||||
this.maxPlayers = this.get("max-players", 20);
|
this.maxPlayers = this.get("max-players", 20);
|
||||||
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
|
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
|
||||||
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
|
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
|
||||||
@@ -145,7 +145,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
@@ -146,7 +146,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||||
this.maxWorldSize = this.get("max-world-size", (integer) -> {
|
this.maxWorldSize = this.get("max-world-size", (integer) -> {
|
||||||
return Mth.clamp(integer, 1, 29999984);
|
return Mth.clamp(integer, 1, 29999984);
|
||||||
}, 29999984);
|
}, 29999984);
|
||||||
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag
|
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag
|
||||||
+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag // Plazma - Optimize Default Configurations
|
+ this.syncChunkWrites = this.get("sync-chunk-writes", Boolean.getBoolean("Paper.enable-sync-chunk-writes")); // Paper - hide behind flag // Plazma - Optimize default configurations
|
||||||
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
||||||
this.enableStatus = this.get("enable-status", true);
|
this.enableStatus = this.get("enable-status", true);
|
||||||
this.hideOnlinePlayers = this.get("hide-online-players", false);
|
this.hideOnlinePlayers = this.get("hide-online-players", false);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 153fcfc55589691a570080aa4f4e179452bf4f6c..45dabf7fc7531392b4140416f2f0931090f14235 100644
|
index 3e8f42811e9254567f2522e68b6018704bd63ae2..f8805e11551fddfda44aa36ba4e83f3df2f87500 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -427,7 +427,7 @@ public final class CraftServer implements Server {
|
@@ -431,7 +431,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||||
this.configuration.options().copyDefaults(true);
|
this.configuration.options().copyDefaults(true);
|
||||||
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||||
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations
|
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
|
||||||
ConfigurationSection legacyAlias = null;
|
ConfigurationSection legacyAlias = null;
|
||||||
if (!this.configuration.isString("aliases")) {
|
if (!this.configuration.isString("aliases")) {
|
||||||
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||||
|
index 39db772735d57e12bbb26a6505ca7a5e360cdd78..eabd643bf096786285ee21e898b2bf8460cd5a26 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||||
|
@@ -302,7 +302,7 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Le
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- public static boolean optimizeConfig() {
|
||||||
|
+ public static boolean doOptimize() {
|
||||||
|
return OPTIMIZE_CONFIG;
|
||||||
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
index d0d31002562e728fa1a6c9bc81baa4534f11d365..d0968eeb0f9edeee43394da8a32d3ee8d491737b 100644
|
index d0d31002562e728fa1a6c9bc81baa4534f11d365..5f0b10932f8dda09131ba68207cbfea4715e0f33 100644
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
@@ -49,7 +49,10 @@ public class PurpurConfig {
|
@@ -49,6 +49,7 @@ public class PurpurConfig {
|
||||||
+ "join us in our Discord guild.\n"
|
+ "join us in our Discord guild.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Website: https://purpurmc.org \n"
|
+ "Website: https://purpurmc.org \n"
|
||||||
- + "Docs: https://purpurmc.org/docs \n";
|
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n" // Plazma
|
||||||
+ // Plazma start
|
+ "Docs: https://purpurmc.org/docs \n";
|
||||||
+ + "Docs: https://purpurmc.org/docs \n"
|
|
||||||
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n";
|
|
||||||
+ // Plazma end
|
|
||||||
private static File CONFIG_FILE;
|
private static File CONFIG_FILE;
|
||||||
public static YamlConfiguration config;
|
public static YamlConfiguration config;
|
||||||
|
@@ -241,7 +242,7 @@ public class PurpurConfig {
|
||||||
@@ -241,7 +244,7 @@ public class PurpurConfig {
|
|
||||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
- public static boolean useAlternateKeepAlive = false;
|
- public static boolean useAlternateKeepAlive = false;
|
||||||
+ public static boolean useAlternateKeepAlive = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public static boolean useAlternateKeepAlive = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
private static void useAlternateKeepAlive() {
|
private static void useAlternateKeepAlive() {
|
||||||
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
index 078102e636803f38facc049952813ff2f8b63594..16c3a06df8575a4fecd1967cf18854cb6267a4f7 100644
|
index d4d9f748d259df8b6f4566efa21c15c470de5ba2..d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde 100644
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
|
@@ -423,7 +423,7 @@ public class PurpurWorldConfig {
|
||||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
public boolean idleTimeoutTargetPlayer = true;
|
||||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||||
public int playerDeathExpDropMax = 100;
|
public int playerDeathExpDropMax = 100;
|
||||||
- public boolean teleportIfOutsideBorder = false;
|
- public boolean teleportIfOutsideBorder = false;
|
||||||
+ public boolean teleportIfOutsideBorder = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean teleportIfOutsideBorder = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
public boolean teleportOnNetherCeilingDamage = false;
|
public boolean teleportOnNetherCeilingDamage = false;
|
||||||
public boolean totemOfUndyingWorksInInventory = false;
|
public boolean totemOfUndyingWorksInInventory = false;
|
||||||
public boolean playerFixStuckPortal = false;
|
public boolean playerFixStuckPortal = false;
|
||||||
@@ -3070,7 +3070,7 @@ public class PurpurWorldConfig {
|
@@ -3066,7 +3066,7 @@ public class PurpurWorldConfig {
|
||||||
public boolean zombieJockeyOnlyBaby = true;
|
public boolean zombieJockeyOnlyBaby = true;
|
||||||
public double zombieJockeyChance = 0.05D;
|
public double zombieJockeyChance = 0.05D;
|
||||||
public boolean zombieJockeyTryExistingChickens = true;
|
public boolean zombieJockeyTryExistingChickens = true;
|
||||||
- public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
|
- public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
|
||||||
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||||
public boolean zombieBypassMobGriefing = false;
|
public boolean zombieBypassMobGriefing = false;
|
||||||
public boolean zombieTakeDamageFromWater = false;
|
public boolean zombieTakeDamageFromWater = false;
|
||||||
public boolean zombieAlwaysDropExp = false;
|
public boolean zombieAlwaysDropExp = false;
|
||||||
@@ -320,7 +354,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
private void itemMerge()
|
private void itemMerge()
|
||||||
{
|
{
|
||||||
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
||||||
+ this.itemMerge = this.getDouble("merge-radius.item", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations
|
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations
|
||||||
this.log( "Item Merge Radius: " + this.itemMerge );
|
this.log( "Item Merge Radius: " + this.itemMerge );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +362,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
private void expMerge()
|
private void expMerge()
|
||||||
{
|
{
|
||||||
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
||||||
+ this.expMerge = this.getDouble("merge-radius.exp", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations
|
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations
|
||||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +371,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
private void mobSpawnRange()
|
private void mobSpawnRange()
|
||||||
{
|
{
|
||||||
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
|
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
|
||||||
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations
|
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 3 : 8 ); // Paper - Vanilla // Plazma - Optimize default configurations
|
||||||
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,37 +381,37 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
|
|
||||||
- public int animalActivationRange = 32;
|
- public int animalActivationRange = 32;
|
||||||
- public int monsterActivationRange = 32;
|
- public int monsterActivationRange = 32;
|
||||||
+ public int animalActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations
|
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||||
+ public int monsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 24; // Plazma - Optimize Default Configurations
|
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 24 : 32; // Plazma - Optimize default configurations
|
||||||
public int raiderActivationRange = 48;
|
public int raiderActivationRange = 48;
|
||||||
- public int miscActivationRange = 16;
|
- public int miscActivationRange = 16;
|
||||||
+ public int miscActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations
|
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||||
// Paper start
|
// Paper start
|
||||||
- public int flyingMonsterActivationRange = 32;
|
- public int flyingMonsterActivationRange = 32;
|
||||||
- public int waterActivationRange = 16;
|
- public int waterActivationRange = 16;
|
||||||
- public int villagerActivationRange = 32;
|
- public int villagerActivationRange = 32;
|
||||||
+ public int flyingMonsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 48; // Plazma - Optimize Default Configurations
|
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 48 : 32; // Plazma - Optimize default configurations
|
||||||
+ public int waterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations
|
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||||
+ public int villagerActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations
|
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||||
public int wakeUpInactiveAnimals = 4;
|
public int wakeUpInactiveAnimals = 4;
|
||||||
public int wakeUpInactiveAnimalsEvery = 60*20;
|
public int wakeUpInactiveAnimalsEvery = 60*20;
|
||||||
- public int wakeUpInactiveAnimalsFor = 5*20;
|
- public int wakeUpInactiveAnimalsFor = 5*20;
|
||||||
- public int wakeUpInactiveMonsters = 8;
|
- public int wakeUpInactiveMonsters = 8;
|
||||||
+ public int wakeUpInactiveAnimalsFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 40; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 40 : 100; // Plazma - Optimize default configurations
|
||||||
+ public int wakeUpInactiveMonsters = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 4; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 8; // Plazma - Optimize default configurations
|
||||||
public int wakeUpInactiveMonstersEvery = 20*20;
|
public int wakeUpInactiveMonstersEvery = 20*20;
|
||||||
- public int wakeUpInactiveMonstersFor = 5*20;
|
- public int wakeUpInactiveMonstersFor = 5*20;
|
||||||
- public int wakeUpInactiveVillagers = 4;
|
- public int wakeUpInactiveVillagers = 4;
|
||||||
+ public int wakeUpInactiveMonstersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||||
+ public int wakeUpInactiveVillagers = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 4 : 1; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 4; // Plazma - Optimize default configurations
|
||||||
public int wakeUpInactiveVillagersEvery = 30*20;
|
public int wakeUpInactiveVillagersEvery = 30*20;
|
||||||
- public int wakeUpInactiveVillagersFor = 5*20;
|
- public int wakeUpInactiveVillagersFor = 5*20;
|
||||||
- public int wakeUpInactiveFlying = 8;
|
- public int wakeUpInactiveFlying = 8;
|
||||||
+ public int wakeUpInactiveVillagersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 20; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 20 : 100; // Plazma - Optimize default configurations
|
||||||
+ public int wakeUpInactiveFlying = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 1; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 8; // Plazma - Optimize default configurations
|
||||||
public int wakeUpInactiveFlyingEvery = 10*20;
|
public int wakeUpInactiveFlyingEvery = 10*20;
|
||||||
- public int wakeUpInactiveFlyingFor = 5*20;
|
- public int wakeUpInactiveFlyingFor = 5*20;
|
||||||
+ public int wakeUpInactiveFlyingFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations
|
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||||
public int villagersWorkImmunityAfter = 5*20;
|
public int villagersWorkImmunityAfter = 5*20;
|
||||||
public int villagersWorkImmunityFor = 20;
|
public int villagersWorkImmunityFor = 20;
|
||||||
public boolean villagersActiveForPanic = true;
|
public boolean villagersActiveForPanic = true;
|
||||||
@@ -386,7 +420,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
this.set( "ticks-per.hopper-check", 1 );
|
this.set( "ticks-per.hopper-check", 1 );
|
||||||
}
|
}
|
||||||
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
|
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
|
||||||
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 8 ); // Plazma - Optimize Default Configurations
|
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8: 1 ); // Plazma - Optimize default configurations
|
||||||
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
||||||
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
|
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
|
||||||
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
|
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
|
||||||
@@ -395,7 +429,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
|||||||
private void arrowDespawnRate()
|
private void arrowDespawnRate()
|
||||||
{
|
{
|
||||||
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
|
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
|
||||||
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1200 : 300 ); // Plazma - Optimize Default Configurations
|
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 300 : 1200 ); // Plazma - Optimize default configurations
|
||||||
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
|
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
|
||||||
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
|
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
|
||||||
}
|
}
|
||||||
102
patches/server/0009-Console-logging-tweaks.patch
Normal file
102
patches/server/0009-Console-logging-tweaks.patch
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 16:55:12 +0900
|
||||||
|
Subject: [PATCH] Console logging tweaks
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
|
index e4fd372a1d585887287253a02531cd192929377b..dae0b0e1288afe0d8eb70d0e8e2db152aad42bf4 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
|
@@ -355,7 +355,7 @@ public final class ChatProcessor {
|
||||||
|
|
||||||
|
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
|
||||||
|
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
|
||||||
|
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
|
||||||
|
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage)) ? null : "Not Secure"); // Plazma
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb171834d940 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -180,16 +180,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
- // Paper start - detect running as root
|
||||||
|
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||||
|
- DedicatedServer.LOGGER.warn("****************************");
|
||||||
|
- DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||||
|
- DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||||
|
- DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
||||||
|
- DedicatedServer.LOGGER.warn("****************************");
|
||||||
|
- }
|
||||||
|
- // Paper end
|
||||||
|
-
|
||||||
|
DedicatedServer.LOGGER.info("Loading properties");
|
||||||
|
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
|
||||||
|
|
||||||
|
@@ -318,6 +308,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||||
|
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||||
|
// Paper end
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.offlineWarnings) // Plazma - Console logging tweaks
|
||||||
|
if (!this.usesAuthentication()) {
|
||||||
|
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||||
|
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||||
|
@@ -331,9 +322,21 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||||
|
}
|
||||||
|
// Spigot end
|
||||||
|
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||||
|
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file or set \"console-logs.offline-warning\" to \"false\" in the config/plazma-global.yml file."); // Plazma
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Plazma start - Console logging tweaks
|
||||||
|
+ // Moved down
|
||||||
|
+ // Paper start - detect running as root
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||||
|
+ DedicatedServer.LOGGER.warn("****************************");
|
||||||
|
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||||
|
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||||
|
+ DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
||||||
|
+ DedicatedServer.LOGGER.warn("****************************");
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
+ // Plazma end
|
||||||
|
|
||||||
|
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
||||||
|
return false;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
index 5c38df8170033dbfee267520991a3cc3285d219e..58cc1bed851994fb591e9b832b98d25eda153b47 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
@@ -1440,7 +1440,7 @@ public abstract class PlayerList {
|
||||||
|
}
|
||||||
|
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||||
|
// Paper end
|
||||||
|
- boolean flag = this.verifyChatTrusted(message);
|
||||||
|
+ boolean flag = !org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || this.verifyChatTrusted(message); // Plazma
|
||||||
|
|
||||||
|
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
|
||||||
|
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index d506e0c2b37f91e46e682652bd134ad91db28f84..44df2c0a1ed3d006b455ba2a47d6bc9059d804e1 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -40,4 +40,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
public class Player extends ConfigurationPart {
|
||||||
|
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public ConsoleLogs consoleLogs;
|
||||||
|
+ public class ConsoleLogs extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean offlineWarnings = true;
|
||||||
|
+ public boolean rootUserWarnings = true;
|
||||||
|
+ public boolean notSecurePrefix = true;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
}
|
||||||
@@ -1,32 +1,31 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Thu, 23 Mar 2023 21:20:20 +0900
|
Date: Wed, 27 Sep 2023 16:59:14 +0900
|
||||||
Subject: [PATCH] Add option to allow any usernames
|
Subject: [PATCH] Add option to allow any usernames
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
index 01d5fa265fb2818465b5a71a2e2efeec751a7a05..0f1ebdc20460da22c1ff2fee2ff6428654139969 100644
|
index b875f4af9dcb45bcad0ee59a958442ba673268fe..d38685f82d2e6c4e71179bf3a85a8b183aa6c44b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -240,7 +240,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
@@ -161,6 +161,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||||
@Override
|
@Override
|
||||||
public void handleHello(ServerboundHelloPacket packet) {
|
public void handleHello(ServerboundHelloPacket packet) {
|
||||||
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
||||||
- Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
|
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.allowAnyUsername) // Plazma - Add option to allow any usernames
|
||||||
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.allowAnyUsername) Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); // Plazma
|
Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
|
||||||
// Paper start - validate usernames
|
// Paper start - validate usernames
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||||
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
|
|
||||||
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 61f364abb094a1d137478c106fefa22ceb057ed2..a45ff31d08129c0d5f159615d934a4450d54146e 100644
|
index 44df2c0a1ed3d006b455ba2a47d6bc9059d804e1..00c95194788d56f539d1c75e9a1ce48e950c096c 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
|
||||||
@@ -32,7 +32,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
@@ -39,6 +39,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
public Player player;
|
public Player player;
|
||||||
public class Player extends ConfigurationPart {
|
public class Player extends ConfigurationPart {
|
||||||
|
|
||||||
-
|
|
||||||
+ public boolean allowAnyUsername = false;
|
+ public boolean allowAnyUsername = false;
|
||||||
|
+
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public ConsoleLogs consoleLogs;
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Thu, 23 Mar 2023 14:25:09 +0900
|
|
||||||
Subject: [PATCH] ChunkSending Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index 857ddc62dd9affbbebcd7cde8a6d675dbb5f68ae..7df971a1bd47862918f4c7342eae19226c4c9fbe 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -22,4 +22,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
|
|
||||||
@Setting(Configuration.VERSION_FIELD)
|
|
||||||
public int version = CURRENT_VERSION;
|
|
||||||
+
|
|
||||||
+ public ChunkSending chunkSending;
|
|
||||||
+ public class ChunkSending extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public boolean enabled = DO_OPTIMIZE;
|
|
||||||
+ public int maxChunksPerTick = 5;
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing purpur configuration options
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||||
index 7166f4a39fd615e10d7b1f53c57363832a41f365..599eeb043bba787b88003ad2ac128e8d7f3e69c6 100644
|
index c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1ab5c51aae 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||||
@@ -151,6 +151,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
@@ -150,6 +150,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||||
protected void registerGoals() {
|
protected void registerGoals() {
|
||||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||||
}
|
}
|
||||||
@@ -33,10 +33,10 @@ index 7166f4a39fd615e10d7b1f53c57363832a41f365..599eeb043bba787b88003ad2ac128e8d
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
index 9f19ebfa6392a080672c472e08f755379e9776b4..e5aa7d1cf2e3178f7117e40f2df444963af43d67 100644
|
index 1d84135c709a90843b1ee34fb47508e78a7ce95d..c97ef420581803b569d130b58a97f67d1fee54f2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
@@ -93,6 +93,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
@@ -95,6 +95,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||||
public int getPurpurBreedTime() {
|
public int getPurpurBreedTime() {
|
||||||
return this.level().purpurConfig.camelBreedingTicks;
|
return this.level().purpurConfig.camelBreedingTicks;
|
||||||
}
|
}
|
||||||
@@ -56,10 +56,10 @@ index 9f19ebfa6392a080672c472e08f755379e9776b4..e5aa7d1cf2e3178f7117e40f2df44496
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
index dc1e8bcd8049d79c0e383ccd6a5697f79a3a2ebd..c0fce0582530e24d25368a9600b4f8c06d4f8286 100644
|
index 9417ce67cc231d5bfa6813f78ec27196eed423c8..4e471e4a259a64c44da5ab450f0137691428ff6a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||||
@@ -134,6 +134,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
@@ -136,6 +136,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||||
public float getJumpPower() {
|
public float getJumpPower() {
|
||||||
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
|
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
|
||||||
}
|
}
|
||||||
@@ -112,10 +112,10 @@ index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e1
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
index 552777d7ef6a1190a3b84bdf2f130f735c61d275..87f56c75742d856cdae24f525eac72aa5bce5ce2 100644
|
index dcb10e2ea1e0c7d0479adae5bc2ff57ece172aad..795c93352dfa69fad0e034a8377eceb6dc1e81da 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
@@ -105,6 +105,18 @@ public class Sniffer extends Animal {
|
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
|
||||||
public boolean isControllable() {
|
public boolean isControllable() {
|
||||||
return level().purpurConfig.snifferControllable;
|
return level().purpurConfig.snifferControllable;
|
||||||
}
|
}
|
||||||
@@ -135,10 +135,10 @@ index 552777d7ef6a1190a3b84bdf2f130f735c61d275..87f56c75742d856cdae24f525eac72aa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
index 3fa46affc4d77d01909cfeaeaba6e06ba9fd5592..6d3373393e38f0ee530baab0d828e7c2722e9b9b 100644
|
index 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652c17fe240 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
@@ -145,6 +145,23 @@ public class Warden extends Monster implements VibrationSystem {
|
@@ -146,6 +146,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||||
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||||
}
|
}
|
||||||
@@ -185,10 +185,10 @@ index e88c39d405fc7068db64ad34a03dec8d559e749e..bb5d42ca73722f3a02154ed889625ded
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
index d0968eeb0f9edeee43394da8a32d3ee8d491737b..00e4bea74de63da5dc174febe6d6473729ddf8ac 100644
|
index 5f0b10932f8dda09131ba68207cbfea4715e0f33..92cb442d9326b4fd47cd6ec0425192f751d3e538 100644
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||||
@@ -331,6 +331,7 @@ public class PurpurConfig {
|
@@ -329,6 +329,7 @@ public class PurpurConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int barrelRows = 3;
|
public static int barrelRows = 3;
|
||||||
@@ -196,7 +196,7 @@ index d0968eeb0f9edeee43394da8a32d3ee8d491737b..00e4bea74de63da5dc174febe6d64737
|
|||||||
public static boolean enderChestSixRows = false;
|
public static boolean enderChestSixRows = false;
|
||||||
public static boolean enderChestPermissionRows = false;
|
public static boolean enderChestPermissionRows = false;
|
||||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||||
@@ -371,6 +372,7 @@ public class PurpurConfig {
|
@@ -369,6 +370,7 @@ public class PurpurConfig {
|
||||||
case 1 -> 9;
|
case 1 -> 9;
|
||||||
default -> 27;
|
default -> 27;
|
||||||
});
|
});
|
||||||
@@ -205,10 +205,10 @@ index d0968eeb0f9edeee43394da8a32d3ee8d491737b..00e4bea74de63da5dc174febe6d64737
|
|||||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73fa3d505f3 100644
|
index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724ab4f69a7 100644
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
@@ -1117,7 +1117,15 @@ public class PurpurWorldConfig {
|
@@ -1113,7 +1113,15 @@ public class PurpurWorldConfig {
|
||||||
public boolean allayRidableInWater = true;
|
public boolean allayRidableInWater = true;
|
||||||
public boolean allayControllable = true;
|
public boolean allayControllable = true;
|
||||||
public List<String> allayRespectNBT = new ArrayList<>();
|
public List<String> allayRespectNBT = new ArrayList<>();
|
||||||
@@ -224,7 +224,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
|||||||
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
||||||
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
||||||
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
||||||
@@ -1236,7 +1244,15 @@ public class PurpurWorldConfig {
|
@@ -1232,7 +1240,15 @@ public class PurpurWorldConfig {
|
||||||
public double camelMovementSpeedMin = 0.09D;
|
public double camelMovementSpeedMin = 0.09D;
|
||||||
public double camelMovementSpeedMax = 0.09D;
|
public double camelMovementSpeedMax = 0.09D;
|
||||||
public int camelBreedingTicks = 6000;
|
public int camelBreedingTicks = 6000;
|
||||||
@@ -240,7 +240,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
|||||||
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||||
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
||||||
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
||||||
@@ -1664,7 +1680,15 @@ public class PurpurWorldConfig {
|
@@ -1660,7 +1676,15 @@ public class PurpurWorldConfig {
|
||||||
public boolean frogControllable = true;
|
public boolean frogControllable = true;
|
||||||
public float frogRidableJumpHeight = 0.65F;
|
public float frogRidableJumpHeight = 0.65F;
|
||||||
public int frogBreedingTicks = 6000;
|
public int frogBreedingTicks = 6000;
|
||||||
@@ -256,7 +256,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
|||||||
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
||||||
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
||||||
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
||||||
@@ -2617,7 +2641,13 @@ public class PurpurWorldConfig {
|
@@ -2613,7 +2637,13 @@ public class PurpurWorldConfig {
|
||||||
public boolean snifferControllable = true;
|
public boolean snifferControllable = true;
|
||||||
public double snifferMaxHealth = 14.0D;
|
public double snifferMaxHealth = 14.0D;
|
||||||
public int snifferBreedingTicks = 6000;
|
public int snifferBreedingTicks = 6000;
|
||||||
@@ -270,7 +270,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
|||||||
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
||||||
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
||||||
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
||||||
@@ -2716,7 +2746,15 @@ public class PurpurWorldConfig {
|
@@ -2712,7 +2742,15 @@ public class PurpurWorldConfig {
|
||||||
public boolean tadpoleRidable = false;
|
public boolean tadpoleRidable = false;
|
||||||
public boolean tadpoleRidableInWater = true;
|
public boolean tadpoleRidableInWater = true;
|
||||||
public boolean tadpoleControllable = true;
|
public boolean tadpoleControllable = true;
|
||||||
@@ -286,7 +286,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
|||||||
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
||||||
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
||||||
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
||||||
@@ -2926,7 +2964,15 @@ public class PurpurWorldConfig {
|
@@ -2922,7 +2960,15 @@ public class PurpurWorldConfig {
|
||||||
public boolean wardenRidable = false;
|
public boolean wardenRidable = false;
|
||||||
public boolean wardenRidableInWater = true;
|
public boolean wardenRidableInWater = true;
|
||||||
public boolean wardenControllable = true;
|
public boolean wardenControllable = true;
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Thu, 23 Mar 2023 14:32:26 +0900
|
|
||||||
Subject: [PATCH] Implement ChunkSending
|
|
||||||
|
|
||||||
Original: someaddons/chunksending
|
|
||||||
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
|
|
||||||
index e2202389a2c4133a183cca59c4e909fc419379ab..b3e731c122b315d28ae51d32b798f818e270c7ff 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
|
||||||
@@ -398,9 +398,12 @@ public class ChunkHolder {
|
|
||||||
// Paper end - rewrite chunk system
|
|
||||||
|
|
||||||
private void broadcast(List<ServerPlayer> players, Packet<?> packet) {
|
|
||||||
- players.forEach((entityplayer) -> {
|
|
||||||
- entityplayer.connection.send(packet);
|
|
||||||
- });
|
|
||||||
+ // Plazma start
|
|
||||||
+ for (ServerPlayer player : players) {
|
|
||||||
+ if (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet)) continue;
|
|
||||||
+ player.connection.send(packet);
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paper - rewrite chunk system
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
index 0249eeb3937cf48cea13846a7e39b248947e21a4..f39b3f1b5b37d1939766952a985684279cb2bf2d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
@@ -772,7 +772,35 @@ public class ServerPlayer extends Player {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Purpur end
|
|
||||||
+ // Plazma start - Implement ChunkSending
|
|
||||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
|
||||||
+ if (chunksToSend.isEmpty()) return;
|
|
||||||
+
|
|
||||||
+ if (disconnected) {
|
|
||||||
+ chunksToSend.clear();
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ final List<java.util.Map.Entry<ChunkPos, List<Packet<?>>>> packets = new java.util.ArrayList<>(chunksToSend.entrySet());
|
|
||||||
+ packets.sort(java.util.Comparator.comparingDouble(e -> e.getKey().getMiddleBlockPosition(getBlockY()).distSqr(blockPosition())));
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < packets.size() && i < this.level().plazmaLevelConfiguration().chunkSending.maxChunksPerTick + packets.size() / 100; i++) {
|
|
||||||
+ final java.util.Map.Entry<ChunkPos, List<Packet<?>>> entry = packets.get(i);
|
|
||||||
+ for (final Packet<?> packet : entry.getValue()) {
|
|
||||||
+ connection.send(packet);
|
|
||||||
+ }
|
|
||||||
+ chunksToSend.remove(entry.getKey());
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public boolean attachToPending(final ChunkPos pos, final Packet<?> packet) {
|
|
||||||
+ final List<Packet<?>> packetList = chunksToSend.get(pos);
|
|
||||||
+ if (packetList == null) return false;
|
|
||||||
+ packetList.add(packet);
|
|
||||||
+ return true;
|
|
||||||
}
|
|
||||||
+ // Plazma end
|
|
||||||
|
|
||||||
public void doTick() {
|
|
||||||
try {
|
|
||||||
@@ -2437,7 +2465,14 @@ public class ServerPlayer extends Player {
|
|
||||||
return true; // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Plazma start - Implement ChunkSending
|
|
||||||
+ private final java.util.Map<ChunkPos, List<Packet<?>>> chunksToSend = java.util.Collections.synchronizedMap(new java.util.HashMap<>());
|
|
||||||
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
|
|
||||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
|
||||||
+ List<Packet<?>> packetList = chunksToSend.computeIfAbsent(chunkPos, k -> new java.util.ArrayList<>());
|
|
||||||
+ packetList.add(chunkDataPacket);
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
this.connection.send(chunkDataPacket);
|
|
||||||
// Paper start
|
|
||||||
if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){
|
|
||||||
944
patches/server/0012-Completely-remove-Mojang-Profiler.patch
Normal file
944
patches/server/0012-Completely-remove-Mojang-Profiler.patch
Normal file
@@ -0,0 +1,944 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 17:52:52 +0900
|
||||||
|
Subject: [PATCH] Completely remove Mojang Profiler
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
index 11de2f237e6dd950b8ddba3d5cfe9066d09f0903..44248dc470d0882b7287debd1993cedf0f238aca 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -113,16 +113,16 @@ import net.minecraft.util.Unit;
|
||||||
|
import net.minecraft.util.datafix.DataFixers;
|
||||||
|
import net.minecraft.util.profiling.EmptyProfileResults;
|
||||||
|
import net.minecraft.util.profiling.ProfileResults;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.profiling.ResultField;
|
||||||
|
-import net.minecraft.util.profiling.SingleTickProfiler;
|
||||||
|
+//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||||
|
import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
|
||||||
|
-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder;
|
||||||
|
-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder;
|
||||||
|
-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder;
|
||||||
|
-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider;
|
||||||
|
-import net.minecraft.util.profiling.metrics.storage.MetricsPersister;
|
||||||
|
+//import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Completely remove profiler
|
||||||
|
+//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove profiler
|
||||||
|
+//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove profiler
|
||||||
|
+//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove profiler
|
||||||
|
+//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
||||||
|
import net.minecraft.world.Difficulty;
|
||||||
|
import net.minecraft.world.RandomSequences;
|
||||||
|
@@ -214,11 +214,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
public LevelStorageSource.LevelStorageAccess storageSource;
|
||||||
|
public final PlayerDataStorage playerDataStorage;
|
||||||
|
private final List<Runnable> tickables = Lists.newArrayList();
|
||||||
|
- private MetricsRecorder metricsRecorder;
|
||||||
|
- private ProfilerFiller profiler;
|
||||||
|
- private Consumer<ProfileResults> onMetricsRecordingStopped;
|
||||||
|
- private Consumer<Path> onMetricsRecordingFinished;
|
||||||
|
- private boolean willStartRecordingMetrics;
|
||||||
|
+ //private MetricsRecorder metricsRecorder; // Plazma - Completely remove profiler
|
||||||
|
+ //private ProfilerFiller profiler; // Plazma - Completely remove profiler
|
||||||
|
+ //private Consumer<ProfileResults> onMetricsRecordingStopped; // Plazma - Completely remove profiler
|
||||||
|
+ //private Consumer<Path> onMetricsRecordingFinished; // Plazma - Completely remove profiler
|
||||||
|
+ //private boolean willStartRecordingMetrics; // Plazma - Completely remove profiler
|
||||||
|
@Nullable
|
||||||
|
private MinecraftServer.TimeProfiler debugCommandProfiler;
|
||||||
|
private boolean debugCommandProfilerDelayStart;
|
||||||
|
@@ -2309,10 +2309,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* // Plazma - Completely remove profiler
|
||||||
|
public ProfilerFiller getProfiler() {
|
||||||
|
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Purpur
|
||||||
|
return this.profiler;
|
||||||
|
}
|
||||||
|
+ */ // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public abstract boolean isSingleplayerOwner(GameProfile profile);
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||||
|
index ebcd2bbcf8f25c52de3deaff32a8522dbf662141..0ff246c5f7c6f02c12a55b1d9c7b35ad3fd4c1c0 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||||
|
@@ -22,7 +22,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||||
|
import net.minecraft.util.GsonHelper;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.level.storage.loot.LootDataManager;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
||||||
|
this.lootData = conditionManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
||||||
|
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
||||||
|
Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
|
||||||
|
|
||||||
|
prepared.forEach((minecraftkey, jsonelement) -> {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||||
|
index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..6783dc11a321c244296e84223c51cd1a489a9b96 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||||
|
@@ -25,7 +25,7 @@ import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||||
|
import net.minecraft.server.packs.resources.Resource;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
import net.minecraft.tags.TagLoader;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.phys.Vec2;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
@@ -62,7 +62,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||||
|
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||||
|
CompletableFuture<Map<ResourceLocation, List<TagLoader.EntryWithSource>>> completableFuture = CompletableFuture.supplyAsync(() -> {
|
||||||
|
return this.tagsLoader.load(manager);
|
||||||
|
}, prepareExecutor);
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
|
index 097ac55028d66ef9ab430ff5dd103db6e3b99fc7..2993e9f326c43ef3f06d5e332899f9fad1f03718 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
|
@@ -19,7 +19,7 @@ import net.minecraft.commands.FunctionInstantiationException;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.level.GameRules;
|
||||||
|
|
||||||
|
public class ServerFunctionManager {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
|
index 3f4df62773dfe1045914325ce5bc13162192679c..0f27bdc25dc5246d98358a26e1d01e17bc779c2d 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
|
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||||
|
import net.minecraft.server.network.ServerPlayerConnection;
|
||||||
|
import net.minecraft.util.CsvOutput;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.thread.BlockableEventLoop;
|
||||||
|
import net.minecraft.util.thread.ProcessorHandle;
|
||||||
|
import net.minecraft.util.thread.ProcessorMailbox;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
|
index 6255960ae70e14eb11da5043eb003575e300ddf6..999f57366cad34f92a1f80437bf7bd84b40c0e6b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
|
@@ -24,7 +24,7 @@ import net.minecraft.core.SectionPos;
|
||||||
|
import net.minecraft.network.protocol.Packet;
|
||||||
|
import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||||
|
import net.minecraft.util.VisibleForDebug;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.thread.BlockableEventLoop;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index e7efdd572716e50ecca217898b8a368e5829f925..72c2af8638d71b92a9762dedb0efec53ce8094f7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
@@ -77,7 +77,7 @@ import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.util.ProgressListener;
|
||||||
|
import net.minecraft.util.RandomSource;
|
||||||
|
import net.minecraft.util.Unit;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.valueproviders.IntProvider;
|
||||||
|
import net.minecraft.util.valueproviders.UniformInt;
|
||||||
|
import net.minecraft.world.DifficultyInstance;
|
||||||
|
@@ -694,15 +694,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
|
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||||
|
|
||||||
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||||
|
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma
|
||||||
|
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type()/*, minecraftserver::getProfiler*/, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
||||||
|
this.pvpMode = minecraftserver.isPvpAllowed();
|
||||||
|
this.convertable = convertable_conversionsession;
|
||||||
|
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||||
|
// CraftBukkit end
|
||||||
|
this.players = Lists.newArrayList();
|
||||||
|
this.entityTickList = new EntityTickList();
|
||||||
|
- this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||||
|
- this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||||
|
+ this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||||
|
+ this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||||
|
this.navigatingMobs = new ObjectOpenHashSet();
|
||||||
|
this.blockEvents = new ObjectLinkedOpenHashSet();
|
||||||
|
this.blockEventsToReschedule = new ArrayList(64);
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||||
|
index 828196decc89e7e03f88c4a3208ee1ab2bb69242..c0088e0e566abb928c8dcd6f819d82cc1122589b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||||
|
@@ -2,10 +2,10 @@ package net.minecraft.server.packs.resources;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public interface PreparableReloadListener {
|
||||||
|
- CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor);
|
||||||
|
+ CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor); // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
default String getName() {
|
||||||
|
return this.getClass().getSimpleName();
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||||
|
index 7383c7d3820dce06108eaafd236a7c6c06a10a42..4e1f4e026cd7c566468a58b2ea232d5dee80b86f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||||
|
@@ -3,11 +3,11 @@ package net.minecraft.server.packs.resources;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import net.minecraft.util.Unit;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public interface ResourceManagerReloadListener extends PreparableReloadListener {
|
||||||
|
@Override
|
||||||
|
- default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||||
|
+ default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||||
|
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
|
||||||
|
//applyProfiler.startTick(); // Purpur
|
||||||
|
//applyProfiler.push("listener"); // Purpur
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||||
|
index 9cc09f0415a09299102dbcf022326944368ea033..2e9e63f3ee6268cafa3b90666cf31019e7341dbb 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||||
|
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||||
|
import net.minecraft.resources.FileToIdConverter;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.GsonHelper;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener<Map<ResourceLocation, JsonElement>> {
|
||||||
|
@@ -25,7 +25,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparableR
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) {
|
||||||
|
+ protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager/*, ProfilerFiller profilerFiller*/) { // Plazma - Completely remove Profiler
|
||||||
|
Map<ResourceLocation, JsonElement> map = new HashMap<>();
|
||||||
|
scanDirectory(resourceManager, this.directory, this.gson, map);
|
||||||
|
return map;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||||
|
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..7de117e0464a24da632d134870554fd11e1b87ca 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||||
|
@@ -2,19 +2,19 @@ package net.minecraft.server.packs.resources;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
|
||||||
|
@Override
|
||||||
|
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||||
|
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||||
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
- return this.prepare(manager, prepareProfiler);
|
||||||
|
+ return this.prepare(manager/*, prepareProfiler*/); // Plazma - Completely remove profiler
|
||||||
|
}, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> {
|
||||||
|
- this.apply(prepared, manager, applyProfiler);
|
||||||
|
+ this.apply(prepared, manager/*, applyProfiler*/); // Plazma - Completely remove profiler
|
||||||
|
}, applyExecutor);
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler);
|
||||||
|
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler);
|
||||||
|
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||||
|
index de2ecc7c69fb870f843f60596115866214267ee4..05a731dec4aec1d3cf61a761bda018cc8c46afde 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||||
|
@@ -26,7 +26,7 @@ public class SimpleReloadInstance<S> implements ReloadInstance {
|
||||||
|
|
||||||
|
public static SimpleReloadInstance<Void> of(ResourceManager manager, List<PreparableReloadListener> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) {
|
||||||
|
return new SimpleReloadInstance<>(prepareExecutor, applyExecutor, manager, reloaders, (synchronizer, resourceManager, reloader, prepare, apply) -> {
|
||||||
|
- return reloader.reload(synchronizer, resourceManager, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, prepareExecutor, apply);
|
||||||
|
+ return reloader.reload(synchronizer, resourceManager/*, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE*/, prepareExecutor, apply); // Plazma - Completely remove Profiler
|
||||||
|
}, initialStage);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/tags/TagManager.java b/src/main/java/net/minecraft/tags/TagManager.java
|
||||||
|
index 60ed9413c32d91ce33583cc24998d08869d07a23..67c0d8f7294e18c7b2107b82219bc106608a21f0 100644
|
||||||
|
--- a/src/main/java/net/minecraft/tags/TagManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/tags/TagManager.java
|
||||||
|
@@ -14,7 +14,7 @@ import net.minecraft.resources.ResourceKey;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public class TagManager implements PreparableReloadListener {
|
||||||
|
private static final Map<ResourceKey<? extends Registry<?>>, String> CUSTOM_REGISTRY_DIRECTORIES = Map.of(Registries.BLOCK, "tags/blocks", Registries.ENTITY_TYPE, "tags/entity_types", Registries.FLUID, "tags/fluids", Registries.GAME_EVENT, "tags/game_events", Registries.ITEM, "tags/items");
|
||||||
|
@@ -35,7 +35,7 @@ public class TagManager implements PreparableReloadListener {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||||
|
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||||
|
List<? extends CompletableFuture<? extends TagManager.LoadResult<?>>> list = this.registryAccess.registries().map((registry) -> {
|
||||||
|
return this.createLoader(manager, prepareExecutor, registry);
|
||||||
|
}).toList();
|
||||||
|
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||||
|
deleted file mode 100644
|
||||||
|
index c6c30d99399c5cde2b0ec2f320d81d952b422d78..0000000000000000000000000000000000000000
|
||||||
|
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,208 +0,0 @@
|
||||||
|
-package net.minecraft.util.profiling;
|
||||||
|
-
|
||||||
|
-import com.google.common.collect.Lists;
|
||||||
|
-import com.google.common.collect.Maps;
|
||||||
|
-import com.mojang.logging.LogUtils;
|
||||||
|
-import it.unimi.dsi.fastutil.longs.LongArrayList;
|
||||||
|
-import it.unimi.dsi.fastutil.longs.LongList;
|
||||||
|
-import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||||
|
-import it.unimi.dsi.fastutil.objects.Object2LongMaps;
|
||||||
|
-import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||||
|
-import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||||
|
-import java.time.Duration;
|
||||||
|
-import java.util.List;
|
||||||
|
-import java.util.Map;
|
||||||
|
-import java.util.Set;
|
||||||
|
-import java.util.function.IntSupplier;
|
||||||
|
-import java.util.function.LongSupplier;
|
||||||
|
-import java.util.function.Supplier;
|
||||||
|
-import javax.annotation.Nullable;
|
||||||
|
-import net.minecraft.Util;
|
||||||
|
-import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||||
|
-import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
-import org.slf4j.Logger;
|
||||||
|
-
|
||||||
|
-public class ActiveProfiler implements ProfileCollector {
|
||||||
|
- private static final long WARNING_TIME_NANOS = Duration.ofMillis(100L).toNanos();
|
||||||
|
- private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
- private final List<String> paths = Lists.newArrayList();
|
||||||
|
- private final LongList startTimes = new LongArrayList();
|
||||||
|
- private final Map<String, ActiveProfiler.PathEntry> entries = Maps.newHashMap();
|
||||||
|
- private final IntSupplier getTickTime;
|
||||||
|
- private final LongSupplier getRealTime;
|
||||||
|
- private final long startTimeNano;
|
||||||
|
- private final int startTimeTicks;
|
||||||
|
- private String path = "";
|
||||||
|
- private boolean started;
|
||||||
|
- @Nullable
|
||||||
|
- private ActiveProfiler.PathEntry currentEntry;
|
||||||
|
- private final boolean warn;
|
||||||
|
- private final Set<Pair<String, MetricCategory>> chartedPaths = new ObjectArraySet<>();
|
||||||
|
-
|
||||||
|
- public ActiveProfiler(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout) {
|
||||||
|
- this.startTimeNano = timeGetter.getAsLong();
|
||||||
|
- this.getRealTime = timeGetter;
|
||||||
|
- this.startTimeTicks = tickGetter.getAsInt();
|
||||||
|
- this.getTickTime = tickGetter;
|
||||||
|
- this.warn = checkTimeout;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void startTick() {
|
||||||
|
- if (this.started) {
|
||||||
|
- LOGGER.error("Profiler tick already started - missing endTick()?");
|
||||||
|
- } else {
|
||||||
|
- this.started = true;
|
||||||
|
- this.path = "";
|
||||||
|
- this.paths.clear();
|
||||||
|
- //this.push("root"); // Purpur
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void endTick() {
|
||||||
|
- if (!this.started) {
|
||||||
|
- LOGGER.error("Profiler tick already ended - missing startTick()?");
|
||||||
|
- } else {
|
||||||
|
- //this.pop(); // Purpur
|
||||||
|
- this.started = false;
|
||||||
|
- if (!this.path.isEmpty()) {
|
||||||
|
- LOGGER.error("Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", LogUtils.defer(() -> {
|
||||||
|
- return ProfileResults.demanglePath(this.path);
|
||||||
|
- }));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void push(String location) {
|
||||||
|
- if (!this.started) {
|
||||||
|
- LOGGER.error("Cannot push '{}' to profiler if profiler tick hasn't started - missing startTick()?", (Object)location);
|
||||||
|
- } else {
|
||||||
|
- if (!this.path.isEmpty()) {
|
||||||
|
- this.path = this.path + "\u001e";
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- this.path = this.path + location;
|
||||||
|
- this.paths.add(this.path);
|
||||||
|
- this.startTimes.add(Util.getNanos());
|
||||||
|
- this.currentEntry = null;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void push(Supplier<String> locationGetter) {
|
||||||
|
- //this.push(locationGetter.get()); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void markForCharting(MetricCategory type) {
|
||||||
|
- this.chartedPaths.add(Pair.of(this.path, type));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void pop() {
|
||||||
|
- if (!this.started) {
|
||||||
|
- LOGGER.error("Cannot pop from profiler if profiler tick hasn't started - missing startTick()?");
|
||||||
|
- } else if (this.startTimes.isEmpty()) {
|
||||||
|
- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?");
|
||||||
|
- } else {
|
||||||
|
- long l = Util.getNanos();
|
||||||
|
- long m = this.startTimes.removeLong(this.startTimes.size() - 1);
|
||||||
|
- this.paths.remove(this.paths.size() - 1);
|
||||||
|
- long n = l - m;
|
||||||
|
- ActiveProfiler.PathEntry pathEntry = this.getCurrentEntry();
|
||||||
|
- pathEntry.accumulatedDuration += n;
|
||||||
|
- ++pathEntry.count;
|
||||||
|
- pathEntry.maxDuration = Math.max(pathEntry.maxDuration, n);
|
||||||
|
- pathEntry.minDuration = Math.min(pathEntry.minDuration, n);
|
||||||
|
- if (this.warn && n > WARNING_TIME_NANOS) {
|
||||||
|
- LOGGER.warn("Something's taking too long! '{}' took aprox {} ms", LogUtils.defer(() -> {
|
||||||
|
- return ProfileResults.demanglePath(this.path);
|
||||||
|
- }), LogUtils.defer(() -> {
|
||||||
|
- return (double)n / 1000000.0D;
|
||||||
|
- }));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- this.path = this.paths.isEmpty() ? "" : this.paths.get(this.paths.size() - 1);
|
||||||
|
- this.currentEntry = null;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void popPush(String location) {
|
||||||
|
- //this.pop(); // Purpur
|
||||||
|
- //this.push(location); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void popPush(Supplier<String> locationGetter) {
|
||||||
|
- //this.pop(); // Purpur
|
||||||
|
- //this.push(locationGetter); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- private ActiveProfiler.PathEntry getCurrentEntry() {
|
||||||
|
- if (this.currentEntry == null) {
|
||||||
|
- this.currentEntry = this.entries.computeIfAbsent(this.path, (k) -> {
|
||||||
|
- return new ActiveProfiler.PathEntry();
|
||||||
|
- });
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return this.currentEntry;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void incrementCounter(String marker, int num) {
|
||||||
|
- this.getCurrentEntry().counters.addTo(marker, (long)num);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
||||||
|
- this.getCurrentEntry().counters.addTo(markerGetter.get(), (long)num);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public ProfileResults getResults() {
|
||||||
|
- return new FilledProfileResults(this.entries, this.startTimeNano, this.startTimeTicks, this.getRealTime.getAsLong(), this.getTickTime.getAsInt());
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Nullable
|
||||||
|
- @Override
|
||||||
|
- public ActiveProfiler.PathEntry getEntry(String name) {
|
||||||
|
- return this.entries.get(name);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public Set<Pair<String, MetricCategory>> getChartedPaths() {
|
||||||
|
- return this.chartedPaths;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- public static class PathEntry implements ProfilerPathEntry {
|
||||||
|
- long maxDuration = Long.MIN_VALUE;
|
||||||
|
- long minDuration = Long.MAX_VALUE;
|
||||||
|
- long accumulatedDuration;
|
||||||
|
- long count;
|
||||||
|
- final Object2LongOpenHashMap<String> counters = new Object2LongOpenHashMap<>();
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public long getDuration() {
|
||||||
|
- return this.accumulatedDuration;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public long getMaxDuration() {
|
||||||
|
- return this.maxDuration;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public long getCount() {
|
||||||
|
- return this.count;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public Object2LongMap<String> getCounters() {
|
||||||
|
- return Object2LongMaps.unmodifiable(this.counters);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||||
|
deleted file mode 100644
|
||||||
|
index 863343a87fe34d72f04af89d75268b477b2adc7a..0000000000000000000000000000000000000000
|
||||||
|
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,116 +0,0 @@
|
||||||
|
-package net.minecraft.util.profiling;
|
||||||
|
-
|
||||||
|
-import java.util.function.Supplier;
|
||||||
|
-import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||||
|
-
|
||||||
|
-public interface ProfilerFiller {
|
||||||
|
- String ROOT = "root";
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void startTick();
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void endTick();
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void push(String location);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void push(Supplier<String> locationGetter);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void pop();
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void popPush(String location);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void popPush(Supplier<String> locationGetter);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void markForCharting(MetricCategory type);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- default void incrementCounter(String marker) {
|
||||||
|
- //this.incrementCounter(marker, 1); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void incrementCounter(String marker, int num);
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- default void incrementCounter(Supplier<String> markerGetter) {
|
||||||
|
- //this.incrementCounter(markerGetter, 1); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void incrementCounter(Supplier<String> markerGetter, int num);
|
||||||
|
-
|
||||||
|
- static ProfilerFiller tee(final ProfilerFiller a, final ProfilerFiller b) {
|
||||||
|
- if (a == InactiveProfiler.INSTANCE) {
|
||||||
|
- return b;
|
||||||
|
- } else {
|
||||||
|
- return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() {
|
||||||
|
- @Override
|
||||||
|
- public void startTick() {
|
||||||
|
- //a.startTick(); // Purpur
|
||||||
|
- //b.startTick(); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void endTick() {
|
||||||
|
- //a.endTick(); // Purpur
|
||||||
|
- //b.endTick(); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void push(String location) {
|
||||||
|
- //a.push(location); // Purpur
|
||||||
|
- //b.push(location); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void push(Supplier<String> locationGetter) {
|
||||||
|
- //a.push(locationGetter); // Purpur
|
||||||
|
- //b.push(locationGetter); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void markForCharting(MetricCategory type) {
|
||||||
|
- //a.markForCharting(type); // Purpur
|
||||||
|
- //b.markForCharting(type); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void pop() {
|
||||||
|
- //a.pop(); // Purpur
|
||||||
|
- //b.pop(); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void popPush(String location) {
|
||||||
|
- //a.popPush(location); // Purpur
|
||||||
|
- //b.popPush(location); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void popPush(Supplier<String> locationGetter) {
|
||||||
|
- //a.popPush(locationGetter); // Purpur
|
||||||
|
- //b.popPush(locationGetter); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void incrementCounter(String marker, int num) {
|
||||||
|
- //a.incrementCounter(marker, num); // Purpur
|
||||||
|
- //b.incrementCounter(marker, num); // Purpur
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
||||||
|
- //a.incrementCounter(markerGetter, num); // Purpur
|
||||||
|
- //b.incrementCounter(markerGetter, num); // Purpur
|
||||||
|
- }
|
||||||
|
- };
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
||||||
|
deleted file mode 100644
|
||||||
|
index 729ebd1b2433327de243d0168289e180a841f47c..0000000000000000000000000000000000000000
|
||||||
|
--- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,24 +0,0 @@
|
||||||
|
-package net.minecraft.util.profiling.metrics.profiling;
|
||||||
|
-
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
-
|
||||||
|
-@Deprecated(forRemoval = true)
|
||||||
|
-public interface MetricsRecorder {
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void end();
|
||||||
|
-
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void cancel();
|
||||||
|
-
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void startTick();
|
||||||
|
-
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- boolean isRecording();
|
||||||
|
-
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- ProfilerFiller getProfiler();
|
||||||
|
-
|
||||||
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||||
|
- void endTick();
|
||||||
|
-}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
index d35afa8f8648bbcbfc044323bcda1b1182d7dce4..fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
@@ -147,8 +147,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||||
|
this.pathfindingMalus = Maps.newEnumMap(BlockPathTypes.class);
|
||||||
|
this.restrictCenter = BlockPos.ZERO;
|
||||||
|
this.restrictRadius = -1.0F;
|
||||||
|
- this.goalSelector = new GoalSelector(world.getProfilerSupplier());
|
||||||
|
- this.targetSelector = new GoalSelector(world.getProfilerSupplier());
|
||||||
|
+ this.goalSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||||
|
+ this.targetSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||||
|
this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur
|
||||||
|
this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur
|
||||||
|
this.jumpControl = new JumpControl(this);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||||
|
index 02978315bc2b828cc603ce7478408f3f82c249c2..4f9b19c45afd6b26833ba892a90d3a9559d5d859 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||||
|
@@ -11,7 +11,7 @@ import java.util.Set;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
public class GoalSelector {
|
||||||
|
@@ -29,7 +29,7 @@ public class GoalSelector {
|
||||||
|
};
|
||||||
|
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
|
||||||
|
private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
|
||||||
|
- private final Supplier<ProfilerFiller> profiler;
|
||||||
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||||
|
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
|
||||||
|
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
|
||||||
|
private int tickCount;
|
||||||
|
@@ -37,9 +37,11 @@ public class GoalSelector {
|
||||||
|
private int curRate;
|
||||||
|
private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector
|
||||||
|
|
||||||
|
+ /* // Plazma - Completely remove profiler
|
||||||
|
public GoalSelector(Supplier<ProfilerFiller> profiler) {
|
||||||
|
this.profiler = profiler;
|
||||||
|
}
|
||||||
|
+ */ // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
public void addGoal(int priority, Goal goal) {
|
||||||
|
this.availableGoals.add(new WrappedGoal(priority, goal));
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||||
|
index 666fc85bc2079cb367b340f2605f29fe002f4d22..36c60716c6aaa446ff7123a3babafb2edd2266ac 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||||
|
@@ -31,7 +31,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||||
|
import net.minecraft.util.GsonHelper;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.Container;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
@@ -51,7 +51,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||||
|
super(RecipeManager.GSON, "recipes");
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
||||||
|
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Profiler
|
||||||
|
this.hasErrors = false;
|
||||||
|
// CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
|
||||||
|
Map<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>> map1 = Maps.newHashMap();
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e5619c08ec20 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
@@ -39,7 +39,7 @@ import net.minecraft.sounds.SoundSource;
|
||||||
|
import net.minecraft.util.AbortableIterationConsumer;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.util.RandomSource;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.DifficultyInstance;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.damagesource.DamageSources;
|
||||||
|
@@ -137,7 +137,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
private final ResourceKey<DimensionType> dimensionTypeId;
|
||||||
|
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||||
|
public final WritableLevelData levelData;
|
||||||
|
- private final Supplier<ProfilerFiller> profiler;
|
||||||
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||||
|
public final boolean isClientSide;
|
||||||
|
private final WorldBorder worldBorder;
|
||||||
|
private final BiomeManager biomeManager;
|
||||||
|
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
|
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma
|
||||||
|
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder/*, Supplier<ProfilerFiller> supplier*/, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
||||||
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||||
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||||
|
this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma
|
||||||
|
@@ -276,7 +276,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
}
|
||||||
|
|
||||||
|
// CraftBukkit end
|
||||||
|
- this.profiler = supplier;
|
||||||
|
+ //this.profiler = supplier; // Plazma - Completely remove profiler
|
||||||
|
this.levelData = worlddatamutable;
|
||||||
|
this.dimensionTypeRegistration = holder;
|
||||||
|
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
|
||||||
|
@@ -1830,6 +1830,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* // Plazma - Completely remove profiler
|
||||||
|
public ProfilerFiller getProfiler() {
|
||||||
|
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
|
||||||
|
return (ProfilerFiller) this.profiler.get();
|
||||||
|
@@ -1838,6 +1839,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
public Supplier<ProfilerFiller> getProfilerSupplier() {
|
||||||
|
return this.profiler;
|
||||||
|
}
|
||||||
|
+ */ // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BiomeManager getBiomeManager() {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
index 0f1025495237aebe30132ace0832aa5718d6f9bb..0226280bbdb9d63831d93f980ee117da1eac08aa 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||||
|
@@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Holder;
|
||||||
|
import net.minecraft.core.SectionPos;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.level.biome.Biome;
|
||||||
|
@@ -155,7 +155,9 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
|
||||||
|
return this.level.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* // Plazma - Completely remove profiler
|
||||||
|
public ProfilerFiller getProfiler() {
|
||||||
|
return this.level.getProfiler();
|
||||||
|
}
|
||||||
|
+ */ // Plazma - Completely remove profiler
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
index 8d385708df97d47881929d4352f1b90286aad1a2..a25b93f98b2c525b146c979df2a95a9a749300a8 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
@@ -25,7 +25,7 @@ import net.minecraft.network.FriendlyByteBuf;
|
||||||
|
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
|
||||||
|
import net.minecraft.server.level.FullChunkStatus;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
@@ -445,7 +445,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
|
||||||
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
|
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove profiler
|
||||||
|
|
||||||
|
//gameprofilerfiller.push("updateSkyLightSources"); // Purpur
|
||||||
|
this.skyLightSources.update(this, j, i, l);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
|
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..b9689131a7a46b46c0b75b86f2bb163d7de74921 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
|
@@ -12,7 +12,7 @@ import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.level.PathNavigationRegion;
|
||||||
|
@@ -44,7 +44,7 @@ public class PathFinder {
|
||||||
|
map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier);
|
||||||
|
+ Path path = this.findPath(/*world.getProfiler(), */node, map, followRange, distance, rangeMultiplier); // Plazma - Completely remove profiler
|
||||||
|
this.nodeEvaluator.done();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
@@ -52,7 +52,7 @@ public class PathFinder {
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
// Paper start - optimize collection
|
||||||
|
- private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
||||||
|
+ private Path findPath(/*ProfilerFiller profiler, */Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) { // Plazma - Completely remove profiler
|
||||||
|
//profiler.push("find_path"); // Purpur
|
||||||
|
//profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
||||||
|
// Set<Target> set = positions.keySet();
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||||
|
index dd375fffa727db76fa989248b9b836960974c372..45161f960a29395538c67461ebf864e595f6737f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||||
|
@@ -19,7 +19,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
|
||||||
|
public LootDataManager() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||||
|
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||||
|
Map<LootDataType<?>, Map<ResourceLocation, ?>> map = new HashMap();
|
||||||
|
CompletableFuture<?>[] acompletablefuture = (CompletableFuture[]) LootDataType.values().map((lootdatatype) -> {
|
||||||
|
return LootDataManager.scheduleElementParse(lootdatatype, manager, prepareExecutor, map);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||||
|
index 0043c0087896a6df6910b0500da37d84b287c901..17a5928afade7e477cda34365dc8c72c52a6b758 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||||
|
@@ -23,7 +23,7 @@ import net.minecraft.Util;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.SectionPos;
|
||||||
|
import net.minecraft.core.Vec3i;
|
||||||
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||||
|
return ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek());
|
||||||
|
};
|
||||||
|
private final LongPredicate tickCheck;
|
||||||
|
- private final Supplier<ProfilerFiller> profiler;
|
||||||
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||||
|
private final Long2ObjectMap<LevelChunkTicks<T>> allContainers = new Long2ObjectOpenHashMap<>();
|
||||||
|
private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), (map) -> {
|
||||||
|
map.defaultReturnValue(Long.MAX_VALUE);
|
||||||
|
@@ -48,9 +48,9 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier<ProfilerFiller> profilerGetter) {
|
||||||
|
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) { // Plazma - Completely remove profiler
|
||||||
|
this.tickCheck = tickingFutureReadyPredicate;
|
||||||
|
- this.profiler = profilerGetter;
|
||||||
|
+ //this.profiler = profilerGetter; // Plazma - Completely remove profiler
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addContainer(ChunkPos pos, LevelChunkTicks<T> scheduler) {
|
||||||
|
@@ -88,7 +88,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||||
|
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
|
||||||
|
//ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
|
||||||
|
//profilerFiller.push("collect"); // Purpur
|
||||||
|
- this.collectTicks(time, maxTicks, null); // Purpur
|
||||||
|
+ this.collectTicks(time, maxTicks); // Purpur // Plazma - Completely remove profiler
|
||||||
|
//profilerFiller.popPush("run"); // Purpur
|
||||||
|
//profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur
|
||||||
|
this.runCollectedTicks(ticker);
|
||||||
|
@@ -97,7 +97,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||||
|
//profilerFiller.pop(); // Purpur
|
||||||
|
}
|
||||||
|
|
||||||
|
- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) {
|
||||||
|
+ private void collectTicks(long time, int maxTicks/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
||||||
|
this.sortContainersToTick(time);
|
||||||
|
//profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur
|
||||||
|
this.drainContainers(time, maxTicks);
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <alphakr93@gmail.com>
|
|
||||||
Date: Fri, 10 Mar 2023 20:35:27 +0900
|
|
||||||
Subject: [PATCH] Console Log Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 6714947455c1e4c887a5f13ba1a3aeb57324ee0a..3c70653b720d3d55be199e000e89c627b90e65da 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -20,4 +20,10 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
|
|
||||||
@Setting(Configuration.VERSION_FIELD)
|
|
||||||
public int version = CURRENT_VERSION;
|
|
||||||
+
|
|
||||||
+ public ConsoleLogs consoleLogs;
|
|
||||||
+ public class ConsoleLogs extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 18:29:51 +0900
|
||||||
|
Subject: [PATCH] Add some missing Pufferfish configurations
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
|
index c97ef420581803b569d130b58a97f67d1fee54f2..e562dffdf84612b50c5d464f9913cfe8ec5c6279 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||||
|
@@ -168,10 +168,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||||
|
return dimensions.height - 0.1F * this.getScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
|
||||||
|
@Override
|
||||||
|
protected void customServerAiStep() {
|
||||||
|
//this.level().getProfiler().push("camelBrain"); // Purpur
|
||||||
|
Brain<Camel> brain = (Brain<Camel>) this.getBrain(); // Paper - decompile fix
|
||||||
|
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||||
|
brain.tick((ServerLevel)this.level(), this);
|
||||||
|
//this.level().getProfiler().pop(); // Purpur
|
||||||
|
//this.level().getProfiler().push("camelActivityUpdate"); // Purpur
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
|
index 795c93352dfa69fad0e034a8377eceb6dc1e81da..e743b4891c1e56f82d40f798e456a701b0efbc73 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
|
@@ -527,9 +527,11 @@ public class Sniffer extends Animal {
|
||||||
|
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||||
|
@Override
|
||||||
|
protected void customServerAiStep() {
|
||||||
|
//this.level().getProfiler().push("snifferBrain"); // Purpur
|
||||||
|
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||||
|
this.getBrain().tick((ServerLevel) this.level(), this);
|
||||||
|
//this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
|
||||||
|
SnifferAi.updateActivity(this);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
|
index 66d47c1613532189e761c0f48d893652c17fe240..8a5d8f9ad1bd94ca53c1ffd1872275c07a52f0b7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||||
|
@@ -319,7 +319,7 @@ public class Warden extends Monster implements VibrationSystem {
|
||||||
|
ServerLevel worldserver = (ServerLevel) this.level();
|
||||||
|
|
||||||
|
//worldserver.getProfiler().push("wardenBrain"); // Purpur
|
||||||
|
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||||
|
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma
|
||||||
|
this.getBrain().tick(worldserver, this);
|
||||||
|
//this.level().getProfiler().pop(); // Purpur
|
||||||
|
super.customServerAiStep();
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <alphakr93@gmail.com>
|
|
||||||
Date: Fri, 10 Mar 2023 21:45:37 +0900
|
|
||||||
Subject: [PATCH] Console log tweaks
|
|
||||||
|
|
||||||
[Offine Warning Configuration Patch]
|
|
||||||
Original by Irochi <me@irochi.moe>
|
|
||||||
Licensed under the GPL 3.0
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
index e6f14bb0825e3b6987ebb2ec782c8316e3b7c094..191bebab12c94756e9f98cfacbf06eb9a7c2f2f9 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
@@ -180,16 +180,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
||||||
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
- // Paper start - detect running as root
|
|
||||||
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
|
||||||
- DedicatedServer.LOGGER.warn("****************************");
|
|
||||||
- DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
|
||||||
- DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
|
||||||
- DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
|
||||||
- DedicatedServer.LOGGER.warn("****************************");
|
|
||||||
- }
|
|
||||||
- // Paper end
|
|
||||||
-
|
|
||||||
DedicatedServer.LOGGER.info("Loading properties");
|
|
||||||
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
|
|
||||||
|
|
||||||
@@ -321,7 +311,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
||||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
|
||||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
|
||||||
// Paper end
|
|
||||||
- if (!this.usesAuthentication()) {
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableOfflineWarnings && !this.usesAuthentication()) { // Plazma
|
|
||||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
|
||||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
|
||||||
// Spigot start
|
|
||||||
@@ -334,9 +324,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
||||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
|
||||||
}
|
|
||||||
// Spigot end
|
|
||||||
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
|
||||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the \"server.properties\" file or set \"console-logs.offline-warning\" to \"false\" in the \"config/plazma-global.yml\" file."); // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Plazma start - Moved down
|
|
||||||
+ // Paper start - detect running as root
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableRootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
|
||||||
+ DedicatedServer.LOGGER.warn("****************************");
|
|
||||||
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
|
||||||
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
|
||||||
+ DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
|
||||||
+ DedicatedServer.LOGGER.warn("****************************");
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
+ // Plazma end
|
|
||||||
|
|
||||||
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
|
||||||
return false;
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 3c70653b720d3d55be199e000e89c627b90e65da..122482e1fae7d6ac8e6b32ebdcf3e611d47901c4 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -24,6 +24,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public ConsoleLogs consoleLogs;
|
|
||||||
public class ConsoleLogs extends ConfigurationPart {
|
|
||||||
|
|
||||||
+ public boolean enableOfflineWarnings = true;
|
|
||||||
+ public boolean enableRootUserWarnings = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
70
patches/server/0014-Configurable-nether-portal-size.patch
Normal file
70
patches/server/0014-Configurable-nether-portal-size.patch
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Sat, 25 Mar 2023 00:10:52 +0900
|
||||||
|
Subject: [PATCH] Configurable nether portal size
|
||||||
|
|
||||||
|
Configurable nether portal size
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||||
|
index e7554ec800f321e4e34c926c53f2375a8c3aa979..c7f974e0b614afa1ced716ff7b6c67ee037a4071 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||||
|
@@ -100,7 +100,7 @@ public class PortalShape {
|
||||||
|
private int calculateWidth() {
|
||||||
|
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
|
||||||
|
|
||||||
|
- return i >= 2 && i <= 21 ? i : 0;
|
||||||
|
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() ? i : 0; // Plazma
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
|
||||||
|
@@ -133,7 +133,7 @@ public class PortalShape {
|
||||||
|
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||||
|
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
|
||||||
|
|
||||||
|
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
|
||||||
|
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
|
||||||
|
@@ -187,7 +187,7 @@ public class PortalShape {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid() {
|
||||||
|
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||||
|
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && this.width <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() && this.height >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && this.height <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max(); // Plazma
|
||||||
|
}
|
||||||
|
|
||||||
|
// CraftBukkit start - return boolean
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index d990c031255daf0d43541efe175c5b52736a6990..36c367c577e61422e51ab08c5aaa2a88c94e1636 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -39,6 +39,27 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public NetherPortal netherPortal;
|
||||||
|
public class NetherPortal extends ConfigurationPart {
|
||||||
|
|
||||||
|
+ public Size size;
|
||||||
|
+ public class Size extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public Width width;
|
||||||
|
+ public class Width extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ int min; public int min() { return Math.max(this.min, 1); }
|
||||||
|
+ int max; public int max() { return Math.max(this.min, this.max); }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public Height height;
|
||||||
|
+ public class Height extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ int min; public int min() { return Math.max(this.min, 2); }
|
||||||
|
+ int max; public int max() { return Math.max(this.min, this.max); }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Thu, 23 Mar 2023 21:18:47 +0900
|
|
||||||
Subject: [PATCH] Player configuration section
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 122482e1fae7d6ac8e6b32ebdcf3e611d47901c4..61f364abb094a1d137478c106fefa22ceb057ed2 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -27,5 +27,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean enableOfflineWarnings = true;
|
|
||||||
public boolean enableRootUserWarnings = true;
|
|
||||||
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Player player;
|
|
||||||
+ public class Player extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
394
patches/server/0015-Reduce-create-random-instance.patch
Normal file
394
patches/server/0015-Reduce-create-random-instance.patch
Normal file
@@ -0,0 +1,394 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 21:18:22 +0900
|
||||||
|
Subject: [PATCH] Reduce create random instance
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
index 44248dc470d0882b7287debd1993cedf0f238aca..ee571f465ca1e83e760a4d57b3d11accb53c6cfe 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -228,7 +228,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
private ServerStatus status;
|
||||||
|
@Nullable
|
||||||
|
private ServerStatus.Favicon statusIcon;
|
||||||
|
- private final RandomSource random;
|
||||||
|
+ private final RandomSource random; public RandomSource getRandom() { return this.random; } // Plazma
|
||||||
|
public final DataFixer fixerUpper;
|
||||||
|
private String localIp;
|
||||||
|
private int port;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||||
|
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..7834700eb0e1d789f7b338b535a0a9f8965201ef 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||||
|
@@ -65,7 +65,7 @@ public class SpreadPlayersCommand {
|
||||||
|
if (maxY < j) {
|
||||||
|
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
|
||||||
|
} else {
|
||||||
|
- RandomSource randomsource = RandomSource.create();
|
||||||
|
+ RandomSource randomsource = worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||||
|
double d0 = (double) (center.x - maxRange);
|
||||||
|
double d1 = (double) (center.y - 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
|
||||||
|
index 99cf8ce63316e127a5ee84cdd96df80d440dc0c3..c3bb82793ecd5333d8dbef7a90729d80616ea4ce 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
@@ -448,7 +448,7 @@ public class ServerPlayer extends Player {
|
||||||
|
long l = k * k;
|
||||||
|
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||||
|
int j1 = this.getCoprime(i1);
|
||||||
|
- int k1 = RandomSource.create().nextInt(i1);
|
||||||
|
+ int k1 = (worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||||
|
|
||||||
|
for (int l1 = 0; l1 < i1; ++l1) {
|
||||||
|
int i2 = (k1 + j1 * l1) % i1;
|
||||||
|
@@ -485,7 +485,7 @@ public class ServerPlayer extends Player {
|
||||||
|
long l = k * k;
|
||||||
|
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||||
|
int j1 = this.getCoprime(i1);
|
||||||
|
- int k1 = RandomSource.create().nextInt(i1);
|
||||||
|
+ int k1 = (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||||
|
|
||||||
|
for (int l1 = 0; l1 < i1; ++l1) {
|
||||||
|
int i2 = (k1 + j1 * l1) % i1;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
|
index d38685f82d2e6c4e71179bf3a85a8b183aa6c44b..1265e6a521222be0c957065f5b788d68cb3d863f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
|
@@ -70,7 +70,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||||
|
this.serverId = "";
|
||||||
|
this.server = server;
|
||||||
|
this.connection = connection;
|
||||||
|
- this.challenge = Ints.toByteArray(RandomSource.create().nextInt());
|
||||||
|
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? server.getRandom() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||||
|
index 1ef089dbf83de35d875c00efdf468c397be56978..7f4c0827d2269baa032dac4798fe6c2a740ba7fa 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||||
|
@@ -349,7 +349,7 @@ public class QueryThreadGs4 extends GenericThread {
|
||||||
|
this.identBytes[2] = bs[5];
|
||||||
|
this.identBytes[3] = bs[6];
|
||||||
|
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
|
||||||
|
- this.challenge = RandomSource.create().nextInt(16777216);
|
||||||
|
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
|
||||||
|
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java b/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||||
|
index 8311073e44ca8a2c8ac6f6864a875d6c90338664..8e488389b41c63809993262183204b77f73c0e55 100644
|
||||||
|
--- a/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||||
|
+++ b/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||||
|
@@ -8,7 +8,7 @@ import net.minecraft.util.RandomSource;
|
||||||
|
|
||||||
|
public class EntityZombieVillagerTypeFix extends NamedEntityFix {
|
||||||
|
private static final int PROFESSION_MAX = 6;
|
||||||
|
- private static final RandomSource RANDOM = RandomSource.create();
|
||||||
|
+ private static final RandomSource RANDOM = org.plazmamc.plazma.PlazmaOptions.createNewRandom() ? RandomSource.create() : net.minecraft.server.MinecraftServer.getServer().getRandom(); // Plazma - Reduce create random source
|
||||||
|
|
||||||
|
public EntityZombieVillagerTypeFix(Schema outputSchema, boolean changesType) {
|
||||||
|
super(outputSchema, changesType, "EntityZombieVillagerTypeFix", References.ENTITY, "Zombie");
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||||
|
index fe3ab3d388f0481fb0db06b7f730f868dbf8e8a5..265d8479b5c02994dba4288060b842789ebc7179 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||||
|
@@ -15,7 +15,7 @@ import net.minecraft.util.RandomSource;
|
||||||
|
|
||||||
|
public class ShufflingList<U> implements Iterable<U> {
|
||||||
|
public final List<ShufflingList.WeightedEntry<U>> entries; // Paper - public
|
||||||
|
- private final RandomSource random = RandomSource.create();
|
||||||
|
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma
|
||||||
|
private final boolean isUnsafe; // Paper
|
||||||
|
|
||||||
|
public ShufflingList() {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||||
|
index 7094701d213c73ba47ace806962244c10fdf4dda..288ae299240c9626e576a7ae1c45c53d83f7f097 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||||
|
@@ -8,7 +8,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||||
|
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||||
|
|
||||||
|
public abstract class Sensor<E extends LivingEntity> {
|
||||||
|
- private static final RandomSource RANDOM = RandomSource.createThreadSafe();
|
||||||
|
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.suppressThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
|
||||||
|
private static final int DEFAULT_SCAN_RATE = 20;
|
||||||
|
protected static final int TARGETING_RANGE = 16;
|
||||||
|
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.0D);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||||
|
index ece82743df21f0b776382821ad75dee96d0a0748..c25affe40eea32e1964aa4c62fdd27faa37baf28 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||||
|
@@ -32,7 +32,7 @@ public class AngerManagement {
|
||||||
|
@VisibleForTesting
|
||||||
|
protected static final int MAX_ANGER = 150;
|
||||||
|
private static final int DEFAULT_ANGER_DECREASE = 1;
|
||||||
|
- private int conversionDelay = Mth.randomBetweenInclusive(RandomSource.create(), 0, 2);
|
||||||
|
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
|
||||||
|
int highestAnger;
|
||||||
|
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create((instance) -> {
|
||||||
|
return instance.group(UUIDUtil.CODEC.fieldOf("uuid").forGetter(Pair::getFirst), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("anger").forGetter(Pair::getSecond)).apply(instance, Pair::of);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||||
|
index a5443f92786427c42092aec8350e7ab37704db7a..b1a44e460175b974e8830030ce61e523533bef8c 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||||
|
@@ -32,7 +32,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
||||||
|
private static final int SPAWN_CHANCE_INCREASE = 25;
|
||||||
|
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
|
||||||
|
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
|
||||||
|
- private final RandomSource random = RandomSource.create();
|
||||||
|
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - reduce create random instace
|
||||||
|
private final ServerLevelData serverLevelData;
|
||||||
|
private int tickDelay;
|
||||||
|
private int spawnDelay;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
|
index a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319..f1b0b8fd1042f2ce8a514000d95df5123223cc27 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
|
@@ -86,7 +86,7 @@ public class FishingHook extends Projectile {
|
||||||
|
|
||||||
|
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
|
||||||
|
super(type, world);
|
||||||
|
- this.syncronizedRandom = RandomSource.create();
|
||||||
|
+ this.syncronizedRandom = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||||
|
this.openWater = true;
|
||||||
|
this.currentState = FishingHook.FishHookState.FLYING;
|
||||||
|
this.noCulling = true;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
|
index eaa2943b667967f93f28d9d794d702fdaeb670ec..75ba586277ece1aa56186679d3a8ebf0b3f7a0cb 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
|
@@ -109,7 +109,7 @@ public class Raid {
|
||||||
|
|
||||||
|
public Raid(int id, ServerLevel world, BlockPos pos) {
|
||||||
|
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||||
|
- this.random = RandomSource.create();
|
||||||
|
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
this.waveSpawnPos = Optional.empty();
|
||||||
|
this.id = id;
|
||||||
|
this.level = world;
|
||||||
|
@@ -123,7 +123,7 @@ public class Raid {
|
||||||
|
|
||||||
|
public Raid(ServerLevel world, CompoundTag nbt) {
|
||||||
|
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||||
|
- this.random = RandomSource.create();
|
||||||
|
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
this.waveSpawnPos = Optional.empty();
|
||||||
|
this.level = world;
|
||||||
|
this.id = nbt.getInt("Id");
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
|
index d604b7ec46f08993647979ed220a84842e3fe325..f2a3049252a37ca6d6d5cb1cc51d512c7ebf5679 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
|
@@ -97,7 +97,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
|
}
|
||||||
|
// Purpur end
|
||||||
|
};
|
||||||
|
- this.random = RandomSource.create();
|
||||||
|
+ this.random = playerInventory.player.level().plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? playerInventory.player.level().random : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
this.enchantmentSeed = DataSlot.standalone();
|
||||||
|
this.costs = new int[3];
|
||||||
|
this.enchantClue = new int[]{-1, -1, -1};
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
|
index ef9b1687dd2dfda5398523140aecc678b4690642..66a1db10249995144490dac292e09fd0aa30f168 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
|
@@ -82,7 +82,7 @@ public class Explosion {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
|
||||||
|
- this.random = RandomSource.create();
|
||||||
|
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
this.toBlow = new ObjectArrayList();
|
||||||
|
this.hitPlayers = Maps.newHashMap();
|
||||||
|
this.level = world;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
index 1a5880ae3c3b17d49f0b083dff66e5619c08ec20..e175cde654b36d8ffc98a36ef099d22e9f1d15e9 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
@@ -124,16 +124,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
public final Thread thread;
|
||||||
|
private final boolean isDebug;
|
||||||
|
private int skyDarken;
|
||||||
|
- protected int randValue = RandomSource.create().nextInt();
|
||||||
|
protected final int addend = 1013904223;
|
||||||
|
protected float oRainLevel;
|
||||||
|
public float rainLevel;
|
||||||
|
protected float oThunderLevel;
|
||||||
|
public float thunderLevel;
|
||||||
|
public final RandomSource random = RandomSource.create();
|
||||||
|
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? random.nextInt() : RandomSource.create().nextInt(); // Plazma - Reduce create random instace
|
||||||
|
/** @deprecated */
|
||||||
|
@Deprecated
|
||||||
|
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||||
|
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.suppressThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
|
||||||
|
private final ResourceKey<DimensionType> dimensionTypeId;
|
||||||
|
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||||
|
public final WritableLevelData levelData;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||||
|
index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..b8d2c91a343478d89a5242254f3379dfa2556348 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||||
|
@@ -22,7 +22,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
|
||||||
|
public float rot;
|
||||||
|
public float oRot;
|
||||||
|
public float tRot;
|
||||||
|
- private static final RandomSource RANDOM = RandomSource.create();
|
||||||
|
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
private Component name;
|
||||||
|
private int lapis = 0; // Purpur
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
|
index 7291e4056b8e46ab59b71818388ac55fbb12993f..22faea52bc54cdcb52ff18a9d5a8c1bd1a64fa73 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
|
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
||||||
|
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||||
|
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instance
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
|
index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..c85340232624529d4685bf34035bb62d294695c9 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||||
|
@@ -221,7 +221,7 @@ public class ChunkGeneratorStructureState {
|
||||||
|
List<CompletableFuture<ChunkPos>> list = new ArrayList(j);
|
||||||
|
int k = placement.spread();
|
||||||
|
HolderSet<Biome> holderset = placement.preferredBiomes();
|
||||||
|
- RandomSource randomsource = RandomSource.create();
|
||||||
|
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
if (this.conf.strongholdSeed != null && structureSetEntry.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||||
|
index 18fce94f0d4b9d28e3afec61c7578f672973a71f..2dfb801ec15a372bcb997942969fec64aea9e49e 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||||
|
@@ -62,7 +62,7 @@ public enum DragonRespawnAnimation {
|
||||||
|
|
||||||
|
world.explode((Entity)null, (double)((float)endSpike.getCenterX() + 0.5F), (double)endSpike.getHeight(), (double)((float)endSpike.getCenterZ() + 0.5F), 5.0F, Level.ExplosionInteraction.BLOCK);
|
||||||
|
SpikeConfiguration spikeConfiguration = new SpikeConfiguration(true, ImmutableList.of(endSpike), new BlockPos(0, 128, 0));
|
||||||
|
- Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), RandomSource.create(), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ()));
|
||||||
|
+ Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ())); // Plazma - Reduce create random instance
|
||||||
|
}
|
||||||
|
} else if (bl) {
|
||||||
|
fight.setRespawnStage(SUMMONING_DRAGON);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
|
index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..67b4a65980059b0b2d4929c619c400c48e201e18 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
|
@@ -472,7 +472,7 @@ public class EndDragonFight {
|
||||||
|
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
|
||||||
|
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
||||||
|
}).ifPresent((holder_c) -> {
|
||||||
|
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||||
|
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instace
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
||||||
|
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
- if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) {
|
||||||
|
+ if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), this.portalLocation)) { // Plazma - Reduce create random instace
|
||||||
|
int i = Mth.positiveCeilDiv(4, 16);
|
||||||
|
|
||||||
|
this.level.getChunkSource().chunkMap.waitForLightBeforeSending(new ChunkPos(this.portalLocation), i);
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java b/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
|
index d38cabc9eeb45dd863e5f87b7df3b6327ea6a4a2..d4bcdbc6ea420bdb05c0a8859d368213d87dba67 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||||
|
@@ -77,6 +77,6 @@ public class WorldOptions {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long randomSeed() {
|
||||||
|
- return RandomSource.create().nextLong();
|
||||||
|
+ return (org.plazmamc.plazma.PlazmaOptions.createNewRandom() ? RandomSource.create() : net.minecraft.server.MinecraftServer.getServer().getRandom()).nextLong(); // Plazma - Reduce create random instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||||
|
index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..aabbf9ae1b772c9101e6f36236e5d34a5620a4d3 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||||
|
@@ -2,6 +2,8 @@ package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
import java.util.Random;
|
||||||
|
+
|
||||||
|
+import net.minecraft.util.RandomSource;
|
||||||
|
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
@@ -14,11 +16,12 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||||
|
|
||||||
|
public class CraftFirework extends CraftProjectile implements Firework {
|
||||||
|
|
||||||
|
- private final Random random = new Random();
|
||||||
|
+ private final net.minecraft.util.RandomSource random; // Plazma - Reduce create random instance
|
||||||
|
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
||||||
|
|
||||||
|
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|
||||||
|
super(server, entity);
|
||||||
|
+ this.random = this.getHandle().level().plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.getHandle().level().getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||||
|
|
||||||
|
// Paper Start - Expose firework item directly
|
||||||
|
// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM);
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..4421110e20a006c3773e922eb0facc88174ffb43
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||||
|
@@ -0,0 +1,10 @@
|
||||||
|
+package org.plazmamc.plazma;
|
||||||
|
+
|
||||||
|
+public class PlazmaOptions {
|
||||||
|
+
|
||||||
|
+ static final boolean DONT_CREATE_NEW_RANDOM_INSTANCE = Boolean.getBoolean("Plazma.doNotCreateRandomInstance");
|
||||||
|
+ public static boolean createNewRandom() {
|
||||||
|
+ return !DONT_CREATE_NEW_RANDOM_INSTANCE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index 00c95194788d56f539d1c75e9a1ce48e950c096c..9e26e598d7c381368de422ab0c3cc7936e3bbb6d 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -18,7 +18,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
static void set(@NotNull GlobalConfiguration instance, boolean test) {
|
||||||
|
GlobalConfiguration.instance = instance;
|
||||||
|
if (test) {
|
||||||
|
-
|
||||||
|
+ instance.misc.reduceCreateRandomInstance = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -34,6 +34,9 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||||
|
+ public boolean suppressThreadSafeRandom = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player player;
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index 36c367c577e61422e51ab08c5aaa2a88c94e1636..146af5bb54da67c134485dc67e8d9a569889434a 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -26,6 +26,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public Misc misc;
|
||||||
|
public class Misc extends ConfigurationPart {
|
||||||
|
|
||||||
|
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity entity;
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Thu, 23 Mar 2023 21:35:15 +0900
|
|
||||||
Subject: [PATCH] Add permission to bypass reducedDebugInfo gamerule
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
index 824f31b68b38f2f8642fb9d59a123cfdaffbb7b2..86932974a9101779691de336a8c45c464158fca8 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -282,7 +282,7 @@ public abstract class PlayerList {
|
|
||||||
ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player);
|
|
||||||
GameRules gamerules = worldserver1.getGameRules();
|
|
||||||
boolean flag = gamerules.getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN);
|
|
||||||
- boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
|
||||||
+ boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) && !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.enableBypassReducedDebugInfoPermission && player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule")); // Plazma
|
|
||||||
|
|
||||||
// Spigot - view distance
|
|
||||||
playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getWorld().getSendViewDistance(), worldserver1.getWorld().getSimulationDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation(), player.getPortalCooldown())); // Paper - replace old player chunk management
|
|
||||||
@@ -1315,7 +1315,7 @@ public abstract class PlayerList {
|
|
||||||
player.getEntityData().refresh(player); // CraftBukkkit - SPIGOT-7218: sync metadata
|
|
||||||
player.connection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected));
|
|
||||||
// CraftBukkit start - from GameRules
|
|
||||||
- int i = player.level().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) ? 22 : 23;
|
|
||||||
+ int i = player.level().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) && !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.enableBypassReducedDebugInfoPermission && player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule")) ? 22 : 23;
|
|
||||||
player.connection.send(new ClientboundEntityEventPacket(player, (byte) i));
|
|
||||||
float immediateRespawn = player.level().getGameRules().getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN) ? 1.0F: 0.0F;
|
|
||||||
player.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.IMMEDIATE_RESPAWN, immediateRespawn));
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index a45ff31d08129c0d5f159615d934a4450d54146e..4f54ae58bd20481f02aaec3f8406996a5e01b24f 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -33,6 +33,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public class Player extends ConfigurationPart {
|
|
||||||
|
|
||||||
public boolean allowAnyUsername = false;
|
|
||||||
+ public boolean enableBypassReducedDebugInfoPermission = true; // TODO: Move to Player.Permissions class
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
32
patches/server/0016-Apply-various-optimizations.patch
Normal file
32
patches/server/0016-Apply-various-optimizations.patch
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 22:11:15 +0900
|
||||||
|
Subject: [PATCH] Apply various optimizations
|
||||||
|
|
||||||
|
[REFERENCE PATCHES]
|
||||||
|
Akarin - Swaps the predicate order of collision
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
index 1ca91631b03c9690b4f661ecfb4d500d23cb47ec..4461dc1b76cc2939130680f8039b69af902aa050 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -2105,8 +2105,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
public void playerTouch(Player player) {}
|
||||||
|
|
||||||
|
public void push(Entity entity) {
|
||||||
|
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
|
||||||
|
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||||
|
- if (!entity.noPhysics && !this.noPhysics) {
|
||||||
|
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - moved up
|
||||||
|
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
|
||||||
|
double d0 = entity.getX() - this.getX();
|
||||||
|
double d1 = entity.getZ() - this.getZ();
|
||||||
|
@@ -2135,7 +2136,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- }
|
||||||
|
+ //} // Plazma
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 22:13:07 +0900
|
||||||
|
Subject: [PATCH] Avoid double I/O operation on load player file
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
|
index 36af81f0957d17e170d229059c66f4eb4539dfeb..b4b74bff0579b919266e91464b36c9381342b677 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
|
@@ -56,7 +56,8 @@ public class PlayerDataStorage {
|
||||||
|
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
|
||||||
|
// Spigot Start
|
||||||
|
boolean usingWrongFile = false;
|
||||||
|
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
||||||
|
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
|
||||||
|
+ if ( org.bukkit.Bukkit.getOnlineMode() && isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
|
||||||
|
{
|
||||||
|
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||||
|
if ( file.exists() )
|
||||||
|
@@ -67,7 +68,7 @@ public class PlayerDataStorage {
|
||||||
|
}
|
||||||
|
// Spigot End
|
||||||
|
|
||||||
|
- if (file.exists() && file.isFile()) {
|
||||||
|
+ if (isNormalFile) { // Plazma - Avoid double I/O operation
|
||||||
|
nbttagcompound = NbtIo.readCompressed(file);
|
||||||
|
}
|
||||||
|
// Spigot Start
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 22:15:39 +0900
|
||||||
|
Subject: [PATCH] Don't refresh LootTable for non player interaction
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
|
index 081691f9710ff1115e4308f79ed49fbc38941193..79a27755534384ab94e79e422c0a5e9ccecacd8c 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
|
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unpackLootTable(@Nullable Player player) {
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.dontRefreshLootTableForNonPlayerInteraction && player == null) return; // Plazma
|
||||||
|
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
|
||||||
|
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
|
||||||
|
if (player instanceof ServerPlayer) {
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index 9e26e598d7c381368de422ab0c3cc7936e3bbb6d..5a62bffe495002b3bbf5fd995df135c5d174458a 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -36,6 +36,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
|
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||||
|
public boolean suppressThreadSafeRandom = DO_OPTIMIZE;
|
||||||
|
+ public boolean dontRefreshLootTableForNonPlayerInteraction = DO_OPTIMIZE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 00:04:41 +0900
|
|
||||||
Subject: [PATCH] Structure Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index 7df971a1bd47862918f4c7342eae19226c4c9fbe..b1a75e865e61f9cdfb6a6a57cbab3db1f2a709d3 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -30,4 +30,21 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
public int maxChunksPerTick = 5;
|
|
||||||
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public Structure structure;
|
|
||||||
+ public class Structure extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public Portal portal;
|
|
||||||
+ public class Portal extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public NetherPortal netherPortal;
|
|
||||||
+ public class NetherPortal extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 00:10:52 +0900
|
|
||||||
Subject: [PATCH] Configurable nether portal size
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
|
||||||
index e7554ec800f321e4e34c926c53f2375a8c3aa979..677f546cee0ebda24a6e77cb5fedd41078c7fff4 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
|
||||||
@@ -100,7 +100,7 @@ public class PortalShape {
|
|
||||||
private int calculateWidth() {
|
|
||||||
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
|
|
||||||
|
|
||||||
- return i >= 2 && i <= 21 ? i : 0;
|
|
||||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.max() ? i : 0; // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
|
|
||||||
@@ -133,7 +133,7 @@ public class PortalShape {
|
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
|
||||||
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
|
|
||||||
|
|
||||||
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
|
|
||||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
|
|
||||||
@@ -187,7 +187,7 @@ public class PortalShape {
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isValid() {
|
|
||||||
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
|
||||||
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.min() && this.width <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.max() && this.height >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.min() && this.height <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.max(); // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
// CraftBukkit start - return boolean
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index b1a75e865e61f9cdfb6a6a57cbab3db1f2a709d3..3ca0f64bf5dcf104a84db91f22fae75790468052 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -40,7 +40,43 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
public NetherPortal netherPortal;
|
|
||||||
public class NetherPortal extends ConfigurationPart {
|
|
||||||
|
|
||||||
+ public Size size;
|
|
||||||
+ public class Size extends ConfigurationPart {
|
|
||||||
|
|
||||||
+ public Width width;
|
|
||||||
+ public Height height;
|
|
||||||
+
|
|
||||||
+ public class Width extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ int min = 2;
|
|
||||||
+ int max = 21;
|
|
||||||
+
|
|
||||||
+ public int min() {
|
|
||||||
+ return Math.max(this.min, 1);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public int max() {
|
|
||||||
+ return Math.max(this.min, this.max);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public class Height extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ int min = 3;
|
|
||||||
+ int max = 21;
|
|
||||||
+
|
|
||||||
+ public int min() {
|
|
||||||
+ return Math.max(this.min, 2);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public int max() {
|
|
||||||
+ return Math.max(this.min, this.max);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
36
patches/server/0019-Don-t-load-chunks-to-spawn-phantom.patch
Normal file
36
patches/server/0019-Don-t-load-chunks-to-spawn-phantom.patch
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 22:17:11 +0900
|
||||||
|
Subject: [PATCH] Don't load chunks to spawn phantom
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
|
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..e7a9683fe6bd72e9e7644770953506195567e03b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
|
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
|
||||||
|
|
||||||
|
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
|
||||||
|
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
||||||
|
+ if (world.plazmaLevelConfiguration().entity.phantom.dontLoadChunksToSpawn && world.hasChunkAt(blockposition1)) continue; // Plazma
|
||||||
|
BlockState iblockdata = world.getBlockState(blockposition1);
|
||||||
|
FluidState fluid = world.getFluidState(blockposition1);
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index 146af5bb54da67c134485dc67e8d9a569889434a..0a23900b18ec46ce2a7d47160dff013c7c8a8533 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public Entity entity;
|
||||||
|
public class Entity extends ConfigurationPart {
|
||||||
|
|
||||||
|
+ public Phantom phantom;
|
||||||
|
+ public class Phantom extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean dontLoadChunksToSpawn = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
}
|
||||||
|
|
||||||
|
public Structure structure;
|
||||||
@@ -1,32 +1,37 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Sat, 25 Mar 2023 20:46:40 +0900
|
Date: Wed, 27 Sep 2023 22:21:47 +0900
|
||||||
Subject: [PATCH] Add configuration to disable moved to quickly check for
|
Subject: [PATCH] Add option to disable moved to quickly check for specific
|
||||||
spectators
|
players
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0bd757eec..09183dbac0e8ca2cc2c8da57b105b80eab42d459 100644
|
index e001787e40cc0a843e65b36582e9d6593d0fff0e..1af44c18724b2d2dc1d910f5af49254eb845feaf 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1566,7 +1566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1435,6 +1435,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||||
|
|
||||||
- if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
+ if (this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !this.player.level().plazmaLevelConfiguration().entity.player.checkSpectatorMovecToQuickly && this.player.isSpectator()) return; // Plazma
|
||||||
+ if (!(this.player.level().plazmaLevelConfiguration().misc.checkSpectatorMovedToQuickly && this.player.isSpectator()) && d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Plazma
|
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
// Paper start - Add fail move event
|
// Paper start - Add fail move event
|
||||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
index 504913e8e05869f8f0b88f0faaf684d39eb14ea7..61c06213b4ceb8e38e9aa41c3517f152d0d669ad 100644
|
index 0a23900b18ec46ce2a7d47160dff013c7c8a8533..414baade911fab3450430af9378feedc419868f3 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
@@ -88,6 +88,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
public class Misc extends ConfigurationPart {
|
public Entity entity;
|
||||||
|
public class Entity extends ConfigurationPart {
|
||||||
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
+ public Player player;
|
||||||
+ public boolean checkSpectatorMovedToQuickly = DO_OPTIMIZE;
|
+ public class Player extends ConfigurationPart {
|
||||||
|
+
|
||||||
}
|
+ public boolean checkSpectatorMovecToQuickly = !DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public Phantom phantom;
|
||||||
|
public class Phantom extends ConfigurationPart {
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 19:52:12 +0900
|
|
||||||
Subject: [PATCH] Misc configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 4f54ae58bd20481f02aaec3f8406996a5e01b24f..61477d98f10ce7d0ec29d51de8c7a3b42026dd2d 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -35,5 +35,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean allowAnyUsername = false;
|
|
||||||
public boolean enableBypassReducedDebugInfoPermission = true; // TODO: Move to Player.Permissions class
|
|
||||||
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Misc misc;
|
|
||||||
+ public class Misc extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index 3ca0f64bf5dcf104a84db91f22fae75790468052..843cf772c18d2e9386bf5a7b1731a86c349d6b98 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -82,5 +82,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Misc misc;
|
|
||||||
+ public class Misc extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 20:02:59 +0900
|
|
||||||
Subject: [PATCH] Reduce create random instance
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
|
||||||
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..d157758282cc79d58134c056c52a43a24d443153 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
|
||||||
@@ -65,7 +65,7 @@ public class SpreadPlayersCommand {
|
|
||||||
if (maxY < j) {
|
|
||||||
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
|
|
||||||
} else {
|
|
||||||
- RandomSource randomsource = RandomSource.create();
|
|
||||||
+ RandomSource randomsource = worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create(); // Plazma
|
|
||||||
double d0 = (double) (center.x - maxRange);
|
|
||||||
double d1 = (double) (center.y - 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
|
|
||||||
index f39b3f1b5b37d1939766952a985684279cb2bf2d..69d22bc9f0087dc419b840c6626746e12f621012 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
@@ -447,7 +447,7 @@ public class ServerPlayer extends Player {
|
|
||||||
long l = k * k;
|
|
||||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
|
||||||
int j1 = this.getCoprime(i1);
|
|
||||||
- int k1 = RandomSource.create().nextInt(i1);
|
|
||||||
+ int k1 = (worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma
|
|
||||||
|
|
||||||
for (int l1 = 0; l1 < i1; ++l1) {
|
|
||||||
int i2 = (k1 + j1 * l1) % i1;
|
|
||||||
@@ -484,7 +484,7 @@ public class ServerPlayer extends Player {
|
|
||||||
long l = k * k;
|
|
||||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
|
||||||
int j1 = this.getCoprime(i1);
|
|
||||||
- int k1 = RandomSource.create().nextInt(i1);
|
|
||||||
+ int k1 = (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma
|
|
||||||
|
|
||||||
for (int l1 = 0; l1 < i1; ++l1) {
|
|
||||||
int i2 = (k1 + j1 * l1) % i1;
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
|
||||||
index 1ef089dbf83de35d875c00efdf468c397be56978..dc111e0d1e7303c56cd12fa83be3ff85ab989e1b 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
|
||||||
@@ -349,7 +349,7 @@ public class QueryThreadGs4 extends GenericThread {
|
|
||||||
this.identBytes[2] = bs[5];
|
|
||||||
this.identBytes[3] = bs[6];
|
|
||||||
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
|
|
||||||
- this.challenge = RandomSource.create().nextInt(16777216);
|
|
||||||
+ this.challenge = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? java.util.concurrent.ThreadLocalRandom.current().nextInt(16777216) : RandomSource.create().nextInt(16777216); // Plazma
|
|
||||||
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
|
||||||
index b8c238287e0639b578170c6fec0d4db5a1a59fe7..9e5eab45d589db16b4f1ec563e40dc3890581bf4 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
|
||||||
@@ -86,7 +86,7 @@ public class FishingHook extends Projectile {
|
|
||||||
|
|
||||||
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
|
|
||||||
super(type, world);
|
|
||||||
- this.syncronizedRandom = RandomSource.create();
|
|
||||||
+ this.syncronizedRandom = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
|
||||||
this.openWater = true;
|
|
||||||
this.currentState = FishingHook.FishHookState.FLYING;
|
|
||||||
this.noCulling = true;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
index f7399737548483905f3b5c08a03876b0da54b714..7ff8e19fcee67a33bbc8603f8c089a5b76ed23b6 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
@@ -110,7 +110,7 @@ public class Raid {
|
|
||||||
|
|
||||||
public Raid(int id, ServerLevel world, BlockPos pos) {
|
|
||||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
|
||||||
- this.random = RandomSource.create();
|
|
||||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
|
||||||
this.waveSpawnPos = Optional.empty();
|
|
||||||
this.id = id;
|
|
||||||
this.level = world;
|
|
||||||
@@ -124,7 +124,7 @@ public class Raid {
|
|
||||||
|
|
||||||
public Raid(ServerLevel world, CompoundTag nbt) {
|
|
||||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
|
||||||
- this.random = RandomSource.create();
|
|
||||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
|
||||||
this.waveSpawnPos = Optional.empty();
|
|
||||||
this.level = world;
|
|
||||||
this.id = nbt.getInt("Id");
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
||||||
index 4932374ab9a3d8582fb0ef024d817ad896dd23c4..fd9be520b838346555dee2dc13f54dcf0fe0e9d8 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
||||||
@@ -81,7 +81,7 @@ public class Explosion {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
|
|
||||||
- this.random = RandomSource.create();
|
|
||||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
|
||||||
this.toBlow = new ObjectArrayList();
|
|
||||||
this.hitPlayers = Maps.newHashMap();
|
|
||||||
this.level = world;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
index 08f9af1d7aebba943096b59b6452818a1aafc94c..1d2c3147abfa09233976f4cc1cc417a9dab9ed44 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
@@ -124,7 +124,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
||||||
public final Thread thread;
|
|
||||||
private final boolean isDebug;
|
|
||||||
private int skyDarken;
|
|
||||||
- protected int randValue = RandomSource.create().nextInt();
|
|
||||||
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? java.util.concurrent.ThreadLocalRandom.current().nextInt() : RandomSource.create().nextInt(); // Plazma
|
|
||||||
protected final int addend = 1013904223;
|
|
||||||
protected float oRainLevel;
|
|
||||||
public float rainLevel;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
||||||
index 7291e4056b8e46ab59b71818388ac55fbb12993f..5e5efeec92f70060b0d409252ceff65691155367 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
||||||
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
|
||||||
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
|
||||||
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), pos); // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
index 5b333bef255d7ef61c99510837536920c6fb6e8c..6331c068aefcdf07d2c880eef8df07add277f856 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
@@ -472,7 +472,7 @@ public class EndDragonFight {
|
|
||||||
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
|
|
||||||
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
|
||||||
}).ifPresent((holder_c) -> {
|
|
||||||
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
|
||||||
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), pos);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
|
||||||
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
- worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation);
|
|
||||||
+ worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), this.portalLocation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 61477d98f10ce7d0ec29d51de8c7a3b42026dd2d..3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -40,7 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public Misc misc;
|
|
||||||
public class Misc extends ConfigurationPart {
|
|
||||||
|
|
||||||
-
|
|
||||||
+ public boolean reduceCreateRandomInstance = 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 843cf772c18d2e9386bf5a7b1731a86c349d6b98..14987ceec693397602b5c8e1fe460a6fc212a0ee 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -87,7 +87,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
public Misc misc;
|
|
||||||
public class Misc extends ConfigurationPart {
|
|
||||||
|
|
||||||
-
|
|
||||||
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Sat, 25 Mar 2023 21:50:25 +0900
|
Date: Wed, 27 Sep 2023 22:30:49 +0900
|
||||||
Subject: [PATCH] Apply faster random
|
Subject: [PATCH] Use faster random
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||||
index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..4f264e098e7907c397f09ee23a579ed7da494edc 100644
|
index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..f17b42176e9e5148b98baf4a6a7e7528242406d9 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||||
@@ -16,7 +16,7 @@ import java.util.UUID;
|
@@ -16,7 +16,7 @@ import java.util.UUID;
|
||||||
@@ -13,51 +13,38 @@ index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..4f264e098e7907c397f09ee23a579ed7
|
|||||||
public class PaperLootableInventoryData {
|
public class PaperLootableInventoryData {
|
||||||
|
|
||||||
- private static final Random RANDOM = new Random();
|
- private static final Random RANDOM = new Random();
|
||||||
+ private static final Random RANDOM = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
+ private static final Random RANDOM = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||||
|
|
||||||
private long lastFill = -1;
|
private long lastFill = -1;
|
||||||
private long nextRefill = -1;
|
private long nextRefill = -1;
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0acbaa18a61d1cfdb894c6c756d2b9bdc3599b82..93ff3ef401d4212cede5290990528988c7ca3a0c 100644
|
index ee571f465ca1e83e760a4d57b3d11accb53c6cfe..1a92a7f6391df6395c11d11efdbf2f4eda5c6651 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -691,7 +691,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -680,7 +680,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (world.generator != null) {
|
if (world.generator != null) {
|
||||||
- Random rand = new Random(world.getSeed());
|
- Random rand = new Random(world.getSeed());
|
||||||
+ Random rand = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); rand.setSeed(world.getSeed()); // Plazma
|
+ Random rand = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random(world.getSeed()) : new org.plazmamc.plazma.Random((int) world.getSeed()); // Plazma - use faster random
|
||||||
org.bukkit.Location spawn = world.generator.getFixedSpawnLocation(world.getWorld(), rand);
|
org.bukkit.Location spawn = world.generator.getFixedSpawnLocation(world.getWorld(), rand);
|
||||||
|
|
||||||
if (spawn != null) {
|
if (spawn != null) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
index 1392e483c363e25d1f16465d876cb7d7c70afa68..f4b99ffec5c84a5fa1f90060ec15d09b08239d49 100644
|
index 52b48e40c3ee5f483c6cb04409459cf25abc3f0d..5ca738739507a4cb1c3b17502fa82462079cbc87 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
@@ -229,7 +229,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@@ -228,7 +228,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
- private static final Random rand = new Random();
|
- private static final Random rand = new Random();
|
||||||
+ private static final Random rand = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
+ private static final Random rand = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||||
|
|
||||||
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
||||||
index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..7cd8a12ad560626ad3965bd46a5a71168ce6bf80 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
||||||
@@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
|
||||||
|
|
||||||
public class CraftFirework extends CraftProjectile implements Firework {
|
|
||||||
|
|
||||||
- private final Random random = new Random();
|
|
||||||
+ private final Random random = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
|
||||||
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
|
||||||
|
|
||||||
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||||
index c3972ba41ad61af4c423e6f942ac984dc61716f0..f7b53cf1161e53d49ec2b72fed2473c1814159cd 100644
|
index d46ccc3b3aaacf937631a44a7e0f91b793a83c86..0be5ab95612dc21561ffc0051880baae75117bc6 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||||
@@ -48,7 +48,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
@@ -48,7 +48,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||||
@@ -65,16 +52,28 @@ index c3972ba41ad61af4c423e6f942ac984dc61716f0..f7b53cf1161e53d49ec2b72fed2473c1
|
|||||||
private final ChunkGenerator generator;
|
private final ChunkGenerator generator;
|
||||||
private final ServerLevel world;
|
private final ServerLevel world;
|
||||||
- private final Random random = new Random();
|
- private final Random random = new Random();
|
||||||
+ private final Random random = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
+ private final Random random = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||||
private boolean newApi;
|
private boolean newApi;
|
||||||
private boolean implementBaseHeight = true;
|
private boolean implementBaseHeight = true;
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||||
|
index 4421110e20a006c3773e922eb0facc88174ffb43..f0e6933a2bf06f2bcc343c0817ca414473be19d3 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||||
|
@@ -7,4 +7,7 @@ public class PlazmaOptions {
|
||||||
|
return !DONT_CREATE_NEW_RANDOM_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ static final boolean USE_JAVA_RANDOM = Boolean.getBoolean("Plazma.useJavaRandom");
|
||||||
|
+ public static boolean useJavaRandom() { return USE_JAVA_RANDOM; }
|
||||||
|
+
|
||||||
|
}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/Random.java b/src/main/java/org/plazmamc/plazma/Random.java
|
diff --git a/src/main/java/org/plazmamc/plazma/Random.java b/src/main/java/org/plazmamc/plazma/Random.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..e72e96be3938bdcc1ae1aa94f7465f644e1b3e16
|
index 0000000000000000000000000000000000000000..d0aa8248c0f9dc6daab6eee6b77d3ef198d75fdb
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/Random.java
|
+++ b/src/main/java/org/plazmamc/plazma/Random.java
|
||||||
@@ -0,0 +1,394 @@
|
@@ -0,0 +1,395 @@
|
||||||
+package org.plazmamc.plazma;
|
+package org.plazmamc.plazma;
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
@@ -97,7 +96,11 @@ index 0000000000000000000000000000000000000000..e72e96be3938bdcc1ae1aa94f7465f64
|
|||||||
+ long x, y, z, w;
|
+ long x, y, z, w;
|
||||||
+
|
+
|
||||||
+ public Random() {
|
+ public Random() {
|
||||||
+ seed((int) System.currentTimeMillis());
|
+ this((int) System.currentTimeMillis());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public Random(int value) {
|
||||||
|
+ seed(value);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
@@ -167,9 +170,7 @@ index 0000000000000000000000000000000000000000..e72e96be3938bdcc1ae1aa94f7465f64
|
|||||||
+ buffer[i++] = (byte) (w >> 8);
|
+ buffer[i++] = (byte) (w >> 8);
|
||||||
+ if (i < buffer.length) {
|
+ if (i < buffer.length) {
|
||||||
+ buffer[i++] = (byte) (w >> 16);
|
+ buffer[i++] = (byte) (w >> 16);
|
||||||
+ if (i < buffer.length) {
|
+ if (i < buffer.length) buffer[i] = (byte) (w >> 24);
|
||||||
+ buffer[i] = (byte) (w >> 24);
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@@ -241,11 +242,10 @@ index 0000000000000000000000000000000000000000..e72e96be3938bdcc1ae1aa94f7465f64
|
|||||||
+ // The explicit int cast before the first multiplication gives better performance.
|
+ // The explicit int cast before the first multiplication gives better performance.
|
||||||
+ // See comments in NextDouble.
|
+ // See comments in NextDouble.
|
||||||
+ int range = upperBound - lowerBound;
|
+ int range = upperBound - lowerBound;
|
||||||
+ if (range < 0) {
|
+ if (range < 0)
|
||||||
+ // If range is <0 then an overflow has occured and must resort to using long integer arithmetic instead (slower).
|
+ // If range is <0 then an overflow has occured and must resort to using long integer arithmetic instead (slower).
|
||||||
+ // We also must use all 32 bits of precision, instead of the normal 31, which again is slower.
|
+ // We also must use all 32 bits of precision, instead of the normal 31, which again is slower.
|
||||||
+ return lowerBound + (int) ((REAL_UNIT_UINT * (double) (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))) * (double) ((long) upperBound - (long) lowerBound));
|
+ return lowerBound + (int) ((REAL_UNIT_UINT * (double) (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))) * (double) ((long) upperBound - (long) lowerBound));
|
||||||
+ }
|
|
||||||
+ // 31 bits of precision will suffice if range<=int.MaxValue. This allows us to cast to an int and gain
|
+ // 31 bits of precision will suffice if range<=int.MaxValue. This allows us to cast to an int and gain
|
||||||
+ // a little more performance.
|
+ // a little more performance.
|
||||||
+ return lowerBound + (int) ((REAL_UNIT_INT * (double) (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * (double) range);
|
+ return lowerBound + (int) ((REAL_UNIT_INT * (double) (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * (double) range);
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 20:38:21 +0900
|
|
||||||
Subject: [PATCH] Entity Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index 14987ceec693397602b5c8e1fe460a6fc212a0ee..5dcabaf3fa198a05afc25753f6d062fe7d86972e 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -90,4 +90,21 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
|
||||||
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public Entity entity;
|
|
||||||
+ public class Entity extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public Monster monster;
|
|
||||||
+ public class Monster extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public Phantom phantom;
|
|
||||||
+ public class Phantom extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
52
patches/server/0022-Ignore-useless-entity-packets.patch
Normal file
52
patches/server/0022-Ignore-useless-entity-packets.patch
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Wed, 27 Sep 2023 22:35:19 +0900
|
||||||
|
Subject: [PATCH] Ignore useless entity packets
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
|
index c6d80accdac49564b5386717a92dbd5a10237f06..ddbff17499746cd370fdf18ff78606b0ac770df4 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
|
@@ -200,6 +200,8 @@ public class ServerEntity {
|
||||||
|
flag4 = true;
|
||||||
|
flag5 = true;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (this.entity.level().plazmaLevelConfiguration().entity.ignoreUselessPackets && isUselessPacket(packet1)) packet1 = null; // Plazma
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||||
|
@@ -272,6 +274,19 @@ public class ServerEntity {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Plazma start
|
||||||
|
+ private boolean isUselessPacket(@Nullable Packet<?> packet) {
|
||||||
|
+ if (!(packet instanceof ClientboundMoveEntityPacket p)) return false;
|
||||||
|
+ if (p instanceof ClientboundMoveEntityPacket.Pos)
|
||||||
|
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0;
|
||||||
|
+ if (p instanceof ClientboundMoveEntityPacket.Rot)
|
||||||
|
+ return p.getxRot() == 0 && p.getyRot() == 0;
|
||||||
|
+ if (p instanceof ClientboundMoveEntityPacket.PosRot)
|
||||||
|
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0 && p.getxRot() == 0 && p.getyRot() == 0;
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
+
|
||||||
|
public void removePairing(ServerPlayer player) {
|
||||||
|
this.entity.stopSeenByPlayer(player);
|
||||||
|
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index 414baade911fab3450430af9378feedc419868f3..914cc4f9a5598d2d70c7338d7cfc9be0fe5f0e31 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public Entity entity;
|
||||||
|
public class Entity extends ConfigurationPart {
|
||||||
|
|
||||||
|
+ public boolean ignoreUselessPackets = DO_OPTIMIZE;
|
||||||
|
+
|
||||||
|
public Player player;
|
||||||
|
public class Player extends ConfigurationPart {
|
||||||
|
|
||||||
151
patches/server/0023-Implement-No-Chat-Reports.patch
Normal file
151
patches/server/0023-Implement-No-Chat-Reports.patch
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Thu, 28 Sep 2023 11:47:50 +0900
|
||||||
|
Subject: [PATCH] Implement No Chat Reports
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
|
index 40f51062624161892c780ddae05e22859e2cd021..b0b515b8ebeffe25a760d7d6faa87cbc1a585b2d 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||||
|
@@ -139,9 +139,13 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
|
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
|
||||||
|
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
|
||||||
|
|
||||||
|
- this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
|
||||||
|
- return new EncoderException("Failed to encode: " + s + " " + value);
|
||||||
|
- })));
|
||||||
|
+ // Plazma start - Implement No Chat Reports
|
||||||
|
+ JsonElement element = Util.getOrThrow(dataresult, s -> new EncoderException("Failed to encode: " + s + " " + value));
|
||||||
|
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC
|
||||||
|
+ && org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.queryData())
|
||||||
|
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
|
||||||
|
+ this.writeUtf(GSON.toJson(element));
|
||||||
|
+ // Plazma end
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> void writeId(IdMap<T> registry, T value) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||||
|
index b8c1f3b9afddc87d56541c8af63cffecfcdd2653..4f0d6ac849dda74c9180fa03d97d389cc4554b46 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||||
|
@@ -24,4 +24,13 @@ public record ServerboundChatCommandPacket(String command, Instant timeStamp, lo
|
||||||
|
public void handle(ServerGamePacketListener listener) {
|
||||||
|
listener.handleChatCommand(this);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Plazma start - Implement No Chat Reports
|
||||||
|
+ @Override
|
||||||
|
+ public ArgumentSignatures argumentSignatures() {
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled)
|
||||||
|
+ return ArgumentSignatures.EMPTY;
|
||||||
|
+ return this.argumentSignatures;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
|
index d1d2fc0c57523c1abf1e8bfec913c78927c3dafc..b32e17ef1d7d65f2e3cf4fb5471d8182b3ba892f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||||
|
@@ -25,4 +25,12 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
|
||||||
|
public void handle(ServerGamePacketListener listener) {
|
||||||
|
listener.handleChat(this);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Plazma start - Implement No Chat Reports
|
||||||
|
+ @Override
|
||||||
|
+ public @Nullable MessageSignature signature() {
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return null;
|
||||||
|
+ return this.signature;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
|
index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..4d9f73add791cef03cc7aeaf1598a73c2195809a 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||||
|
@@ -16,6 +16,15 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(ServerGamePacketListener listener) {
|
||||||
|
+ // Plazma start - Implement No Chat Reports
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation()) {
|
||||||
|
+ ((net.minecraft.server.network.ServerGamePacketListenerImpl) listener).disconnect(
|
||||||
|
+ net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation.message),
|
||||||
|
+ org.bukkit.event.player.PlayerKickEvent.Cause.NCR_NOT_INSTALLED
|
||||||
|
+ );
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
listener.handleChatSessionUpdate(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index 879c090d9c4574a2cd45a0eb1bf9cb171834d940..d6e8d96372d4212c72a50602207075ccd3f5062d 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -683,6 +683,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
public boolean enforceSecureProfile() {
|
||||||
|
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
|
||||||
|
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return false; // Plazma - Implement No Chat Reports
|
||||||
|
return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
index 6f6228edfe77668552a40a814ab3cebd74c4cb5a..22f26761965d3c03b109939585ff528d382eab21 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
@@ -270,6 +270,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
|
}
|
||||||
|
|
||||||
|
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
||||||
|
+ // Plazma start - Implement No Chat Reports
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToSystemMessage()
|
||||||
|
+ && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket p) {
|
||||||
|
+ this.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(null, Component.Serializer.toJson(p.chatType().resolve(this.player.level().registryAccess()).get().decorate(p.unsignedContent() != null ? p.unsignedContent() : Component.literal(p.body().content()))), false), null);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
// CraftBukkit start
|
||||||
|
if (packet == null || this.processedDisconnect) { // Spigot
|
||||||
|
return;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
index 58cc1bed851994fb591e9b832b98d25eda153b47..4fbe96813067d3ccf1d8f29151ac3fac0840d76f 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
|
@@ -1471,6 +1471,7 @@ public abstract class PlayerList {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return true; // Plazma - Implement No Chat Reports
|
||||||
|
return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index 5a62bffe495002b3bbf5fd995df135c5d174458a..989aa0aeb05a878945849adc6fb6663027e15927 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -55,4 +55,22 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
public boolean notSecurePrefix = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public NoChatReports noChatReports;
|
||||||
|
+ public class NoChatReports extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean enabled = false;
|
||||||
|
+ boolean queryData = true; public boolean queryData() { return this.enabled && this.queryData; }
|
||||||
|
+ boolean convertToSystemMessage = true; public boolean convertToSystemMessage() { return this.enabled && this.convertToSystemMessage; }
|
||||||
|
+ public boolean requireModInstallation() { return this.enabled && this.requireModInstallation.enabled; }
|
||||||
|
+
|
||||||
|
+ public RequireModInstallation requireModInstallation;
|
||||||
|
+ public class RequireModInstallation extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ boolean enabled = false;
|
||||||
|
+ public String message = "You do not have No Chat Reports, and this server is configured to require it on client!";
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
}
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 20:42:23 +0900
|
|
||||||
Subject: [PATCH] Various Optimizations
|
|
||||||
|
|
||||||
[ORIGINAL PATCHES]
|
|
||||||
0007 - Avoid double I/O operation on load player file (Akarin)
|
|
||||||
0008 - Don't trigger Lootable Refresh for non player interaction
|
|
||||||
(Akarin)
|
|
||||||
0011 - Swaps the predicate order of collision (Akarin)
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
index cf0d8da4c4b5f4aa4e4ef15897ca252a2b52ec8d..42c1b7c635cd22125dbb6b4d195976daac0c9ea1 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
@@ -2145,8 +2145,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
||||||
public void playerTouch(Player player) {}
|
|
||||||
|
|
||||||
public void push(Entity entity) {
|
|
||||||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
|
|
||||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
|
||||||
- if (!entity.noPhysics && !this.noPhysics) {
|
|
||||||
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - moved up
|
|
||||||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
|
|
||||||
double d0 = entity.getX() - this.getX();
|
|
||||||
double d1 = entity.getZ() - this.getZ();
|
|
||||||
@@ -2174,8 +2175,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
||||||
entity.push(d0, 0.0D, d1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- }
|
|
||||||
+ //} // Plazma
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
index 765ee7f78532a363813286ef7db2a7e48605cb06..47830edd65b7f54a01559c80d28586b91cc07739 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
|
||||||
}
|
|
||||||
|
|
||||||
public void unpackLootTable(@Nullable Player player) {
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.doNotTriggerLootTableRefreshForNonPlayerInteraction && player == null) return; // Plazma
|
|
||||||
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
|
|
||||||
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
|
|
||||||
if (player instanceof ServerPlayer) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..9f1ee01eb9dcb599d1eb453653c7e7479fb24a4c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
|
|
||||||
|
|
||||||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
|
|
||||||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
|
||||||
+ if (world.plazmaLevelConfiguration().entity.monster.phantom.doNotLoadChunksToSpawn && world.hasChunkAt(blockposition1)) continue; // Plazma
|
|
||||||
BlockState iblockdata = world.getBlockState(blockposition1);
|
|
||||||
FluidState fluid = world.getFluidState(blockposition1);
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
index 36af81f0957d17e170d229059c66f4eb4539dfeb..039c952f0c157cba6e79fa9b976958bd1763a922 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
@@ -56,7 +56,8 @@ public class PlayerDataStorage {
|
|
||||||
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
|
|
||||||
// Spigot Start
|
|
||||||
boolean usingWrongFile = false;
|
|
||||||
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
|
||||||
+ boolean normalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
|
|
||||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && !normalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
|
|
||||||
{
|
|
||||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
|
||||||
if ( file.exists() )
|
|
||||||
@@ -67,7 +68,7 @@ public class PlayerDataStorage {
|
|
||||||
}
|
|
||||||
// Spigot End
|
|
||||||
|
|
||||||
- if (file.exists() && file.isFile()) {
|
|
||||||
+ if (normalFile) { // Plazma - Avoid double I/O operation
|
|
||||||
nbttagcompound = NbtIo.readCompressed(file);
|
|
||||||
}
|
|
||||||
// Spigot Start
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923..e91b404fca2823748c2ed343cbd83301e55b2f0a 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -41,6 +41,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public class Misc extends ConfigurationPart {
|
|
||||||
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
|
||||||
+ public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = 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 5dcabaf3fa198a05afc25753f6d062fe7d86972e..504913e8e05869f8f0b88f0faaf684d39eb14ea7 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -100,7 +100,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
public Phantom phantom;
|
|
||||||
public class Phantom extends ConfigurationPart {
|
|
||||||
|
|
||||||
-
|
|
||||||
+ public boolean doNotLoadChunksToSpawn = DO_OPTIMIZE;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -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: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
Date: Thu, 28 Sep 2023 12:33:14 +0900
|
||||||
Subject: [PATCH] Implement MemoryLeakFix
|
Subject: [PATCH] Improve biome temperature cache
|
||||||
|
|
||||||
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;
|
||||||
91
patches/server/0025-Implement-FixMySpawnR.patch
Normal file
91
patches/server/0025-Implement-FixMySpawnR.patch
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Fri, 29 Sep 2023 21:10:26 +0900
|
||||||
|
Subject: [PATCH] Implement FixMySpawnR
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
|
index 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7494d8477 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
|
@@ -46,6 +46,8 @@ public abstract class BaseSpawner {
|
||||||
|
public int requiredPlayerRange = 16;
|
||||||
|
public int spawnRange = 4;
|
||||||
|
private int tickDelay = 0; // Paper
|
||||||
|
+ private int blockExistsTick = 0; // Plazma - Implement FixMySpawnR
|
||||||
|
+ private boolean blockLockedByTime = false; // Plazma - Implement FixMySpawnR
|
||||||
|
|
||||||
|
public BaseSpawner() {}
|
||||||
|
|
||||||
|
@@ -81,6 +83,17 @@ public abstract class BaseSpawner {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void serverTick(ServerLevel world, BlockPos pos) {
|
||||||
|
+ // Plazma start - Implement FixMySpawnR
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.enabled) {
|
||||||
|
+ if (!this.blockLockedByTime) {
|
||||||
|
+ if (this.blockExistsTick > org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.timerTimeout)
|
||||||
|
+ blockLockedByTime = true;
|
||||||
|
+ else blockExistsTick++;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return;
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
||||||
|
// Paper start - Configurable mob spawner tick rate
|
||||||
|
if (spawnDelay > 0 && --tickDelay > 0) return;
|
||||||
|
@@ -286,6 +299,14 @@ public abstract class BaseSpawner {
|
||||||
|
this.spawnRange = nbt.getShort("SpawnRange");
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Plazma start - Implement FixMySpawnR
|
||||||
|
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.enabled
|
||||||
|
+ && nbt.contains("Plazma.SpawnerTicks", 99)) {
|
||||||
|
+ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks");
|
||||||
|
+ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked");
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
+
|
||||||
|
this.displayEntity = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -314,6 +335,9 @@ public abstract class BaseSpawner {
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Implement FixMySpawnR
|
||||||
|
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Implement FixMySpawnR
|
||||||
|
+
|
||||||
|
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
|
||||||
|
return nbt;
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index 989aa0aeb05a878945849adc6fb6663027e15927..d17df5621717b1c8d1d9a5549feb73c3600ecf3d 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -40,6 +40,24 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public GameMechanics gameMechanics;
|
||||||
|
+ public class GameMechanics extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public Spawning spawning;
|
||||||
|
+ public class Spawning extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public DeadlockTimer deadlockTimer;
|
||||||
|
+ public class DeadlockTimer extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ public boolean enabled = DO_OPTIMIZE;
|
||||||
|
+ public int timerTimeout = 0;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public Player player;
|
||||||
|
public class Player extends ConfigurationPart {
|
||||||
|
|
||||||
@@ -1,42 +1,35 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Wed, 3 May 2023 16:51:49 +0900
|
Date: Fri, 29 Sep 2023 21:12:38 +0900
|
||||||
Subject: [PATCH] Configurable Sensor Tick
|
Subject: [PATCH] Configurable sensor tick
|
||||||
|
|
||||||
Original: Bloom-host/Petal
|
|
||||||
Copyright (C) 2023 peaches94
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index 19d9d3a9f634631e2ec5a6fa7f2cd9dd18f62f89..ba20f60588b980f49423307ff20fc24c95f3e7b5 100644
|
index fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f..4710f85197bc80e554cc1b2b84058c8dc8049c1f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -935,10 +935,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
@@ -938,10 +938,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
//this.level().getProfiler().push("sensing"); // Purpur
|
//this.level().getProfiler().push("sensing"); // Purpur
|
||||||
- this.sensing.tick();
|
- this.sensing.tick();
|
||||||
+ //this.sensing.tick(); // Plazma - moved down (configurable sensor tick)
|
|
||||||
//this.level().getProfiler().pop(); // Purpur
|
//this.level().getProfiler().pop(); // Purpur
|
||||||
int i = this.level().getServer().getTickCount() + this.getId();
|
int i = this.level().getServer().getTickCount() + this.getId();
|
||||||
|
|
||||||
+ if (i % this.level().plazmaLevelConfiguration().entity.sensor.tick == 0) this.sensing.tick(); // Plazma - Configurable Sensor Tick
|
+ if (i % this.level().plazmaLevelConfiguration().entity.sensorTick == 0) this.sensing.tick(); // Plazma - moved down
|
||||||
if (i % 2 != 0 && this.tickCount > 1) {
|
if (i % 2 != 0 && this.tickCount > 1) {
|
||||||
//this.level().getProfiler().push("targetSelector"); // Purpur
|
//this.level().getProfiler().push("targetSelector"); // Purpur
|
||||||
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
index 61c06213b4ceb8e38e9aa41c3517f152d0d669ad..8dadc3fd21d507bf88f7f75935f7477375f21344 100644
|
index bb0f561f0b0d71697de52c834d2ed1798b2022df..6711b3d93eb5292314bcd89280d88f367eada9df 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
@@ -107,5 +107,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public Entity entity;
|
||||||
|
public class Entity extends ConfigurationPart {
|
||||||
|
|
||||||
}
|
+ public int sensorTick = DO_OPTIMIZE ? 10 : 1;
|
||||||
|
+
|
||||||
|
public boolean ignoreUselessPackets = DO_OPTIMIZE;
|
||||||
|
|
||||||
+ public Sensor sensor;
|
public Player player;
|
||||||
+ public class Sensor extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public int tick = DO_OPTIMIZE ? 10 : 1;
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 25 Mar 2023 22:07:39 +0900
|
|
||||||
Subject: [PATCH] Do not send useless entity packets
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
||||||
index fb11b020d52988360562db23d8568e5ef37e21c8..80ab684a33876d62186dcf86f555e46db1594b09 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
||||||
@@ -203,6 +203,7 @@ public class ServerEntity {
|
|
||||||
flag4 = true;
|
|
||||||
flag5 = true;
|
|
||||||
}
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.doNotSendUselessEntityPackets && isUselessEntityPacket(packet1)) packet1 = null; // Plazma
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
|
||||||
@@ -275,6 +276,21 @@ public class ServerEntity {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Plazma start
|
|
||||||
+ private boolean isUselessEntityPacket(@Nullable Packet<?> packet) {
|
|
||||||
+ if (packet == null) return false;
|
|
||||||
+ if (packet instanceof ClientboundMoveEntityPacket p) {
|
|
||||||
+ if (p instanceof ClientboundMoveEntityPacket.Pos)
|
|
||||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0;
|
|
||||||
+ else if (p instanceof ClientboundMoveEntityPacket.Rot)
|
|
||||||
+ return p.getxRot() == 0 && p.getyRot() == 0;
|
|
||||||
+ else if (p instanceof ClientboundMoveEntityPacket.PosRot)
|
|
||||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0 && p.getxRot() == 0 && p.getyRot() == 0;
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
+
|
|
||||||
public void removePairing(ServerPlayer player) {
|
|
||||||
this.entity.stopSeenByPlayer(player);
|
|
||||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index e91b404fca2823748c2ed343cbd83301e55b2f0a..d21be63b98f026fa3ac7dcdc73f9f488a7000643 100644
|
|
||||||
--- a/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 {
|
|
||||||
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
|
||||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
|
||||||
+ public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sun, 26 Mar 2023 13:43:01 +0900
|
|
||||||
Subject: [PATCH] No Chat Reports Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index d21be63b98f026fa3ac7dcdc73f9f488a7000643..f67ac1a3dddb024af606da14b3929f10d8f22330 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -44,5 +44,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
|
||||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
|
||||||
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public NoChatReports noChatReports;
|
|
||||||
+ public class NoChatReports extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
76
patches/server/0027-Variable-entity-wakeup-duration.patch
Normal file
76
patches/server/0027-Variable-entity-wakeup-duration.patch
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Sat, 30 Sep 2023 21:56:32 +0900
|
||||||
|
Subject: [PATCH] Variable entity wakeup duration
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
index 82975c1c92c84294740a411b4a351efb8a2e6769..cb21da3cff4dbb08c7786c09b39e381abdf45c33 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
|
@@ -51,6 +51,20 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public WakeUpDurationVariance wakeUpDurationVariance;
|
||||||
|
+ public class WakeUpDurationVariance extends ConfigurationPart {
|
||||||
|
+
|
||||||
|
+ double defaultValue() {
|
||||||
|
+ return DO_OPTIMIZE ? 0.2 : 0.0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ double animal = defaultValue(); public double animal() { return Math.max(0, this.animal); }
|
||||||
|
+ double monster = defaultValue(); public double monster() { return Math.max(0, this.monster); }
|
||||||
|
+ double flyingMonster = defaultValue(); public double flyingMonster() { return Math.max(0, this.flyingMonster); }
|
||||||
|
+ double villager = defaultValue(); public double villager() { return Math.max(0, this.villager); }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
}
|
||||||
|
|
||||||
|
public Structure structure;
|
||||||
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
index 062a793a134f774ebf918aab10443527c06c4fd1..3a362fef29c6fa29c37eff539e343eb3a56bf122 100644
|
||||||
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
@@ -68,6 +68,13 @@ public class ActivationRange
|
||||||
|
Activity.PANIC
|
||||||
|
};
|
||||||
|
|
||||||
|
+ // Plazma start - Variable entity wakeup duration
|
||||||
|
+ private static final java.util.Random WAKEUP_DURATION_RANDOM = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new java.util.Random() : new org.plazmamc.plazma.Random();
|
||||||
|
+ private static int getWakeupDurationWithVariance(int duration, double deviation) {
|
||||||
|
+ if (deviation == 0) return duration;
|
||||||
|
+ return (int) Math.min(Integer.MAX_VALUE, Math.max(1, Math.round(duration * WAKEUP_DURATION_RANDOM.nextGaussian(1, deviation))));
|
||||||
|
+ }
|
||||||
|
+ // Plazma end
|
||||||
|
private static int checkInactiveWakeup(Entity entity) {
|
||||||
|
Level world = entity.level();
|
||||||
|
SpigotWorldConfig config = world.spigotConfig;
|
||||||
|
@@ -75,22 +82,22 @@ public class ActivationRange
|
||||||
|
if (entity.activationType == ActivationType.VILLAGER) {
|
||||||
|
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
|
||||||
|
world.wakeupInactiveRemainingVillagers--;
|
||||||
|
- return config.wakeUpInactiveVillagersFor;
|
||||||
|
+ return getWakeupDurationWithVariance(config.wakeUpInactiveVillagersFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.villager()); // Plazma - Variable entity wakeup duration
|
||||||
|
}
|
||||||
|
} else if (entity.activationType == ActivationType.ANIMAL) {
|
||||||
|
if (inactiveFor > config.wakeUpInactiveAnimalsEvery && world.wakeupInactiveRemainingAnimals > 0) {
|
||||||
|
world.wakeupInactiveRemainingAnimals--;
|
||||||
|
- return config.wakeUpInactiveAnimalsFor;
|
||||||
|
+ return getWakeupDurationWithVariance(config.wakeUpInactiveAnimalsFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.animal()); // Plazma - Variable entity wakeup duration
|
||||||
|
}
|
||||||
|
} else if (entity.activationType == ActivationType.FLYING_MONSTER) {
|
||||||
|
if (inactiveFor > config.wakeUpInactiveFlyingEvery && world.wakeupInactiveRemainingFlying > 0) {
|
||||||
|
world.wakeupInactiveRemainingFlying--;
|
||||||
|
- return config.wakeUpInactiveFlyingFor;
|
||||||
|
+ return getWakeupDurationWithVariance(config.wakeUpInactiveFlyingFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.flyingMonster()); // Plazma - Variable entity wakeup duration
|
||||||
|
}
|
||||||
|
} else if (entity.activationType == ActivationType.MONSTER || entity.activationType == ActivationType.RAIDER) {
|
||||||
|
if (inactiveFor > config.wakeUpInactiveMonstersEvery && world.wakeupInactiveRemainingMonsters > 0) {
|
||||||
|
world.wakeupInactiveRemainingMonsters--;
|
||||||
|
- return config.wakeUpInactiveMonstersFor;
|
||||||
|
+ return getWakeupDurationWithVariance(config.wakeUpInactiveMonstersFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sun, 26 Mar 2023 13:48:48 +0900
|
|
||||||
Subject: [PATCH] Implement No Chat Reports
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..c0bd2997fe3ebbfe926de832a36d209cc875f3e2 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
|
||||||
@@ -147,18 +147,23 @@ public class FriendlyByteBuf extends ByteBuf {
|
|
||||||
public <T> T readJsonWithCodec(Codec<T> codec) {
|
|
||||||
JsonElement jsonelement = (JsonElement) GsonHelper.fromJson(FriendlyByteBuf.GSON, this.readUtf(), JsonElement.class);
|
|
||||||
DataResult<T> dataresult = codec.parse(JsonOps.INSTANCE, jsonelement);
|
|
||||||
-
|
|
||||||
- return Util.getOrThrow(dataresult, (s) -> {
|
|
||||||
- return new DecoderException("Failed to decode json: " + s);
|
|
||||||
- });
|
|
||||||
+ // Plazma start - NCR
|
|
||||||
+ T result = Util.getOrThrow(dataresult, (s) -> new DecoderException("Failed to decode json: " + s));
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && jsonelement.getAsJsonObject().has("preventsChatReports"))
|
|
||||||
+ ((net.minecraft.network.protocol.status.ServerStatus) result).setPreventsChatReports(jsonelement.getAsJsonObject().get("preventsChatReports").getAsBoolean());
|
|
||||||
+ return result;
|
|
||||||
+ // Plazma end
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
|
|
||||||
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
|
|
||||||
|
|
||||||
- this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
|
|
||||||
- return new EncoderException("Failed to encode: " + s + " " + value);
|
|
||||||
- })));
|
|
||||||
+ // Plazma start - NCR
|
|
||||||
+ JsonElement element = Util.getOrThrow(dataresult, (s) -> new EncoderException("Failed to encode: " + s + " " + value));
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && codec == net.minecraft.network.protocol.status.ServerStatus.CODEC)
|
|
||||||
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
|
|
||||||
+ this.writeUtf(FriendlyByteBuf.GSON.toJson(element));
|
|
||||||
+ // Plazma end
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T> void writeId(IdMap<T> registry, T value) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
|
||||||
index 98ea56cbc8de5a5694b4f4d9a2f25811fdecba04..9e2a1f04cd9de2b0a7f3c512a4849a572d8fc00c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
|
||||||
@@ -62,4 +62,21 @@ public record ServerStatus(Component description, Optional<ServerStatus.Players>
|
|
||||||
return new ServerStatus.Version(worldVersion.getName(), worldVersion.getProtocolVersion());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Plazma start - NCR
|
|
||||||
+ public boolean enforcesSecureChat() {
|
|
||||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled || this.enforcesSecureChat;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private static boolean preventsChatReports;
|
|
||||||
+
|
|
||||||
+ public boolean preventsChatReports() {
|
|
||||||
+ if (this.version().isPresent() && this.version().get().protocol() < 759 && this.version().get().protocol() > 0) return true;
|
|
||||||
+ return this.preventsChatReports;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setPreventsChatReports(boolean prevents) {
|
|
||||||
+ this.preventsChatReports = prevents;
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
index 191bebab12c94756e9f98cfacbf06eb9a7c2f2f9..2d47c13f768ac482422e118921d186d3cfd5d765 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
@@ -684,7 +684,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
||||||
public boolean enforceSecureProfile() {
|
|
||||||
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
|
|
||||||
|
|
||||||
- return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null;
|
|
||||||
+ return !org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled && dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null; // Plazma - NCR // TODO: Check
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean convertOldUsers() {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
index 09183dbac0e8ca2cc2c8da57b105b80eab42d459..e4c92730b63204126609a52d286da46ef6495080 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
@@ -2293,10 +2293,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void send(Packet<?> packet) {
|
|
||||||
+ // Plazma start - NCR
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket chat)
|
|
||||||
+ packet = new ClientboundSystemChatPacket(null, Component.Serializer.toJson(chat.chatType().resolve(this.player.level().registryAccess()).get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content()))), false);
|
|
||||||
this.send(packet, (PacketSendListener) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket p && callbacks != null) {
|
|
||||||
+ this.send(p);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
+
|
|
||||||
// CraftBukkit start
|
|
||||||
if (packet == null || this.processedDisconnect) { // Spigot
|
|
||||||
return;
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
index 86932974a9101779691de336a8c45c464158fca8..b711efca8a834adaf0db902fab34c3c80c9cbad6 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -1479,7 +1479,7 @@ public abstract class PlayerList {
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
|
||||||
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
|
||||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Plazma - NCR
|
|
||||||
}
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index f67ac1a3dddb024af606da14b3929f10d8f22330..2033c7ff519e30f507e6535004687eb49c08c33b 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -49,7 +49,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public NoChatReports noChatReports;
|
|
||||||
public class NoChatReports extends ConfigurationPart {
|
|
||||||
|
|
||||||
+ public boolean enabled = false;
|
|
||||||
+ boolean addQueryData = true;
|
|
||||||
+ boolean convertToGameMessage = true;
|
|
||||||
|
|
||||||
+ public boolean addQueryData() {
|
|
||||||
+ return enabled && addQueryData;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public boolean convertToGameMessage() {
|
|
||||||
+ return enabled && convertToGameMessage;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +1,26 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Wed, 10 May 2023 15:30:03 +0900
|
Date: Sat, 30 Sep 2023 22:02:58 +0900
|
||||||
Subject: [PATCH] More optimise state lookup
|
Subject: [PATCH] Optimise state lookup more
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||||
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..5c03e26db0f9da992e9b0487a872e0ec8786650a 100644
|
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..0832e4fa92b6464a6206475fbceb3b36462757b3 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
--- a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
+++ b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||||
@@ -16,7 +16,7 @@ public final class ZeroCollidingReferenceStateTable {
|
@@ -17,6 +17,7 @@ public final class ZeroCollidingReferenceStateTable {
|
||||||
protected final Comparable<?>[] this_table;
|
|
||||||
protected final StateHolder<?, ?> this_state;
|
protected final StateHolder<?, ?> this_state;
|
||||||
|
|
||||||
- protected long[] index_table;
|
protected long[] index_table;
|
||||||
+ protected long[] index_table; public long[] index_table() { return index_table; } // Plazma - Paper - optimise state lookup
|
+ public long[] index_table() { return this.index_table; } // Plazma - getter
|
||||||
protected StateHolder<?, ?>[][] value_table;
|
protected StateHolder<?, ?>[][] value_table;
|
||||||
|
|
||||||
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
|
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
index 5f285d190186a2ff5a61d05070593e1d633dd79a..62934ef07ef856b917862c6f58ad391984da6327 100644
|
index 5f285d190186a2ff5a61d05070593e1d633dd79a..7b61a956892e90c7556db46d9277da8d252547cd 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
@@ -114,21 +114,17 @@ public abstract class StateHolder<O, S> {
|
@@ -114,21 +114,15 @@ public abstract class StateHolder<O, S> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
|
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
|
||||||
@@ -35,27 +34,26 @@ index 5f285d190186a2ff5a61d05070593e1d633dd79a..62934ef07ef856b917862c6f58ad3919
|
|||||||
- }
|
- }
|
||||||
- } else {
|
- } else {
|
||||||
- return (S)this;
|
- return (S)this;
|
||||||
+ // Plazma start - Paper - optimise state lookup
|
- }
|
||||||
+ final S ret = (S)this.optimisedTable.get(property, value);
|
+ // Plazma start - optimise state lookup more
|
||||||
+ if (ret == null) {
|
+ final S ret = (S) this.optimisedTable.get(property, value);
|
||||||
+ throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
|
+ if (ret == null) throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
|
||||||
}
|
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ // Plazma end - Paper - optimise state lookup
|
+ // Plazma end
|
||||||
}
|
}
|
||||||
|
|
||||||
public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
|
public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
|
||||||
- if (this.neighbours != null) {
|
- if (this.neighbours != null) {
|
||||||
+ if (this.optimisedTable.index_table() != null) {
|
+ if (this.optimisedTable.index_table() != null) { // Plazma - optimise state lookup more
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
} else {
|
} else {
|
||||||
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
|
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
|
||||||
@@ -143,7 +139,7 @@ public abstract class StateHolder<O, S> {
|
@@ -143,7 +137,7 @@ public abstract class StateHolder<O, S> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- this.neighbours = (Table<Property<?>, Comparable<?>, S>)(table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.neighbours, this.values); // Paper - optimise state lookup
|
- this.neighbours = (Table<Property<?>, Comparable<?>, S>)(table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.neighbours, this.values); // Paper - optimise state lookup
|
||||||
+ this.optimisedTable.loadInTable((Table)(table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Paper - optimise state lookup // Plazma
|
+ this.optimisedTable.loadInTable((Table) (table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Paper - optimise state lookup // Plazma - more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Sun, 26 Mar 2023 16:20:13 +0900
|
|
||||||
Subject: [PATCH] FixMySpawnR Configuration
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
index 2033c7ff519e30f507e6535004687eb49c08c33b..b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
|
||||||
@@ -62,4 +62,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public FixMySpawnR fixMySpawnR;
|
|
||||||
+ public class FixMySpawnR extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public boolean enabled = DO_OPTIMIZE;
|
|
||||||
+ public int timerTimeOut = 0;
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -1,42 +1,41 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Wed, 10 May 2023 15:38:58 +0900
|
Date: Sat, 30 Sep 2023 22:06:00 +0900
|
||||||
Subject: [PATCH] Suppress-Error-From-DirtyAttributes
|
Subject: [PATCH] Suppress error from dirty attributes
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index 80ab684a33876d62186dcf86f555e46db1594b09..21b18d85563ffd5f93234455dca4dc30582b8925 100644
|
index b2770e053f6db173dedbf044d67aa315e2fd7302..30b4c6bf1a0c847d00fc466ca9c997f9049bb697 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -403,8 +403,8 @@ public class ServerEntity {
|
@@ -395,7 +395,8 @@ public class ServerEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.entity instanceof LivingEntity) {
|
if (this.entity instanceof LivingEntity) {
|
||||||
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
|
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
|
||||||
-
|
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // Plazma - Suppress error from dirty attributes
|
||||||
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // Plazma - suppress error from dirty attributes
|
+ final Set<AttributeInstance> set = this.entity.level().plazmaLevelConfiguration().entity.suppressErrorFromDirtyAttributes ? java.util.Collections.synchronizedSet(attributes) : attributes; // Plazma - Suppress error from dirty attributes
|
||||||
+ final Set<AttributeInstance> set = this.entity.level().plazmaLevelConfiguration().misc.suppressErrorFromDirtyAttributes ? java.util.Collections.synchronizedSet(attributes) : attributes; // Plazma - suppress error from dirty attributes
|
|
||||||
if (!set.isEmpty()) {
|
if (!set.isEmpty()) {
|
||||||
// CraftBukkit start - Send scaled max health
|
// CraftBukkit start - Send scaled max health
|
||||||
if (this.entity instanceof ServerPlayer) {
|
@@ -406,7 +407,7 @@ public class ServerEntity {
|
||||||
@@ -414,7 +414,7 @@ public class ServerEntity {
|
|
||||||
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
||||||
}
|
}
|
||||||
|
|
||||||
- set.clear();
|
- set.clear();
|
||||||
+ attributes.clear();
|
+ attributes.clear(); // Plazma - Suppress error from dirty attributes
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
index 6db3defbf2634ae37af12246c17f852e6786d0ba..7d5bfd3a5aa5135596f3f1ae7c504a51b02798ef 100644
|
index cb21da3cff4dbb08c7786c09b39e381abdf45c33..dfd408dc42a6000eb5fa56bbdb64f2329e545078 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||||
@@ -89,6 +89,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
@@ -36,6 +36,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||||
|
public int sensorTick = DO_OPTIMIZE ? 10 : 1;
|
||||||
|
|
||||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
public boolean ignoreUselessPackets = DO_OPTIMIZE;
|
||||||
public boolean checkSpectatorMovedToQuickly = DO_OPTIMIZE;
|
|
||||||
+ public boolean suppressErrorFromDirtyAttributes = false;
|
+ public boolean suppressErrorFromDirtyAttributes = false;
|
||||||
|
|
||||||
}
|
public Player player;
|
||||||
|
public class Player extends ConfigurationPart {
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Sun, 26 Mar 2023 13:17:24 +0900
|
|
||||||
Subject: [PATCH] Implement FixMySpawnR
|
|
||||||
|
|
||||||
Original: AbsolemJackdaw/FixMySpawnR
|
|
||||||
Copyright (C) 2023 AbsolemJackdaw
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
||||||
index 64d911bee1607880514061c75116d8672df8bb8f..4dcf2c5e4efa645572c7a646e7233232c49a130c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
||||||
@@ -46,6 +46,8 @@ public abstract class BaseSpawner {
|
|
||||||
public int requiredPlayerRange = 16;
|
|
||||||
public int spawnRange = 4;
|
|
||||||
private int tickDelay = 0; // Paper
|
|
||||||
+ private int blockExistsTick = 0; // Plazma
|
|
||||||
+ private boolean blockLockedByTime = false; // Plazma
|
|
||||||
|
|
||||||
public BaseSpawner() {}
|
|
||||||
|
|
||||||
@@ -81,6 +83,18 @@ public abstract class BaseSpawner {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void serverTick(ServerLevel world, BlockPos pos) {
|
|
||||||
+ // Plazma start - FixMySpawnR
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled) {
|
|
||||||
+ if (!blockLockedByTime) {
|
|
||||||
+ if (blockExistsTick > org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.timerTimeOut) {
|
|
||||||
+ blockLockedByTime = true;
|
|
||||||
+ } else {
|
|
||||||
+ blockExistsTick++;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return;
|
|
||||||
+ // Plazma end
|
|
||||||
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
|
||||||
// Paper start - Configurable mob spawner tick rate
|
|
||||||
if (spawnDelay > 0 && --tickDelay > 0) return;
|
|
||||||
@@ -286,6 +300,13 @@ public abstract class BaseSpawner {
|
|
||||||
this.spawnRange = nbt.getShort("SpawnRange");
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Plazma start - FixMySpawnR
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled && nbt.contains("SpawnRange", 99)) {
|
|
||||||
+ this.blockExistsTick = nbt.getInt("fixmyspawnrTicks");
|
|
||||||
+ this.blockLockedByTime = nbt.getBoolean("fixMySpawnerLocked");
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
+
|
|
||||||
this.displayEntity = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -315,6 +336,12 @@ public abstract class BaseSpawner {
|
|
||||||
}
|
|
||||||
|
|
||||||
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
|
|
||||||
+ // Plazma start - FixMySpawnR
|
|
||||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled) {
|
|
||||||
+ nbt.putInt("fixmyspawnrTicks", blockExistsTick);
|
|
||||||
+ nbt.putBoolean("fixMySpawnerLocked", blockLockedByTime);
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
return nbt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,18 +1,27 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Thu, 29 Jun 2023 05:49:26 +0000
|
Date: Sat, 30 Sep 2023 22:10:59 +0900
|
||||||
Subject: [PATCH] Skip event if no listeners
|
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
|
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
|
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..6016c304ddbeb6ffbd591f30914c85fcb6371e80 100644
|
||||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
|
@@ -26,7 +26,7 @@ import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
-class PaperEventManager {
|
||||||
|
+public class PaperEventManager { // Plazma - package -> public
|
||||||
|
|
||||||
|
private final Server server;
|
||||||
|
|
||||||
@@ -36,15 +36,17 @@ class PaperEventManager {
|
@@ -36,15 +36,17 @@ class PaperEventManager {
|
||||||
|
|
||||||
// SimplePluginManager
|
// SimplePluginManager
|
||||||
public void callEvent(@NotNull Event event) {
|
public void callEvent(@NotNull Event event) {
|
||||||
+ // Plazma start
|
+ // Plazma start - Skip event if no listeners
|
||||||
+ HandlerList handlers = event.getHandlers();
|
+ HandlerList handlers = event.getHandlers();
|
||||||
+ RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
+ RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||||
+ if (listeners.length == 0) return;
|
+ if (listeners.length == 0) return;
|
||||||
@@ -29,3 +38,15 @@ index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..32305a34bcebd53aa523102a6da59bc2
|
|||||||
for (RegisteredListener registration : listeners) {
|
for (RegisteredListener registration : listeners) {
|
||||||
if (!registration.getPlugin().isEnabled()) {
|
if (!registration.getPlugin().isEnabled()) {
|
||||||
continue;
|
continue;
|
||||||
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
index d17df5621717b1c8d1d9a5549feb73c3600ecf3d..ddbc37857bd2706844074925bc27b7a84efa5832 100644
|
||||||
|
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||||
|
@@ -31,7 +31,6 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||||
|
@Override
|
||||||
|
public void postProcess() {
|
||||||
|
|
||||||
|
-
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: IPECTER <ipectert@gmail.com>
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
Date: Wed, 6 Sep 2023 14:55:37 +0900
|
Date: Sat, 30 Sep 2023 22:17:02 +0900
|
||||||
Subject: [PATCH] Optimize-spigot-event-bus
|
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
|
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
|
index 6016c304ddbeb6ffbd591f30914c85fcb6371e80..482e2cdbd4f76f2a56c62bec12bfc39d7193b6ce 100644
|
||||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||||
+++ b/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 {
|
@@ -41,11 +41,14 @@ public class PaperEventManager { // Plazma - package -> public
|
||||||
RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||||
if (listeners.length == 0) return;
|
if (listeners.length == 0) return;
|
||||||
// Plazma end
|
// Plazma end
|
||||||
@@ -16,18 +16,14 @@ index 32305a34bcebd53aa523102a6da59bc2eb765055..6feb88b90831ec7106c9d777bdfa68fa
|
|||||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||||
+ // Plazma start - Optimize spigot event bus
|
+ // Plazma start - Optimize Spigot event bus
|
||||||
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
|
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
|
||||||
+ final boolean isAsync = event.isAsynchronous();
|
+ final boolean async = event.isAsynchronous();
|
||||||
+ final boolean onPrimaryThread = this.server.isPrimaryThread();
|
+ final boolean primary = this.server.isPrimaryThread();
|
||||||
+ if (isAsync && onPrimaryThread) {
|
+ if (async && primary) throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
+ if (!async && !primary && !this.server.isStopping()) throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||||
+ } else if (!isAsync && !onPrimaryThread && !this.server.isStopping()) {
|
|
||||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
-
|
|
||||||
+ // Plazma end
|
+ // Plazma end
|
||||||
|
|
||||||
for (RegisteredListener registration : listeners) {
|
for (RegisteredListener registration : listeners) {
|
||||||
if (!registration.getPlugin().isEnabled()) {
|
if (!registration.getPlugin().isEnabled()) {
|
||||||
continue;
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Wed, 3 May 2023 16:51:49 +0900
|
|
||||||
Subject: [PATCH] Reduce Sensor Work
|
|
||||||
|
|
||||||
Original: Bloom-host/Petal
|
|
||||||
Copyright (C) 2023 peaches94
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
index 4cd04661b39a7055f5767a3dff88f9a3e197d810..ea7e40d91c314f4a58b80c978f6d7f290825856d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
@@ -1037,20 +1037,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity != null) {
|
|
||||||
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
|
||||||
+ //ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); // Plazma
|
|
||||||
EntityType<?> entitytypes = entity.getType();
|
|
||||||
|
|
||||||
// Purpur start
|
|
||||||
- if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL)) {
|
|
||||||
+ if (entitytypes == EntityType.SKELETON && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.SKELETON_SKULL)) { // Plazma
|
|
||||||
d0 *= entity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
|
||||||
}
|
|
||||||
- else if (entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD)) {
|
|
||||||
+ else if (entitytypes == EntityType.ZOMBIE && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.ZOMBIE_HEAD)) { // Plazma
|
|
||||||
d0 *= entity.level().purpurConfig.zombieHeadVisibilityPercent;
|
|
||||||
}
|
|
||||||
- else if (entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
|
|
||||||
+ else if (entitytypes == EntityType.CREEPER && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.CREEPER_HEAD)) { // Plazma
|
|
||||||
d0 *= entity.level().purpurConfig.creeperHeadVisibilityPercent;
|
|
||||||
}
|
|
||||||
- else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && itemstack.is(Items.PIGLIN_HEAD)) {
|
|
||||||
+ else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.PIGLIN_HEAD)) { // Plazma
|
|
||||||
d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
|
|
||||||
}
|
|
||||||
// Purpur end
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: IPECTER <ipectert@gmail.com>
|
|
||||||
Date: Sat, 6 May 2023 21:09:45 +0900
|
|
||||||
Subject: [PATCH] Variable entity wakeup duration
|
|
||||||
|
|
||||||
Original: GaleMC/Gale
|
|
||||||
Copyright (C) 2023 Martijn Muijsers
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
index 8dadc3fd21d507bf88f7f75935f7477375f21344..6db3defbf2634ae37af12246c17f852e6786d0ba 100644
|
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
||||||
@@ -114,5 +114,20 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public WakeUp wakeUp;
|
|
||||||
+ public class WakeUp extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public DurationVariance durationVariance;
|
|
||||||
+ public class DurationVariance extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public double animal = DO_OPTIMIZE ? 0.2 : 0.0;
|
|
||||||
+ public double monster = DO_OPTIMIZE ? 0.2 : 0.0;
|
|
||||||
+ public double flyingMonster = DO_OPTIMIZE ? 0.2 : 0.0;
|
|
||||||
+ public double villager = DO_OPTIMIZE ? 0.2 : 0.0;
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
index 43d9e7287cf0e498ccbff9b865bb813e7fb567c0..21f7c0b235936cedcc4e4bde45bebd5fea2e1275 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -75,28 +75,36 @@ public class ActivationRange
|
|
||||||
if (entity.activationType == ActivationType.VILLAGER) {
|
|
||||||
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
|
|
||||||
world.wakeupInactiveRemainingVillagers--;
|
|
||||||
- return config.wakeUpInactiveVillagersFor;
|
|
||||||
+ return getWakeUpDurationWithVariance(config.wakeUpInactiveVillagersFor, entity.level().plazmaLevelConfiguration().entity.wakeUp.durationVariance.villager); // Plazma - Variable Entity WakeUp Duration
|
|
||||||
}
|
|
||||||
} else if (entity.activationType == ActivationType.ANIMAL) {
|
|
||||||
if (inactiveFor > config.wakeUpInactiveAnimalsEvery && world.wakeupInactiveRemainingAnimals > 0) {
|
|
||||||
world.wakeupInactiveRemainingAnimals--;
|
|
||||||
- return config.wakeUpInactiveAnimalsFor;
|
|
||||||
+ return getWakeUpDurationWithVariance(config.wakeUpInactiveAnimalsFor, entity.level().plazmaLevelConfiguration().entity.wakeUp.durationVariance.animal); // Plazma - Variable Entity WakeUp Duration
|
|
||||||
}
|
|
||||||
} else if (entity.activationType == ActivationType.FLYING_MONSTER) {
|
|
||||||
if (inactiveFor > config.wakeUpInactiveFlyingEvery && world.wakeupInactiveRemainingFlying > 0) {
|
|
||||||
world.wakeupInactiveRemainingFlying--;
|
|
||||||
- return config.wakeUpInactiveFlyingFor;
|
|
||||||
+ return getWakeUpDurationWithVariance(config.wakeUpInactiveFlyingFor, entity.level().plazmaLevelConfiguration().entity.wakeUp.durationVariance.flyingMonster); // Plazma - Variable Entity WakeUp Duration
|
|
||||||
}
|
|
||||||
} else if (entity.activationType == ActivationType.MONSTER || entity.activationType == ActivationType.RAIDER) {
|
|
||||||
if (inactiveFor > config.wakeUpInactiveMonstersEvery && world.wakeupInactiveRemainingMonsters > 0) {
|
|
||||||
world.wakeupInactiveRemainingMonsters--;
|
|
||||||
- return config.wakeUpInactiveMonstersFor;
|
|
||||||
+ return getWakeUpDurationWithVariance(config.wakeUpInactiveMonstersFor, entity.level().plazmaLevelConfiguration().entity.wakeUp.durationVariance.monster); // Plazma - Variable Entity WakeUp Duration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
+ // Plazma start - Variable Entity WakeUp Duration
|
|
||||||
+ private static final java.util.Random wakeUpDurationRandom = new java.util.Random();
|
|
||||||
+ private static int getWakeUpDurationWithVariance(int wakeUpDuration, double deviation) {
|
|
||||||
+ if (deviation <= 0) return wakeUpDuration;
|
|
||||||
+ return (int) Math.min(Integer.MAX_VALUE, Math.max(1, Math.round(wakeUpDuration * wakeUpDurationRandom.nextGaussian(1, deviation))));
|
|
||||||
+ }
|
|
||||||
+ // Plazma end
|
|
||||||
+
|
|
||||||
static AABB maxBB = new AABB( 0, 0, 0, 0, 0, 0 );
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -400,7 +400,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..50d620fc893ca010b7ecb43b7a4617d6
|
|||||||
protected CipherBase(Cipher cipher) {
|
protected CipherBase(Cipher cipher) {
|
||||||
this.cipher = cipher;
|
this.cipher = cipher;
|
||||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||||
index 89c1b69ddeb420c2fbda5f588e7c9a467a76089d..ef566dc65a979db5aa67a21fa760d046a7508ac1 100644
|
index 13144ea01bc27db95a13b267d39529b012a4c9c4..9a6d6f947f33481e8a7aa09469955218d31e194a 100644
|
||||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||||
@@ -325,7 +325,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
@@ -325,7 +325,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
@@ -501,10 +501,10 @@ index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..b80dff95660314e4dd27e2ada94aa315
|
|||||||
return map;
|
return map;
|
||||||
});
|
});
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 319c469c20f3cb4f6d61425bfa6d98b55b55c4d6..d62adc228724ed5576619da70a41a6aaf9966308 100644
|
index 3a7c694ff0e248df3f4d168a5e2e883c0e3cb167..e139d15eda25c47292da549e2d4603a5056788bd 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1451,6 +1451,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1454,6 +1454,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
private final int range;
|
private final int range;
|
||||||
SectionPos lastSectionPos;
|
SectionPos lastSectionPos;
|
||||||
public final Set<ServerPlayerConnection> seenBy = new ReferenceOpenHashSet<>(); // Paper - optimise map impl
|
public final Set<ServerPlayerConnection> seenBy = new ReferenceOpenHashSet<>(); // Paper - optimise map impl
|
||||||
@@ -512,7 +512,7 @@ index 319c469c20f3cb4f6d61425bfa6d98b55b55c4d6..d62adc228724ed5576619da70a41a6aa
|
|||||||
|
|
||||||
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
||||||
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
||||||
@@ -1487,7 +1488,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1490,7 +1491,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
// stuff could have been removed, so we need to check the trackedPlayers set
|
// stuff could have been removed, so we need to check the trackedPlayers set
|
||||||
// for players that were removed
|
// for players that were removed
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ index e009dba395779e2c89a36fe4524e5d40474a29e6..c4cafcc1fb0f3b6bc17b7907ee7c6c03
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index e4c92730b63204126609a52d286da46ef6495080..864783f856e5f7cfcbccb88a07f77a95c402e90d 100644
|
index 93666cc703b349cbd7752c8c59c980da11e5d34c..2314b39ad62c6d8332ddec6c902dba5aacebfa76 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -436,7 +436,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -436,7 +436,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
@@ -563,7 +563,7 @@ index e4c92730b63204126609a52d286da46ef6495080..864783f856e5f7cfcbccb88a07f77a95
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -3455,7 +3455,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -3434,7 +3434,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
// Paper start
|
// Paper start
|
||||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||||
@@ -741,7 +741,7 @@ index 64bceae4d06b35fcbecb0daca2496ba30e39d995..805d2027fcb6c06537b3357fe104742a
|
|||||||
// this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
|
// this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
|
||||||
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
|
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||||
index 4952a7daa1aad68e3ba53123093cd879e0d544b5..597bebe5d5586d767332512fb1b2450acf6a95af 100644
|
index c94a1b75593ad01e7f79fdc84818ea8ec269e124..b45c1d611ccd80c3b1405aaef153c37bd046f083 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||||
@@ -254,7 +254,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
@@ -254,7 +254,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||||
@@ -754,7 +754,7 @@ index 4952a7daa1aad68e3ba53123093cd879e0d544b5..597bebe5d5586d767332512fb1b2450a
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
index dd84433a988712da9d799cbda2487a902315fb92..42b13e2ebf21bfd4228483a7f349e874a9cac382 100644
|
index 917648c2cc52790f40123b27b1cafa3fc3ba4b3f..c765ee642c4b77bfb3f21163c9e7a24b366e0a70 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
@@ -79,7 +79,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
@@ -79,7 +79,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||||
@@ -1273,7 +1273,7 @@ index 16d2aa4556bc9f32a2def7f9ca282aa3fa23fb87..4886624aea43c1af7ed02da336cc0d25
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 668d825a2469706e4de11629a0b41877de700ca6..01659302dce138ed00ef4c55b712572840d2f10e 100644
|
index 720a81da72a8002ff02cc39e5fca42354519c742..e10e07c89c1c79c22d82af6b76b948a4a5955a87 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -455,7 +455,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -455,7 +455,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
@@ -13,7 +13,7 @@ we used a prebaked list of all the possible colors and combinations, however thi
|
|||||||
datapack to change it.
|
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
|
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 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3a7b1d85f06f9abdac427aa736b6d4c79fdbbd14 100644
|
index 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3b873dd76c0f10a7f29206e46c1bf9b230555170 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||||
@@ -432,19 +432,27 @@ public class Sheep extends Animal implements Shearable {
|
@@ -432,19 +432,27 @@ public class Sheep extends Animal implements Shearable {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Async-PathProcessing
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
index fe502445a77afe7e3807afae48d7bf03f370e290..13392bd98a0c7fa9b859c2dfa7a01b24d5cc56d7 100644
|
index 8f8b29f80d1573981ccffd207dd6e0941e71a352..0003a27da838c5628e7329cb72d78eaed868b55d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
@@ -68,28 +68,62 @@ public class AcquirePoi {
|
@@ -68,28 +68,62 @@ public class AcquirePoi {
|
||||||
@@ -721,7 +721,7 @@ index c4395df154e8c7066d213316f300d62db9231e5c..235e842534bebf17ae447431994b7dac
|
|||||||
return false;
|
return false;
|
||||||
} else if (o.nodes.size() != this.nodes.size()) {
|
} else if (o.nodes.size() != this.nodes.size()) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..bd7a98a3cf36a36fea7db8c2933f925ed9b62056 100644
|
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..077f1d4f7ea252d5c92b3c5939a12da323bf6a03 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
@@ -24,35 +24,76 @@ public class PathFinder {
|
@@ -24,35 +24,76 @@ public class PathFinder {
|
||||||
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