Compare commits
53 Commits
old/1.19.4
...
build/1.20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9871a130b7 | ||
|
|
2bea73cda8 | ||
|
|
32dc8ecf43 | ||
|
|
2b8e2f03e1 | ||
|
|
71835526ee | ||
|
|
8c5f28b971 | ||
|
|
74ac208fa2 | ||
|
|
55fd04ed1a | ||
|
|
8348420bb7 | ||
|
|
dbce78374d | ||
|
|
23bc7620d2 | ||
|
|
4c26d69762 | ||
|
|
078fbd108c | ||
|
|
318376a16f | ||
|
|
74c593fa04 | ||
|
|
c6c048c34f | ||
|
|
017f695244 | ||
|
|
ecbebeb403 | ||
|
|
5bf8a8124e | ||
|
|
3e35bff9a0 | ||
|
|
cb7a348e89 | ||
|
|
eea08a3ecd | ||
|
|
b49ad3f336 | ||
|
|
3ba3fe9814 | ||
|
|
2adeb25bff | ||
|
|
c93e0ff16a | ||
|
|
5c5d10ae4e | ||
|
|
057b293ed5 | ||
|
|
9c54aed53d | ||
|
|
a637a72412 | ||
|
|
8f116cc067 | ||
|
|
8b317976a9 | ||
|
|
986a3f4598 | ||
|
|
5671b24941 | ||
|
|
59b163d8fa | ||
|
|
67c03ea3ec | ||
|
|
d8856b5127 | ||
|
|
a76facf92e | ||
|
|
34162ce62e | ||
|
|
eea18dca7c | ||
|
|
f427c79af9 | ||
|
|
a3142d6319 | ||
|
|
3949e2feb5 | ||
|
|
514495bb90 | ||
|
|
60aa2f51c4 | ||
|
|
ff191c4cca | ||
|
|
8058507e4d | ||
|
|
ef2cf1d921 | ||
|
|
e1445c2d7d | ||
|
|
8c84468144 | ||
|
|
9e6a4071bb | ||
|
|
567c2be31a | ||
|
|
37621427cf |
65
.github/workflows/build.yml
vendored
65
.github/workflows/build.yml
vendored
@@ -7,8 +7,8 @@ on:
|
||||
|
||||
env:
|
||||
ORG_NAME: PlazmaMC
|
||||
MC_VERSION: 1.19.4
|
||||
MAIN_BRANCH: ver/1.19.4
|
||||
MC_VERSION: 1.20.1
|
||||
MAIN_BRANCH: ver/1.20.1
|
||||
DEBUG: 'false'
|
||||
|
||||
jobs:
|
||||
@@ -16,21 +16,22 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
base_jdk: [17]
|
||||
graal: [latest]
|
||||
os: [ubuntu-22.04]
|
||||
|
||||
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout action
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout pages
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout javadocs
|
||||
uses: actions/checkout@v4
|
||||
if: github.ref_name == env.MAIN_BRANCH
|
||||
with:
|
||||
repository: PlazmaMC/Javadocs
|
||||
path: javadoc
|
||||
ref: gh-pages
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
ref: main
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
@@ -38,9 +39,9 @@ jobs:
|
||||
- name: Set up GraalVM ${{ matrix.base_jdk }}
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GH_PAT }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
java-version: ${{ matrix.base_jdk }}
|
||||
version: ${{ matrix.graal }}
|
||||
version: latest
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Configure Git
|
||||
@@ -71,11 +72,11 @@ jobs:
|
||||
if: github.ref_name == env.MAIN_BRANCH
|
||||
run: |
|
||||
export GITHUB_USERNAME=${{ env.ORG_NAME }}
|
||||
export GITHUB_TOKEN=${{ secrets.GH_PAT }}
|
||||
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||
./gradlew publish --stacktrace
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/')
|
||||
if: "!startsWith(github.ref_name, 'ver/')"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Artifacts
|
||||
@@ -84,24 +85,40 @@ jobs:
|
||||
Plazma-API/build/docs/javadoc
|
||||
|
||||
- name: Get Release Number
|
||||
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV
|
||||
|
||||
- name: Release Artifacts
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: marvinpinto/action-automatic-releases@latest
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
title: "Release #${{ env.RELEASE }}"
|
||||
automatic_release_tag: release-${{ env.RELEASE }}
|
||||
repo_token: "${{ secrets.GH_PAT }}"
|
||||
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
|
||||
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
|
||||
target_commitish: ${{ github.ref_name }}
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
files: build/libs/*.jar
|
||||
prerelease: false
|
||||
|
||||
- name: Release Artifacts (Latest)
|
||||
- name: Release Artifacts (Latest/Stable)
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: marvinpinto/action-automatic-releases@latest
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
title: "Release #${{ env.RELEASE }}"
|
||||
automatic_release_tag: latest-${{ env.MC_VERSION }}
|
||||
repo_token: "${{ secrets.GH_PAT }}"
|
||||
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
|
||||
tag_name: build/${{ env.MC_VERSION }}/latest
|
||||
target_commitish: ${{ github.ref_name }}
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
files: build/libs/*.jar
|
||||
|
||||
- name: Release Artifacts (Latest/Development)
|
||||
if: startsWith(github.ref_name, 'dev/')
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
name: "Development Build for ${{ env.MC_VERSION }}"
|
||||
tag_name: build/${{ env.MC_VERSION }}/latest
|
||||
target_commitish: ${{ github.ref_name }}
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
files: build/libs/*.jar
|
||||
|
||||
prerelease: false
|
||||
|
||||
46
.github/workflows/javadocs.yml
vendored
46
.github/workflows/javadocs.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Deploy Javadocs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["gh-pages"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v3
|
||||
|
||||
- name: Build with Jekyll
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./
|
||||
destination: ./_site
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
||||
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Test build with Normal JDK
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [19.0.2+7]
|
||||
java: ['temurin']
|
||||
os: [ubuntu-22.04]
|
||||
|
||||
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout action
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: ${{ matrix.java }}
|
||||
java-version: ${{ matrix.jdk }}
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Test build
|
||||
run: |
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
|
||||
./gradlew applyPatches --stacktrace
|
||||
./gradlew build --stacktrace
|
||||
@@ -1,2 +1,2 @@
|
||||
purpurCommit = 68862729138c74fed22a97b582f399a9c6eb9d79
|
||||
pufferfishCommit = cadfa71a2eaef4581e1163ff63d07fc596145fa1
|
||||
purpurCommit = f6fd5f6ba6e672bfdbc79def7e8598d984ec8b3c
|
||||
pufferfishCommit = 040d0aa58ee6bdadc1cb040de2cb24e9f3bf4fb2
|
||||
|
||||
47
README.md
47
README.md
@@ -1,48 +1,33 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||

|
||||
|
||||
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
||||
|
||||
[](README.md)
|
||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.19.4)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](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/Plazma/releases/latest-1.20.1)
|
||||
|
||||
[](LICENSE)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.19.4)
|
||||
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.19.4)
|
||||
[](LICENSE)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
|
||||
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
||||
[](https://github.com/PPlazmaMC/Plazma/network/members)
|
||||
[](https://github.com/PlazmaMC/Plazma/watchers)
|
||||
|
||||
</div>
|
||||
|
||||
## ⚠️ Warning
|
||||
- Plazma may cause **<u>unexpected problems</u>**, so **don't use** it in production server!
|
||||
[main]: https://github.com/PlazmaMC/Plazma
|
||||
|
||||
## 💬 About Plazma...
|
||||
- **Plazma** is created from the merger of **[Andromeda](https://github.com/TeamEarendel/Andromeda)** and **[Fusion](https://github.com/RuinedTechnologyUnify/Fusion)**
|
||||
- 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
|
||||
> [!IMPORTANT]
|
||||
This is the branch for Plazma 1.20.1. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
|
||||
이곳은 플라즈마의 1.20.1용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 브랜치][main]** 를 확인해주세요.
|
||||
|
||||
## ⬇️ Downloads
|
||||
- You can download the file from [Releases](https://github.com/PlazmaMC/Plazma/releases)
|
||||
- Direct latest download: [Click here](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.19.4/plazma-paperclip-1.19.4-R0.1-SNAPSHOT-reobf.jar)
|
||||
- NOTE: If you don't know about Mojmap or Bundler, download `plazma-paperclip-*-reobf.jar`
|
||||
> [!NOTE]
|
||||
If you don't know about Mojmap or Bundler, download **Reobf Paperclip**<br>
|
||||
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
|
||||
|
||||
## ⚖️ License
|
||||
- This project and all patches are licensed under the [MIT license](LICENSE.md) unless otherwise noted in the patch headers.
|
||||
|
||||
## 🌀 Sponsorship - Minecraft Development Dictionary (KOREAN)
|
||||
[](https://discord.gg/AZwXTA9Pgx)
|
||||
- 한글로 번역&정리된 Minecraft와 서드파티 버킷들의 소식들을 빠르게 만나볼 수 있습니다.
|
||||
- Skript와 Plugin등 서버 개발과 관련된 질문에 대한 답변을 받으실 수 있습니다.
|
||||
|
||||
## 📈 bStats
|
||||
[](https://bstats.org/plugin/server-implementation/Plazma/18047)
|
||||
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|
||||
| :---: | :---: | :---: | :---: |
|
||||
| [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) |
|
||||
|
||||
@@ -5,7 +5,7 @@ plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
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.10"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -18,39 +18,59 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.11:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "githubPackage"
|
||||
url = uri("https://maven.pkg.github.com/PlazmaMC/PlazmaBukkit")
|
||||
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_USERNAME")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
|
||||
publications.register<MavenPublication>("gpr") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java")
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
tasks {
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
withType<Test> {
|
||||
minHeapSize = "2g"
|
||||
maxHeapSize = "2g"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -83,7 +103,17 @@ paperweight {
|
||||
}
|
||||
}
|
||||
|
||||
val upstreamTask = tasks.register("updateUpstream") {
|
||||
tasks {
|
||||
generateDevelopmentBundle {
|
||||
apiCoordinates.set("org.plazmamc.plazma:plazma-api")
|
||||
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
|
||||
libraryRepositories.addAll(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
"https://papermc.io/repo/repository/maven-public/"
|
||||
)
|
||||
}
|
||||
|
||||
register("updateUpstream") {
|
||||
val tempDir = layout.cacheDir("updateUpstream");
|
||||
val file = "gradle.properties";
|
||||
|
||||
@@ -107,4 +137,5 @@ val upstreamTask = tasks.register("updateUpstream") {
|
||||
into(project.file(file).parent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
version = 1.19.4-R0.1-SNAPSHOT
|
||||
version = 1.20.1-R0.1-SNAPSHOT
|
||||
|
||||
paperCommit = 483368e480eb2ec060d8e68b30e14ec96aba6c4e
|
||||
paperCommit = 773dd724469bae89d0c2075edc3d1ddc8d5b0b18
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
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: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 4 Jun 2023 07:49:45 +0000
|
||||
Date: Sat, 23 Sep 2023 10:20:55 +0000
|
||||
Subject: [PATCH] Pufferfish API Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
@@ -20,18 +20,18 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 279a666e8ea2c07f41ee3f28b768e95dca5f0a10..a93b900889ddb56a2943c54a7fff6f60f42a78f1 100644
|
||||
index aed834334385ff3038ae69f3f34d129ad2507960..1ae1907f94a19c37b5820cfb3e9df3bd6bb1a49d 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -42,6 +42,7 @@ dependencies {
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
api("org.apache.logging.log4j:log4j-api:2.17.1")
|
||||
api("org.slf4j:slf4j-api:1.8.0-beta4")
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
+ api("io.sentry:sentry:5.4.0") // Pufferfish
|
||||
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4")
|
||||
@@ -85,6 +86,13 @@ val generateApiVersioningFile by tasks.registering {
|
||||
@@ -89,6 +90,13 @@ val generateApiVersioningFile by tasks.registering {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Tue, 4 Jan 2022 23:05:41 -0600
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 23 Sep 2023 10:28:31 +0000
|
||||
Subject: [PATCH] Purpur API Changes
|
||||
|
||||
Original: PurpurMC
|
||||
@@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index a93b900889ddb56a2943c54a7fff6f60f42a78f1..417c4324af22c870de669e338a1eee5d540184a4 100644
|
||||
index 1ae1907f94a19c37b5820cfb3e9df3bd6bb1a49d..dfb989a18ab17fec3b8f0cf90ce2fc1048215265 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -105,6 +105,8 @@ tasks.jar {
|
||||
@@ -109,6 +109,8 @@ tasks.jar {
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
@@ -209,10 +209,10 @@ index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index b0bc2df41506770e2854a287813f1c53f003eda1..a2f617537292e3bac52d665a6e51b7d4ce4a227e 100644
|
||||
index f78b5fd3c3347d28da58777bff88903d2eb140f6..584e3b08935f43beb27f478cc72229b6a5f40689 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2483,4 +2483,127 @@ public final class Bukkit {
|
||||
@@ -2756,4 +2756,127 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
@@ -341,7 +341,7 @@ index b0bc2df41506770e2854a287813f1c53f003eda1..a2f617537292e3bac52d665a6e51b7d4
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
||||
index ea4ceb643239c26851bacbf45fc3f2efef3bb4be..3b8395dcb73e3fb251adf7438cbc7e95c4185a3a 100644
|
||||
index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc857cb8e9 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit;
|
||||
@@ -352,7 +352,7 @@ index ea4ceb643239c26851bacbf45fc3f2efef3bb4be..3b8395dcb73e3fb251adf7438cbc7e95
|
||||
import java.util.regex.Pattern;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -455,4 +456,77 @@ public enum ChatColor {
|
||||
@@ -456,4 +457,77 @@ public enum ChatColor {
|
||||
BY_CHAR.put(color.code, color);
|
||||
}
|
||||
}
|
||||
@@ -431,10 +431,10 @@ index ea4ceb643239c26851bacbf45fc3f2efef3bb4be..3b8395dcb73e3fb251adf7438cbc7e95
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 9b290969b0e60f20450cd15e3fc6f37276f12ae6..77a885fd17f280649b95df758f1096fa38fe8d69 100644
|
||||
index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da3026ed0f8e 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -11166,4 +11166,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
@@ -11047,4 +11047,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||
}
|
||||
@@ -476,10 +476,10 @@ index 9b290969b0e60f20450cd15e3fc6f37276f12ae6..77a885fd17f280649b95df758f1096fa
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index 72175dcae49f75b494ab70958053ed994a8828f4..df642a55003517040be795b44a8bf107dd88810b 100644
|
||||
index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a322acadecc 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -460,4 +460,114 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -522,4 +522,114 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
*/
|
||||
@Nullable
|
||||
public Location getLastDeathLocation();
|
||||
@@ -595,10 +595,10 @@ index 72175dcae49f75b494ab70958053ed994a8828f4..df642a55003517040be795b44a8bf107
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 1d1a1d087dabc9794e0062a064da2cced4062309..96160bced90bb4cd84e48c85c645cad0eb672b85 100644
|
||||
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd3fbddddd 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1994,6 +1994,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2121,6 +2121,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -617,10 +617,10 @@ index 1d1a1d087dabc9794e0062a064da2cced4062309..96160bced90bb4cd84e48c85c645cad0
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -2162,4 +2174,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2404,4 +2416,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull org.bukkit.potion.PotionBrewer getPotionBrewer();
|
||||
// Paper end
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -724,10 +724,10 @@ index 1d1a1d087dabc9794e0062a064da2cced4062309..96160bced90bb4cd84e48c85c645cad0
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 72f1576b8ce5b55b50f053f346ce42c52db4b568..adf8169d5baefa7a33c33ef066180a8116617756 100644
|
||||
index b8b97df069b28fa3cf32f1ad1f01f586a0cfbc78..63bf1d70cce9176f47a158a4a767b1bf38d60dbd 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3974,6 +3974,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -4008,6 +4008,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
@@ -814,6 +814,35 @@ index 72f1576b8ce5b55b50f053f346ce42c52db4b568..adf8169d5baefa7a33c33ef066180a81
|
||||
/**
|
||||
* Get all {@link FeatureFlag} enabled in this world.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/block/EntityBlockStorage.java b/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
index 739911cda33b373f99df627a3a378b37d7d461aa..51e78c22cd021722b963fe31d1d9175d141add1a 100644
|
||||
--- a/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
+++ b/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
@@ -47,6 +47,24 @@ public interface EntityBlockStorage<T extends Entity> extends TileState {
|
||||
@NotNull
|
||||
List<T> releaseEntities();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Releases a stored entity, and returns the entity in the world.
|
||||
+ *
|
||||
+ * @param entity Entity to release
|
||||
+ * @return The entity which was released, or null if the stored entity is not in the hive
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.Nullable
|
||||
+ T releaseEntity(@NotNull org.purpurmc.purpur.entity.StoredEntity<T> entity);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets all the entities currently stored in the block.
|
||||
+ *
|
||||
+ * @return List of all entities which are stored in the block
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ List<org.purpurmc.purpur.entity.StoredEntity<T>> getEntities();
|
||||
+ //Purpur end
|
||||
/**
|
||||
* Add an entity to the block.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index ac9a28922f8a556944a4c3649d74c32c622f0cb0..5349f16136d9348c374a7dfe5b89a71dfcb0e66d 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -853,38 +882,38 @@ index ac9a28922f8a556944a4c3649d74c32c622f0cb0..5349f16136d9348c374a7dfe5b89a71d
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
//target.timings.stopTiming(); // Spigot // Paper
|
||||
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
index e40f017f87d6b6b4770501b106c76dc69ec69abb..eac5830986cd0638950bbb1e6f10a30e246e09a7 100644
|
||||
index fd5d9881abfd930bb883120f018f76dc78b62b14..d3dadad49df09e85c724c93e8cc88da2c985e9b4 100644
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -198,7 +198,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -214,7 +214,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
String version = Bukkit.getVersion();
|
||||
// Paper start
|
||||
if (version.startsWith("null")) { // running from ide?
|
||||
- setVersionMessage(net.kyori.adventure.text.Component.text("Unknown version, custom build?", net.kyori.adventure.text.format.NamedTextColor.YELLOW));
|
||||
+ setVersionMessage(net.kyori.adventure.text.Component.text("* Unknown version, custom build?", net.kyori.adventure.text.format.NamedTextColor.RED)); // Purpur
|
||||
- setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
|
||||
+ setVersionMessage(Component.text("* Unknown version, custom build?", NamedTextColor.RED)); // Purpur
|
||||
return;
|
||||
}
|
||||
setVersionMessage(getVersionFetcher().getVersionMessage(version));
|
||||
@@ -239,9 +239,11 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -255,9 +255,11 @@ public class VersionCommand extends BukkitCommand {
|
||||
// Paper start
|
||||
private void setVersionMessage(final @NotNull net.kyori.adventure.text.Component msg) {
|
||||
private void setVersionMessage(final @NotNull Component msg) {
|
||||
lastCheck = System.currentTimeMillis();
|
||||
- final net.kyori.adventure.text.Component message = net.kyori.adventure.text.TextComponent.ofChildren(
|
||||
- net.kyori.adventure.text.Component.text(Bukkit.getVersionMessage(), net.kyori.adventure.text.format.NamedTextColor.WHITE),
|
||||
- net.kyori.adventure.text.Component.newline(),
|
||||
- final Component message = Component.textOfChildren(
|
||||
- Component.text(Bukkit.getVersionMessage(), NamedTextColor.WHITE),
|
||||
- Component.newline(),
|
||||
+ // Purpur start
|
||||
+ int distance = getVersionFetcher().distance();
|
||||
+ final net.kyori.adventure.text.Component message = net.kyori.adventure.text.Component.join(net.kyori.adventure.text.JoinConfiguration.separator(net.kyori.adventure.text.Component.newline()),
|
||||
+ final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
|
||||
+ ChatColor.parseMM("<grey>Current: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
|
||||
+ // Purpur end
|
||||
msg
|
||||
);
|
||||
this.versionMessage = net.kyori.adventure.text.Component.text()
|
||||
this.versionMessage = Component.text()
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
index bea786a8be4402f9384984e48390e745f2988dd6..5eb81fcc18b8fdec5a0e4c699525281fa6ad4d78 100644
|
||||
index 455ff52d90565838fe7640c3f045b27082a6c2f1..45f5493eebfecf56b7c0ef4659c078dfc62c0612 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
@@ -228,6 +228,28 @@ public enum EnchantmentTarget {
|
||||
@@ -227,6 +227,28 @@ public enum EnchantmentTarget {
|
||||
public boolean includes(@NotNull Material item) {
|
||||
return BREAKABLE.includes(item) || (WEARABLE.includes(item) && !item.equals(Material.ELYTRA)) || item.equals(Material.COMPASS);
|
||||
}
|
||||
@@ -948,13 +977,13 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
|
||||
// Paper start
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index a2a423d4e4c2702ba5967223cab0432dd7d04732..cc78ce7de88a9a404ed20d5bc61b98d3107f29b3 100644
|
||||
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..98de85d1382fe84cdc2e2c9db04bf1b4f157291c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -954,4 +954,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1049,4 +1049,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
boolean wouldCollideUsing(@NotNull BoundingBox boundingBox);
|
||||
// Paper End - Collision API
|
||||
@NotNull String getScoreboardEntryName();
|
||||
// Paper end - entity scoreboard name
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -1100,10 +1129,10 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index ffca32ae2464ea5a669029079a50585ca259a4f8..654dc0c6d98b29cf45d3826aece374726e3e9802 100644
|
||||
index 19e58e62ae442ef9be02ca7fa2f55e370a54afa4..994e026d68fcda9a4c34a8b161a06623f4437dff 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1150,4 +1150,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1192,4 +1192,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
void setBodyYaw(float bodyYaw);
|
||||
// Paper end
|
||||
@@ -1171,10 +1200,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 88c4885569d2b8b22fce55601d50608ac8e9388c..dc437885404ae147a06cac653e519a4674a9a951 100644
|
||||
index f59cbc92334c7b7b20e593a58232fb3c4434f12b..d3d5d2c78cc4ee36beaa355ef7e61ef13332abab 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3068,4 +3068,139 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3273,4 +3273,143 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
@@ -1310,8 +1339,12 @@ index 88c4885569d2b8b22fce55601d50608ac8e9388c..dc437885404ae147a06cac653e519a46
|
||||
+ *
|
||||
+ * @param message The death message to show the player
|
||||
+ * @param killer The entity that killed the player
|
||||
+ * @deprecated Use {@link #sendDeathScreen(net.kyori.adventure.text.Component)} instead, as 1.20 removed the killer ID from the packet.
|
||||
+ */
|
||||
+ void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message, @Nullable Entity killer);
|
||||
+ @Deprecated(since = "1.20")
|
||||
+ default void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message, @Nullable Entity killer) {
|
||||
+ sendDeathScreen(message);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java
|
||||
@@ -1426,10 +1459,10 @@ index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d941
|
||||
* When a player gets bad omen after killing a patrol captain.
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
index a8e631315f2da68895a258cf0ba9875bc88fc48c..d5648ec745e3530aecf18c3e1f3185a5f63f3d11 100644
|
||||
index cbce826add9dc2b3187c7bea00c27b785d7517df..3a98de6407d9a6307f89c207be1f09e639385ebe 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
@@ -155,7 +155,7 @@ public enum InventoryType {
|
||||
@@ -151,7 +151,7 @@ public enum InventoryType {
|
||||
SMITHING_NEW(4, "Upgrade Gear"),
|
||||
;
|
||||
|
||||
@@ -1458,7 +1491,7 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
|
||||
+ // Purpur end
|
||||
}
|
||||
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
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
@@ -1480,8 +1513,8 @@ index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -986,4 +998,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return livingEntity.damageItemStack(this, amount);
|
||||
@@ -1005,4 +1017,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return type.isAir() || amount <= 0;
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
@@ -2153,6 +2186,23 @@ index 523818cbb0d6c90481ec97123e7fe0e2ff4eea14..bfeb8171a723d84b94bfaacd8aaf7d4d
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
index cb7040876a99a5a7e49b81684ef0f3b79584c376..22d8f31b1b8a5dbb5ab3275068642937c097abfe 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
@@ -54,4 +54,12 @@ public abstract class MapRenderer {
|
||||
*/
|
||||
public abstract void render(@NotNull MapView map, @NotNull MapCanvas canvas, @NotNull Player player);
|
||||
|
||||
+ // Purpur - start
|
||||
+ /**
|
||||
+ * Check if this is an explorer (aka treasure) map.
|
||||
+ *
|
||||
+ * @return True if explorer map
|
||||
+ */
|
||||
+ public abstract boolean isExplorerMap();
|
||||
+ // Purpur - end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad4f59bd49 100644
|
||||
--- a/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
@@ -2585,6 +2635,64 @@ index 0000000000000000000000000000000000000000..baec4c87d7ea4d54934ca22fd1eb7b46
|
||||
+ return purpur;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java b/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..29540d55532197d2381a52ea9222b5785d224ef8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java
|
||||
@@ -0,0 +1,52 @@
|
||||
+package org.purpurmc.purpur.entity;
|
||||
+
|
||||
+import org.bukkit.Nameable;
|
||||
+import org.bukkit.block.EntityBlockStorage;
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.persistence.PersistentDataHolder;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Represents an entity stored in a block
|
||||
+ *
|
||||
+ * @see org.bukkit.block.EntityBlockStorage
|
||||
+ */
|
||||
+public interface StoredEntity<T extends Entity> extends PersistentDataHolder, Nameable {
|
||||
+ /**
|
||||
+ * Checks if this entity has been released yet
|
||||
+ *
|
||||
+ * @return if this entity has been released
|
||||
+ */
|
||||
+ boolean hasBeenReleased();
|
||||
+
|
||||
+ /**
|
||||
+ * Releases the entity from its stored block
|
||||
+ *
|
||||
+ * @return the released entity, or null if unsuccessful (including if this entity has already been released)
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ T release();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the block in which this entity is stored
|
||||
+ *
|
||||
+ * @return the EntityBlockStorage in which this entity is stored, or null if it has been released
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ EntityBlockStorage<T> getBlockStorage();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity type of this stored entity
|
||||
+ *
|
||||
+ * @return the type of entity this stored entity represents
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ EntityType getType();
|
||||
+
|
||||
+ /**
|
||||
+ * Writes data to the block entity snapshot. {@link EntityBlockStorage#update()} must be run in order to update the block in game.
|
||||
+ */
|
||||
+ void update();
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/ExecuteCommandEvent.java b/src/main/java/org/purpurmc/purpur/event/ExecuteCommandEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bc590c4d49d32f4365a50ceb5785e798702a8179
|
||||
@@ -2890,17 +2998,19 @@ index 0000000000000000000000000000000000000000..519809eab5d926dc7b0a7bad5d446d0d
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b7db0db7f3afbccdb07390d1bcada109e9e6b30b
|
||||
index 0000000000000000000000000000000000000000..32602b398ede24a35ed8a996faa2b23455615a7b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
|
||||
@@ -0,0 +1,52 @@
|
||||
@@ -0,0 +1,54 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockExplodeEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import java.util.Collections;
|
||||
+
|
||||
+/**
|
||||
@@ -2911,8 +3021,8 @@ index 0000000000000000000000000000000000000000..b7db0db7f3afbccdb07390d1bcada109
|
||||
+ private boolean cancelled;
|
||||
+ private final float yield;
|
||||
+
|
||||
+ public PreBlockExplodeEvent(@NotNull final Block what, final float yield) {
|
||||
+ super(what, Collections.emptyList(), yield);
|
||||
+ public PreBlockExplodeEvent(@NotNull final Block what, final float yield, @Nullable BlockState explodedBlockState) {
|
||||
+ super(what, Collections.emptyList(), yield, explodedBlockState);
|
||||
+ this.yield = yield;
|
||||
+ this.cancelled = false;
|
||||
+ }
|
||||
@@ -3414,79 +3524,6 @@ index 0000000000000000000000000000000000000000..c268c35b541a222d50875c29770c846a
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/MonsterEggSpawnEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/MonsterEggSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..82f8a0ea22f07954d516935fc9f73f6aa0f65aa6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/MonsterEggSpawnEvent.java
|
||||
@@ -0,0 +1,67 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public class MonsterEggSpawnEvent extends Event implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+
|
||||
+ private final Player player;
|
||||
+ private Entity entity;
|
||||
+ private final ItemStack item;
|
||||
+
|
||||
+ public MonsterEggSpawnEvent(@Nullable HumanEntity player, @NotNull Entity entity, @NotNull ItemStack item) {
|
||||
+ this.player = (Player) player;
|
||||
+ this.entity = entity;
|
||||
+ this.item = item;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Entity getEntity() {
|
||||
+ return entity;
|
||||
+ }
|
||||
+
|
||||
+ public void setEntity(@Nullable Entity entity) {
|
||||
+ if (entity == null) {
|
||||
+ canceled = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ this.entity = entity;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ItemStack getItem() {
|
||||
+ return item;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isCancelled() {
|
||||
+ return canceled;
|
||||
+ }
|
||||
+
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ canceled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/PreEntityExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/PreEntityExplodeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2d4f68228861492baaea0bcc604dfef623b337ba
|
||||
|
||||
73
patches/api/0003-Bump-Dependencies.patch
Normal file
73
patches/api/0003-Bump-Dependencies.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 19 Oct 2023 22:10:35 +0900
|
||||
Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index dfb989a18ab17fec3b8f0cf90ce2fc1048215265..90a85736247f1d5520a02b66e77405637c033fe9 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,8 +27,8 @@ 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.joml:joml:1.10.5")
|
||||
@@ -46,30 +46,30 @@ 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.apache.commons:commons-lang3:3.12.0")
|
||||
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
||||
testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.5")
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@outlook.com>
|
||||
Date: Thu, 22 Dec 2022 20:29:45 +0900
|
||||
Subject: [PATCH] Bump Bungeecord Chat API to 1.19-R0.1-SNAPSHOT
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index b5835fa536f90b7f88a5ee4df78733cf43e1cb23..42de5c470a2fbb1e0bc9b809c033e3afe30502fa 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,7 +25,7 @@ dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
api("com.google.guava:guava:31.1-jre")
|
||||
api("com.google.code.gson:gson:2.10")
|
||||
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
|
||||
+ api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // Plazma
|
||||
api("org.yaml:snakeyaml:1.33")
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Plazma Configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 96160bced90bb4cd84e48c85c645cad0eb672b85..cd7080c49b769dec6d5d80774bde02e9dd8ecc01 100644
|
||||
index aaef58468a3c31f35e5067ed4263e9dd3fbddddd..0852f1a18106a81a60726756aae1d9c2ba30b111 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1994,6 +1994,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
||||
79
patches/api/0005-Optimize-spigot-event-bus.patch
Normal file
79
patches/api/0005-Optimize-spigot-event-bus.patch
Normal file
@@ -0,0 +1,79 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:04:25 +0900
|
||||
Subject: [PATCH] Optimize-spigot-event-bus
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
|
||||
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c01cb205e 100644
|
||||
--- a/src/main/java/org/bukkit/event/Event.java
|
||||
+++ b/src/main/java/org/bukkit/event/Event.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class Event {
|
||||
private String name;
|
||||
- private final boolean async;
|
||||
+ private final net.kyori.adventure.util.TriState async; // Plazma - Optimize spigot event bus
|
||||
|
||||
/**
|
||||
* The default constructor is defined for cleaner code. This constructor
|
||||
@@ -32,9 +32,35 @@ public abstract class Event {
|
||||
* by default from default constructor
|
||||
*/
|
||||
public Event(boolean isAsync) {
|
||||
+ this(net.kyori.adventure.util.TriState.byBoolean(isAsync)); // Plazma - Optimize spigot event bus
|
||||
+ }
|
||||
+
|
||||
+ // Plazma start - Optimize spigot event bus
|
||||
+ /**
|
||||
+ * This constructor is used to explicitly declare an event as synchronous
|
||||
+ * or asynchronous or potentially unset.
|
||||
+ *
|
||||
+ * @param isAsync true indicates the event will fire asynchronously, false
|
||||
+ * by default from default constructor, unset indicates that the event may be called on either the server thread or off the server
|
||||
+ * thread.
|
||||
+ */
|
||||
+ public Event(@NotNull final net.kyori.adventure.util.TriState isAsync) {
|
||||
this.async = isAsync;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Returns a tristate that, when resolving to true or false, has the exact indications defined by {@link #isAsynchronous()}.
|
||||
+ * <p>
|
||||
+ * If the tristate resolves to NOT_SET, the event may or may not have been fired off the main thread, meaning a plugin would have
|
||||
+ * to validate what thread the spigot event bus was called on.
|
||||
+ *
|
||||
+ * @return the tristate enum.
|
||||
+ */
|
||||
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
|
||||
+ return this.async;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Paper start
|
||||
/**
|
||||
* Calls the event and tests if cancelled.
|
||||
@@ -92,7 +118,7 @@ public abstract class Event {
|
||||
* @return false by default, true if the event fires asynchronously
|
||||
*/
|
||||
public final boolean isAsynchronous() {
|
||||
- return async;
|
||||
+ return this.async == net.kyori.adventure.util.TriState.TRUE; // Plazma - Optimize spigot event bus
|
||||
}
|
||||
|
||||
public enum Result {
|
||||
diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
index 3b3d9642a8d63798dc28f2f8df77f0466451cbff..0702e1692f7e671188ac18e22ca29f369b0b6352 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
@@ -62,8 +62,8 @@ public class RegisteredListener {
|
||||
* @throws EventException If an event handler throws an exception.
|
||||
*/
|
||||
public void callEvent(@NotNull final Event event) throws EventException {
|
||||
- if (event instanceof Cancellable) {
|
||||
- if (((Cancellable) event).isCancelled() && isIgnoringCancelled()) {
|
||||
+ if (isIgnoringCancelled()) { // Plazma - Optimize spigot event bus
|
||||
+ if (event instanceof Cancellable cancellable && cancellable.isCancelled()) { // Plazma - Optimize spigot event bus
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@outlook.com>
|
||||
Date: Fri, 6 Jan 2023 17:11:31 +0900
|
||||
Subject: [PATCH] Publish Packages
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 7b38042c32295ef7c5ea3c212170cc8fcdf0d7a0..1e300e51fa3413f9846c686545f2b7deb0ac5160 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -156,3 +156,23 @@ tasks.check {
|
||||
dependsOn(scanJar)
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+// Plazma start
|
||||
+publishing {
|
||||
+ repositories {
|
||||
+ maven {
|
||||
+ name = "githubPackage"
|
||||
+ url = uri("https://maven.pkg.github.com/PlazmaMC/Plazma")
|
||||
+
|
||||
+ credentials.username = System.getenv("GITHUB_USERNAME")
|
||||
+ credentials.password = System.getenv("GITHUB_TOKEN")
|
||||
+ }
|
||||
+
|
||||
+ publications {
|
||||
+ register<MavenPublication>("gpr") {
|
||||
+ from(components["java"])
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+// Plazma end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
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/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||
index 75f1d1f06978d836aab5ebbfe8f7d1e0ca5a95b6..89d70a992e0bcc8e7292c4f736470eafd8747b24 100644
|
||||
index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b4bf154a8 100644
|
||||
--- a/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 {
|
||||
@@ -58,3 +58,18 @@ index 75f1d1f06978d836aab5ebbfe8f7d1e0ca5a95b6..89d70a992e0bcc8e7292c4f736470eaf
|
||||
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
||||
}).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;
|
||||
|
||||
76
patches/server/0004-Bump-Dependencies.patch
Normal file
76
patches/server/0004-Bump-Dependencies.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 19 Oct 2023 22:20:17 +0900
|
||||
Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736..55024a308f7a9125c6739efff4f7742ce530c750 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,31 +30,31 @@ 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 // Plazma - Bump Dependencies
|
||||
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - Needed to generate meta for our Log4j plugins // Plazma - Bump Dependencies
|
||||
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 // Plazma - Bump Dependencies
|
||||
// Paper end
|
||||
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
+ 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:4.9.0") // Paper - switch to mockito
|
||||
+ 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
|
||||
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation // Plazma - Bump Dependencies
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
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") { // Plazma - Bump Dependencies
|
||||
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") // Plazma - Bump Dependencies
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
|
||||
|
||||
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
||||
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
||||
@@ -67,11 +67,11 @@ dependencies {
|
||||
}
|
||||
// Pufferfish end
|
||||
|
||||
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||
+ testImplementation("io.github.classgraph:classgraph:4.8.162") // Paper - mob goal test // Plazma - Bump Dependencies
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
||||
|
||||
- implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty
|
||||
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty // Plazma - Bump Dependencies
|
||||
}
|
||||
|
||||
val craftbukkitPackageVersion = "1_20_R1" // Paper
|
||||
@@ -5,24 +5,24 @@ Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 9c01005751c0088f560f96401cdfdebbbda4e7ec..46fda579a95f9ab92a1ba61cad8218024a722208 100644
|
||||
index 55024a308f7a9125c6739efff4f7742ce530c750..58f10fa32a163ed263c5d1effb6d247bc999bb0b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api")) // Purpur
|
||||
+ implementation(project(":plazma-api")) // Purpur
|
||||
implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
@@ -81,7 +81,7 @@ tasks.jar {
|
||||
// Purpur start
|
||||
- implementation(project(":purpur-api"))
|
||||
+ implementation(project(":plazma-api"))
|
||||
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||
exclude("io.papermc.paper", "paper-api")
|
||||
}
|
||||
@@ -95,7 +95,7 @@ tasks.jar {
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
|
||||
+ "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur // Plazma
|
||||
+ "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
@@ -153,13 +153,13 @@ index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52
|
||||
stringbuilder.append("// ");
|
||||
stringbuilder.append(CrashReport.getErrorComment());
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index cdbf10339a8e8846a8c364de483a0ccd95cd225a..5ed7acb332b8982a724e5002e12f18fe32dd4dd4 100644
|
||||
index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..ed7bcd832340a7a46897f0275c99e72b7247a5de 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -81,6 +81,17 @@ public class Main {
|
||||
@@ -111,6 +111,18 @@ public class Main {
|
||||
*/ // CraftBukkit end
|
||||
|
||||
@DontObfuscate
|
||||
public static void main(final OptionSet optionset) { // CraftBukkit - replaces main(String[] astring)
|
||||
try {
|
||||
+ // Plazma start - Branding
|
||||
+ 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
|
||||
@@ -169,16 +169,17 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..5ed7acb332b8982a724e5002e12f18fe
|
||||
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
||||
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛
|
||||
+ """);
|
||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so DO NOT USE it on a production server!");
|
||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
|
||||
+ // Plazma end
|
||||
SharedConstants.tryDetectVersion();
|
||||
/* CraftBukkit start - Replace everything
|
||||
OptionParser optionparser = new OptionParser();
|
||||
+
|
||||
// Paper start
|
||||
if (Boolean.getBoolean("Paper.isRunDev")) {
|
||||
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
|
||||
index beb05039926e1fb7a656dfcd0c503f82db67fc46..615c456de68a20d0e95b30e124a2bdf46039408f 100644
|
||||
index e6ddf69ade7ae51640569150f7db10d1afa63691..77b40f3d7162befe4da29a60b3de2b93b261412c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -930,7 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -925,7 +925,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
if (!isSameThread()) {
|
||||
@@ -188,7 +189,7 @@ index beb05039926e1fb7a656dfcd0c503f82db67fc46..615c456de68a20d0e95b30e124a2bdf4
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 56cf3d5b8e365ce6b1ec88464d9079d774206755..9133e57b83c3348b5cd7a6b31f5ec380e8a12560 100644
|
||||
index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326fc57c32c 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
@@ -219,10 +220,10 @@ index 56cf3d5b8e365ce6b1ec88464d9079d774206755..9133e57b83c3348b5cd7a6b31f5ec380
|
||||
servergui.runFinalizers();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index b8001bca2a33ec1e60566948a651400418a6e9e7..92b440b24c6b083f81837611d08fbd6773a2a6e6 100644
|
||||
index 713a091b8083e46b395311889c2a1482279c27ec..c80d73035b05bfb6b3639175c51bb37c477c28d1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1041,7 +1041,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1034,7 +1034,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
||||
// Spigot start
|
||||
if (tickingblockentity == null) {
|
||||
@@ -232,10 +233,10 @@ index b8001bca2a33ec1e60566948a651400418a6e9e7..92b440b24c6b083f81837611d08fbd67
|
||||
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
|
||||
index bd502ca721de0cab438d995efa00ad0554c0d2fe..d72f61f545c3929825e628607b85e0d25f79db1f 100644
|
||||
index 81554c321a78258ff78da3801f00d0fb90b9e113..ba2eab8a835c2396fca25d7993443d5db26c9c16 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -113,7 +113,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -156,7 +156,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
@@ -245,10 +246,10 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..d72f61f545c3929825e628607b85e0d2
|
||||
|
||||
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
|
||||
index 3310828edcabd2c24e3200dcb89d4e8ebd82cf16..5e6952a9d4c1137dc3d720ee2c944d95d4628065 100644
|
||||
index b21bc96232d0fd52e5dae7fa1c413714f8ddd7ee..875cc2357d17d37d8df921a84cf8af7b99d860f2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -262,7 +262,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@@ -258,10 +259,10 @@ index 3310828edcabd2c24e3200dcb89d4e8ebd82cf16..5e6952a9d4c1137dc3d720ee2c944d95
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
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
|
||||
index 7ef5980f7321662aa7034a74c2f6926846425db9..00200576bad5a92c65df762239dbec9a6e9a239b 100644
|
||||
index b473f89c59c0fc080fadd0d4db320895e917fd41..cdf28d1b5da2f602b020142d5bfc37922e315718 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -884,7 +884,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return EntityCategory.WATER;
|
||||
}
|
||||
|
||||
@@ -271,13 +272,13 @@ index 7ef5980f7321662aa7034a74c2f6926846425db9..00200576bad5a92c65df762239dbec9a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 5402098dce0d64d3dceea51f248d7d366850a74f..c49bed43a34549936b5751678f2389c2d9a6e1ec 100644
|
||||
index a4567188e2fe3f922bb6aeb71a2845d1a1be536f..267555c309c44067ac0e011784870bad802bc292 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -504,7 +504,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.parsePending();
|
||||
} else {
|
||||
//this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma
|
||||
// We don't need to parse pending
|
||||
@@ -321,10 +322,10 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index be8b44daa0141151c973917a774aa07721647ed1..c93f6d275d0541e0751eefca45d17c4ccd39a62a 100644
|
||||
index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -229,7 +229,7 @@ public class PurpurConfig {
|
||||
@@ -231,7 +231,7 @@ public class PurpurConfig {
|
||||
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
}
|
||||
|
||||
@@ -334,18 +335,9 @@ index be8b44daa0141151c973917a774aa07721647ed1..c93f6d275d0541e0751eefca45d17c4c
|
||||
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
|
||||
index a810bfd3b8d6bd4d8f2ef8797e4281ae4fe8a67f..a7017a0f8326e307397d357774d39216e525bdd8 100644
|
||||
index dbd502761ff6e6efb252bb41376a7ff028c73895..c765cb5dd8c3c1b668b7031e6c784ed9cf2d58e1 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -96,7 +96,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
|
||||
private WatchdogThread(long timeoutTime, boolean restart)
|
||||
{
|
||||
- super( "Watchdog Thread" ); // Purpur - use a generic name
|
||||
+ super( "Plazma Watchdog Thread" ); // Purpur - use a generic name // Plazma
|
||||
this.timeoutTime = timeoutTime;
|
||||
this.restart = restart;
|
||||
earlyWarningEvery = Math.min(io.papermc.paper.configuration.GlobalConfiguration.get().watchdog.earlyWarningEvery, timeoutTime); // Paper
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
if (isLongTimeout) {
|
||||
// Paper end
|
||||
@@ -360,7 +352,7 @@ index a810bfd3b8d6bd4d8f2ef8797e4281ae4fe8a67f..a7017a0f8326e307397d357774d39216
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/Plazma/issues" ); // Purpur // Plazma
|
||||
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
||||
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
|
||||
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur
|
||||
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -104,17 +104,10 @@ index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..28a1d21900dbff4b9d1887b9aa4e68f4
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae627764dcf8 100644
|
||||
index 2d3068b7748032342edd81e6ea4a7c08988fb28d..300b76731e1226b670cc51dfacf8e1cce4f04f7c 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
@@ -127,13 +127,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
See https://docs.papermc.io/paper/configuration for more information.
|
||||
""";
|
||||
|
||||
- private static final Supplier<SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) {
|
||||
+ public static final Supplier<SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) { // Plazma - private -> public
|
||||
@Override // override to ensure "verbose" is false
|
||||
public void init() {
|
||||
@@ -135,7 +135,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
SpigotConfig.readConfig(SpigotWorldConfig.class, this);
|
||||
}
|
||||
});
|
||||
@@ -123,7 +116,7 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae62
|
||||
|
||||
|
||||
public PaperConfigurations(final Path globalFolder) {
|
||||
@@ -297,7 +297,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -303,7 +303,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,10 +125,12 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae62
|
||||
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig);
|
||||
}
|
||||
|
||||
@@ -398,17 +398,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||
}
|
||||
@@ -402,18 +402,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
|
||||
private static boolean needsConverting(final Path legacyConfig) {
|
||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||
- }
|
||||
-
|
||||
- @Deprecated
|
||||
- public YamlConfiguration createLegacyObject(final MinecraftServer server) {
|
||||
- YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
|
||||
@@ -146,11 +141,11 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae62
|
||||
- }
|
||||
- return global;
|
||||
- }
|
||||
-
|
||||
+ }
|
||||
|
||||
@Deprecated
|
||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
@@ -431,9 +420,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -437,9 +426,15 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
|
||||
// Symlinks are not correctly checked in createDirectories
|
||||
@@ -162,17 +157,16 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae62
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ protected int getWorldConfigurationCurrentVersion() {
|
||||
+ return WorldConfiguration.CURRENT_VERSION;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 615c456de68a20d0e95b30e124a2bdf46039408f..cc6968a064b30f7250d18c20efb2bb8602bb0cdd 100644
|
||||
index 77b40f3d7162befe4da29a60b3de2b93b261412c..0acbaa18a61d1cfdb894c6c756d2b9bdc3599b82 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -309,6 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public final double[] recentTps = new double[ 4 ]; // Purpur
|
||||
// Spigot end
|
||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
||||
@@ -180,7 +174,7 @@ index 615c456de68a20d0e95b30e124a2bdf46039408f..cc6968a064b30f7250d18c20efb2bb86
|
||||
public static long currentTickLong = 0L; // Paper
|
||||
public boolean lagging = false; // Purpur
|
||||
protected boolean upnp = false; // Purpur
|
||||
@@ -415,6 +416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -412,6 +413,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end
|
||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||
this.paperConfigurations = services.paperConfigurations(); // Paper
|
||||
@@ -189,27 +183,26 @@ index 615c456de68a20d0e95b30e124a2bdf46039408f..cc6968a064b30f7250d18c20efb2bb86
|
||||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
|
||||
index ef6ff78af2ae747e939895b82ee9d11c75012dcd..6e3a1ea75005ba53a72889285597603f2d244919 100644
|
||||
index a9b2c8cd4dcd3f884e4306bebee9334d3848fce5..203c34342f19c6afb3020364baf0cc48554fa912 100644
|
||||
--- a/src/main/java/net/minecraft/server/Services.java
|
||||
+++ b/src/main/java/net/minecraft/server/Services.java
|
||||
@@ -8,10 +8,10 @@ import net.minecraft.server.players.GameProfileCache;
|
||||
@@ -11,10 +11,10 @@ import net.minecraft.server.players.GameProfileCache;
|
||||
import net.minecraft.util.SignatureValidator;
|
||||
|
||||
// Paper start
|
||||
-public record Services(MinecraftSessionService sessionService, SignatureValidator serviceSignatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations) {
|
||||
+public record Services(MinecraftSessionService sessionService, SignatureValidator serviceSignatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations) { // Plazma
|
||||
-public record Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations) {
|
||||
+public record Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations) { // Plazma
|
||||
|
||||
public Services(MinecraftSessionService sessionService, SignatureValidator signatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||
- this(sessionService, signatureValidator, profileRepository, profileCache, null);
|
||||
+ this(sessionService, signatureValidator, profileRepository, profileCache, null, null); // Plazma
|
||||
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||
- this(sessionService, servicesKeySet, profileRepository, profileCache, null);
|
||||
+ this(sessionService, servicesKeySet, profileRepository, profileCache, null, null); // Plazma
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -19,6 +19,14 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato
|
||||
return java.util.Objects.requireNonNull(this.paperConfigurations);
|
||||
}
|
||||
@@ -24,6 +24,13 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se
|
||||
// Paper end
|
||||
+
|
||||
public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
|
||||
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations() {
|
||||
@@ -217,24 +210,24 @@ index ef6ff78af2ae747e939895b82ee9d11c75012dcd..6e3a1ea75005ba53a72889285597603f
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
|
||||
|
||||
public static Services create(YggdrasilAuthenticationService authenticationService, File rootDirectory, File userCacheFile, joptsimple.OptionSet optionSet) throws Exception { // Paper
|
||||
@@ -30,7 +38,11 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato
|
||||
MinecraftSessionService minecraftSessionService = authenticationService.createMinecraftSessionService();
|
||||
GameProfileRepository gameProfileRepository = authenticationService.createProfileRepository();
|
||||
@@ -32,7 +39,11 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se
|
||||
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
|
||||
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
|
||||
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
|
||||
- return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache, paperConfigurations);
|
||||
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
|
||||
+ // Plazma start
|
||||
+ final java.nio.file.Path plazmaConfigurationDirPath = ((File) optionSet.valueOf("plazma-configurations-directory")).toPath();
|
||||
+ org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations = org.plazmamc.plazma.configurations.PlazmaConfigurations.setup(plazmaConfigurationDirPath);
|
||||
+ return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache, paperConfigurations, plazmaConfigurations);
|
||||
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, plazmaConfigurations);
|
||||
+ // Plazma end
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 6ecc75621867390738e804e06ac284524664473d..b91910eaac0e9c18722e52d223a4420199d77a7f 100644
|
||||
index 2a70abb9e0af502885593df1e732887cd9d2ce4d..e6f14bb0825e3b6987ebb2ec782c8316e3b7c094 100644
|
||||
--- a/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
|
||||
@@ -252,15 +245,15 @@ index 6ecc75621867390738e804e06ac284524664473d..b91910eaac0e9c18722e52d223a44201
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash);
|
||||
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
||||
+ org.plazmamc.plazma.commands.PlazmaCommands.registerCommands(this);
|
||||
+ org.plazmamc.plazma.commands.PlazmaCommands.registerCommands(this); // Plazma
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
|
||||
// Purpur start
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 86b8485c0fb1dc5cd79c9e24546dc74459822a48..ebbf462835e5a14fe1413c724d4985635207a897 100644
|
||||
index 221d1d0e1b4b46de6ebca5faac09bbda875fae17..e009dba395779e2c89a36fe4524e5d40474a29e6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -530,7 +530,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -650,7 +650,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||
|
||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||
@@ -270,10 +263,10 @@ index 86b8485c0fb1dc5cd79c9e24546dc74459822a48..ebbf462835e5a14fe1413c724d498563
|
||||
this.convertable = convertable_conversionsession;
|
||||
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
|
||||
index 92b440b24c6b083f81837611d08fbd6773a2a6e6..058449f24eb3260dc230dad2a0b4c552d0b7f40e 100644
|
||||
index c80d73035b05bfb6b3639175c51bb37c477c28d1..6d513c903e06fe79dffdffd02871d00cb958b715 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -175,7 +175,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -174,7 +174,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return this.paperConfig;
|
||||
}
|
||||
// Paper end
|
||||
@@ -287,7 +280,7 @@ index 92b440b24c6b083f81837611d08fbd6773a2a6e6..058449f24eb3260dc230dad2a0b4c552
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
@@ -329,9 +334,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -328,9 +333,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@Override public final int getHeight() { return this.height; }
|
||||
// Pufferfish end
|
||||
|
||||
@@ -300,10 +293,10 @@ index 92b440b24c6b083f81837611d08fbd6773a2a6e6..058449f24eb3260dc230dad2a0b4c552
|
||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||
this.generator = gen;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5e6952a9d4c1137dc3d720ee2c944d95d4628065..1367072684078c0e93c275c2159ece799f96428b 100644
|
||||
index 875cc2357d17d37d8df921a84cf8af7b99d860f2..c43023fecf0882101248f625a28975586da05071 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -993,6 +993,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1051,6 +1051,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
@@ -311,7 +304,7 @@ index 5e6952a9d4c1137dc3d720ee2c944d95d4628065..1367072684078c0e93c275c2159ece79
|
||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
@@ -2835,6 +2836,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2984,6 +2985,13 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
@@ -326,7 +319,7 @@ index 5e6952a9d4c1137dc3d720ee2c944d95d4628065..1367072684078c0e93c275c2159ece79
|
||||
@Override
|
||||
public YamlConfiguration getPurpurConfig() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 288cf98287c6d3c073b9ab6696c3957c999cad32..4970b246356bbd04eb1f9715da3fc7c9494573e2 100644
|
||||
index 4bc0a370c7aec06d30b4ebf7fa7d73263d0543bc..206cec149875137836437bd237c2ff52baad4f0e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -173,6 +173,14 @@ public class Main {
|
||||
@@ -649,7 +642,7 @@ index 0000000000000000000000000000000000000000..857ddc62dd9affbbebcd7cde8a6d675d
|
||||
+}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b1104778995a3734f3b6df71d59172e546e152a2
|
||||
index 0000000000000000000000000000000000000000..481392f3ed3b746172dbf319a583ca5751bc0b35
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||
@@ -0,0 +1,304 @@
|
||||
@@ -706,7 +699,7 @@ index 0000000000000000000000000000000000000000..b1104778995a3734f3b6df71d59172e5
|
||||
+
|
||||
+ private static final Logger LOGGER = LogUtils.getLogger();
|
||||
+ static final String GLOBAL_CONFIGURATION_FILE_NAME= "plazma-global.yml";
|
||||
+ static final String LEVEL_DEFAULT_CONFIGURATION_FILE_NAME = "plazma-level-dafaults.yml";
|
||||
+ static final String LEVEL_DEFAULT_CONFIGURATION_FILE_NAME = "plazma-level-defaults.yml";
|
||||
+ static final String LEVEL_CONFIGURATION_FILE_NAME = "plazma-configuration.yml";
|
||||
+
|
||||
+ private static final String HEADER_START = """
|
||||
@@ -975,17 +968,17 @@ index 0000000000000000000000000000000000000000..469100cd86e6742eeebad22923097782
|
||||
+
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
|
||||
index a616624a7beb35239be0fc2bb7fe60db1c673c2d..602ac1b30937a89312be7ba068a595d398e53394 100644
|
||||
index 52a6f1791c7de062d5d567d7cc9ee68731fd6e67..36ad8262b20cdd5ce4e94866c5d22cbdb5d5b385 100644
|
||||
--- a/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();
|
||||
io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper
|
||||
+ org.plazmamc.plazma.configurations.GlobalConfigurationTestingBase.setupGlobalConfigurationForTest(); // Plazma
|
||||
|
||||
ImmutableList.Builder<Material> builder = ImmutableList.builder();
|
||||
for (Material m : Material.values()) {
|
||||
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
|
||||
|
||||
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
|
||||
index 0000000000000000000000000000000000000000..2b9a17a2e04f7fb6b801920ed04133db9478f984
|
||||
@@ -3,11 +3,11 @@ From: IPECTER <ipectert@gmail.com>
|
||||
Date: Tue, 7 Mar 2023 12:28:34 +0900
|
||||
Subject: [PATCH] Optimize Default Configurations
|
||||
|
||||
Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC
|
||||
Original: YouHaveTrouble/minecraft-optimization, YouHaveTrouble/minecraft-exploits-and-how-to-fix-them, 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
|
||||
index b4e5fbace85c67e7bd347e6a90514bbc2c132d5e..edc8eba38af743167a8b78d34cb426d6929f9605 100644
|
||||
index 3e36958365bc136516bafbaad0c168f7956406f1..47e96912f8cde6e6988b5d609a4fbd8e00b126cb 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -211,8 +211,8 @@ public class PufferfishConfig {
|
||||
@@ -42,11 +42,32 @@ index b4e5fbace85c67e7bd347e6a90514bbc2c132d5e..edc8eba38af743167a8b78d34cb426d6
|
||||
"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 more often, try 9.");
|
||||
@@ -253,8 +253,18 @@ public class PufferfishConfig {
|
||||
public static Map<String, Integer> projectileTimeouts;
|
||||
private static void projectileTimeouts() {
|
||||
// Set some defaults
|
||||
- getInt("entity_timeouts.SNOWBALL", -1);
|
||||
- getInt("entity_timeouts.LLAMA_SPIT", -1);
|
||||
+ // Plazma start - Optimize Default Configurations
|
||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
|
||||
+ getInt("entity_timeouts.ARROW", 200);
|
||||
+ getInt("entity_timeouts.EGG", 200);
|
||||
+ getInt("entity_timeouts.ENDER_PEARL", 200);
|
||||
+ getInt("entity_timeouts.SNOWBALL", 200);
|
||||
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
|
||||
+ } else {
|
||||
+ // Plazma end
|
||||
+ getInt("entity_timeouts.SNOWBALL", -1);
|
||||
+ getInt("entity_timeouts.LLAMA_SPIT", -1);
|
||||
+ } // Plazma
|
||||
setComment("entity_timeouts",
|
||||
"These values define a entity's maximum lifespan. If an",
|
||||
"entity is in this list and it has survived for longer than",
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 8d442c5a498ecf288a0cc0c54889c6e2fda849ce..205ce3456a3f6d28cc2c7cbc131ec0f63a461527 100644
|
||||
index 3bc7230ca62ebe3426da293e436a962bb0134f85..766e518c6a3b3e684f5fda65a680b5378c9c0479 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -103,7 +103,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -143,7 +143,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Watchdog extends ConfigurationPart {
|
||||
public int earlyWarningEvery = 5000;
|
||||
@@ -55,11 +76,46 @@ index 8d442c5a498ecf288a0cc0c54889c6e2fda849ce..205ce3456a3f6d28cc2c7cbc131ec0f6
|
||||
}
|
||||
|
||||
public SpamLimiter spamLimiter;
|
||||
@@ -230,7 +230,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public BookSize bookSize;
|
||||
|
||||
public class BookSize extends ConfigurationPart {
|
||||
- public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above
|
||||
+ public int pageMax = !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize Default Configurations
|
||||
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
|
||||
}
|
||||
public boolean resolveSelectorsInBooks = false;
|
||||
@@ -241,7 +241,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class PacketLimiter extends ConfigurationPart {
|
||||
public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED);
|
||||
public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK);
|
||||
- public Map<Class<? extends Packet<?>>, PacketLimit> overrides = Map.of(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
|
||||
+ // Plazma start - Optimize Default Configurations
|
||||
+ public Map<Class<? extends Packet<?>>, PacketLimit> overrides = new java.util.HashMap<>() {{
|
||||
+ put(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
|
||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
|
||||
+ put(net.minecraft.network.protocol.game.ServerboundCommandSuggestionPacket.class, new PacketLimit(1.0, 15.0, PacketLimit.ViolateAction.DROP));
|
||||
+ put(net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
|
||||
+ }
|
||||
+ }};
|
||||
+ // Plazma end
|
||||
|
||||
@ConfigSerializable
|
||||
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
|
||||
@@ -308,7 +316,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
executor.setMaximumPoolSize(_chatExecutorMaxSize);
|
||||
}
|
||||
}
|
||||
- public int maxJoinsPerTick = 5;
|
||||
+ public int maxJoinsPerTick = !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3 : 5; // Plazma - Optimize Default Configurations
|
||||
public boolean fixEntityPositionDesync = true;
|
||||
public boolean loadPermissionsYmlBeforePlugins = true;
|
||||
@Constraints.Min(4)
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71c6018dc2 100644
|
||||
index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f79481e42 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -84,15 +84,15 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class AntiXray extends ConfigurationPart {
|
||||
public boolean enabled = false;
|
||||
@@ -80,7 +136,18 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -120,8 +120,8 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public ArmorStands armorStands;
|
||||
|
||||
public class ArmorStands extends ConfigurationPart {
|
||||
- public boolean doCollisionEntityLookups = true;
|
||||
- public boolean tick = true;
|
||||
+ public boolean doCollisionEntityLookups = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
+ public boolean tick = Boolean.getBoolean("Plazma.disableConfigOptimization");; // Plazma - Optimize Default Configurations
|
||||
}
|
||||
|
||||
public Markers markers;
|
||||
@@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@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)));
|
||||
@MergeMap
|
||||
@@ -89,7 +156,7 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
|
||||
@ConfigSerializable
|
||||
public record DespawnRange(@Required int soft, @Required int hard) {
|
||||
@@ -323,7 +323,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -372,7 +372,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Environment extends ConfigurationPart {
|
||||
public boolean disableThunder = false;
|
||||
public boolean disableIceAndSnow = false;
|
||||
@@ -98,7 +165,7 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -403,9 +403,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -452,9 +452,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Collisions extends ConfigurationPart {
|
||||
public boolean onlyPlayersCollide = false;
|
||||
public boolean allowVehicleCollisions = true;
|
||||
@@ -110,7 +177,7 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -413,18 +413,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -462,18 +462,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Chunks extends ConfigurationPart {
|
||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||
@@ -160,7 +227,7 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -439,9 +461,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -488,9 +510,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public TickRates tickRates;
|
||||
|
||||
public class TickRates extends ConfigurationPart {
|
||||
@@ -172,7 +239,7 @@ index a33de97340f14219291c4175e9194914cdf441db..f63b4ab2057176d4f1549200eef16e71
|
||||
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));
|
||||
}
|
||||
@@ -465,9 +487,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -514,9 +536,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
public int lightQueueSize = 20;
|
||||
@@ -197,10 +264,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 5ed7acb332b8982a724e5002e12f18fe32dd4dd4..8a10f9b7b837c4d20eaf4a83827e36f14a180ea7 100644
|
||||
index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4fcf8f86b 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -154,7 +154,7 @@ public class Main {
|
||||
@@ -166,7 +166,7 @@ public class Main {
|
||||
File configFile = (File) optionset.valueOf("bukkit-settings");
|
||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
|
||||
configuration.options().copyDefaults(true);
|
||||
@@ -210,7 +277,7 @@ index 5ed7acb332b8982a724e5002e12f18fe32dd4dd4..8a10f9b7b837c4d20eaf4a83827e36f1
|
||||
|
||||
File commandFile = (File) optionset.valueOf("commands-settings");
|
||||
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 1ea3012995c738c67b31e997c138f824f9e69ba1..aa37c7a7bfe75064db9cf78e967a6644f61b0e09 100644
|
||||
--- a/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
|
||||
@@ -233,7 +300,8 @@ index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d7
|
||||
this.opPermissionLevel = this.get("op-permission-level", 4);
|
||||
this.functionPermissionLevel = this.get("function-permission-level", 2);
|
||||
this.maxTickTime = this.get("max-tick-time", TimeUnit.MINUTES.toMillis(1L));
|
||||
this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", 1000000);
|
||||
- this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", 1000000);
|
||||
+ this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 1000000); // Plazma - Optimize Default Configurations
|
||||
this.rateLimitPacketsPerSecond = this.get("rate-limit", 0);
|
||||
- this.viewDistance = this.get("view-distance", 10);
|
||||
- this.simulationDistance = this.get("simulation-distance", 10);
|
||||
@@ -252,10 +320,10 @@ index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d7
|
||||
this.enableStatus = this.get("enable-status", true);
|
||||
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
|
||||
index 1367072684078c0e93c275c2159ece799f96428b..84fb7f6cdad5e7a5389e2469bfd6fb961cd1b299 100644
|
||||
index c43023fecf0882101248f625a28975586da05071..6b092fec6e8c468f3ecd2fc150f5463447ce2c58 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -354,7 +354,7 @@ public final class CraftServer implements Server {
|
||||
@@ -429,7 +429,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
@@ -265,7 +333,7 @@ index 1367072684078c0e93c275c2159ece799f96428b..84fb7f6cdad5e7a5389e2469bfd6fb96
|
||||
if (!this.configuration.isString("aliases")) {
|
||||
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index c93f6d275d0541e0751eefca45d17c4ccd39a62a..38a8f79b0075279389f0b3dc7de4b16d9af05295 100644
|
||||
index d0d31002562e728fa1a6c9bc81baa4534f11d365..d0968eeb0f9edeee43394da8a32d3ee8d491737b 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -49,7 +49,10 @@ public class PurpurConfig {
|
||||
@@ -280,7 +348,7 @@ index c93f6d275d0541e0751eefca45d17c4ccd39a62a..38a8f79b0075279389f0b3dc7de4b16d
|
||||
private static File CONFIG_FILE;
|
||||
public static YamlConfiguration config;
|
||||
|
||||
@@ -239,7 +242,7 @@ public class PurpurConfig {
|
||||
@@ -241,7 +244,7 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
@@ -290,10 +358,10 @@ index c93f6d275d0541e0751eefca45d17c4ccd39a62a..38a8f79b0075279389f0b3dc7de4b16d
|
||||
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
|
||||
index 397c4afa8da85845f49974832674a6e45ee6edb7..ce702e6b5fff3a54f9f254a61becd12eb5c11dd7 100644
|
||||
index 078102e636803f38facc049952813ff2f8b63594..16c3a06df8575a4fecd1967cf18854cb6267a4f7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -427,7 +427,7 @@ public class PurpurWorldConfig {
|
||||
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
|
||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
@@ -302,7 +370,7 @@ index 397c4afa8da85845f49974832674a6e45ee6edb7..ce702e6b5fff3a54f9f254a61becd12e
|
||||
public boolean teleportOnNetherCeilingDamage = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
@@ -3040,7 +3040,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3070,7 +3070,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieJockeyOnlyBaby = true;
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
@@ -312,10 +380,10 @@ index 397c4afa8da85845f49974832674a6e45ee6edb7..ce702e6b5fff3a54f9f254a61becd12e
|
||||
public boolean zombieTakeDamageFromWater = false;
|
||||
public boolean zombieAlwaysDropExp = false;
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7a7395919 100644
|
||||
index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8f6f528e6 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -148,14 +148,14 @@ public class SpigotWorldConfig
|
||||
@@ -150,14 +150,14 @@ public class SpigotWorldConfig
|
||||
public double itemMerge;
|
||||
private void itemMerge()
|
||||
{
|
||||
@@ -332,7 +400,7 @@ index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class SpigotWorldConfig
|
||||
@@ -196,7 +196,7 @@ public class SpigotWorldConfig
|
||||
public byte mobSpawnRange;
|
||||
private void mobSpawnRange()
|
||||
{
|
||||
@@ -341,7 +409,7 @@ index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7
|
||||
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
||||
}
|
||||
|
||||
@@ -205,26 +205,26 @@ public class SpigotWorldConfig
|
||||
@@ -207,26 +207,26 @@ public class SpigotWorldConfig
|
||||
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
|
||||
}
|
||||
|
||||
@@ -381,7 +449,7 @@ index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7
|
||||
public int villagersWorkImmunityAfter = 5*20;
|
||||
public int villagersWorkImmunityFor = 20;
|
||||
public boolean villagersActiveForPanic = true;
|
||||
@@ -297,7 +297,7 @@ public class SpigotWorldConfig
|
||||
@@ -299,7 +299,7 @@ public class SpigotWorldConfig
|
||||
{
|
||||
this.set( "ticks-per.hopper-check", 1 );
|
||||
}
|
||||
@@ -390,7 +458,7 @@ index bbfafb1400721251dfd2cac4dd8a31be2d682d4b..f61aca65f9d9bc6888285def1c9016f7
|
||||
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
||||
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 );
|
||||
@@ -307,7 +307,7 @@ public class SpigotWorldConfig
|
||||
@@ -309,7 +309,7 @@ public class SpigotWorldConfig
|
||||
public int tridentDespawnRate;
|
||||
private void arrowDespawnRate()
|
||||
{
|
||||
@@ -5,7 +5,7 @@ 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..8ba1c5b6731d43c02b415e4d79a20c1de0c03ad5 100644
|
||||
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 {
|
||||
@@ -16,7 +16,7 @@ index 857ddc62dd9affbbebcd7cde8a6d675dbb5f68ae..8ba1c5b6731d43c02b415e4d79a20c1d
|
||||
+ public ChunkSending chunkSending;
|
||||
+ public class ChunkSending extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = true;
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+ public int maxChunksPerTick = 5;
|
||||
+
|
||||
+ }
|
||||
@@ -7,41 +7,35 @@ 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 904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e..7f749579fe056a8436e6625204ae31f1fcc15f32 100644
|
||||
index e2202389a2c4133a183cca59c4e909fc419379ab..b3e731c122b315d28ae51d32b798f818e270c7ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -362,15 +362,14 @@ public class ChunkHolder {
|
||||
}
|
||||
@@ -398,9 +398,12 @@ public class ChunkHolder {
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
Object[] backingSet = players.getBackingSet();
|
||||
- for (int i = 0, len = backingSet.length; i < len; ++i) {
|
||||
- if (!(backingSet[i] instanceof ServerPlayer player)) {
|
||||
- continue;
|
||||
- }
|
||||
- if (!this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)) {
|
||||
- continue;
|
||||
- }
|
||||
+ // Plazma start - Implement ChunkSending
|
||||
+ for (Object o : backingSet) {
|
||||
+ if (!(o instanceof ServerPlayer player)
|
||||
+ || !this.chunkMap.playerChunkManager.isChunkSent(player, this.pos.x, this.pos.z, onlyOnWatchDistanceEdge)
|
||||
+ || (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet))) continue;
|
||||
player.connection.send(packet);
|
||||
}
|
||||
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 end - per player view distance
|
||||
}
|
||||
|
||||
// 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 852266234cf3d63e3b23a71639e40defca91c1b8..4668eebc0776a470a42de94de1752986f76250d3 100644
|
||||
index 0249eeb3937cf48cea13846a7e39b248947e21a4..f39b3f1b5b37d1939766952a985684279cb2bf2d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -730,8 +730,36 @@ public class ServerPlayer extends Player {
|
||||
@@ -772,7 +772,35 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
// Purpur end
|
||||
+ // Plazma start - Implement ChunkSending
|
||||
+ if (this.level.plazmaLevelConfiguration().chunkSending.enabled) {
|
||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
||||
+ if (chunksToSend.isEmpty()) return;
|
||||
+
|
||||
+ if (disconnected) {
|
||||
@@ -52,7 +46,7 @@ index 852266234cf3d63e3b23a71639e40defca91c1b8..4668eebc0776a470a42de94de1752986
|
||||
+ 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; i++) {
|
||||
+ 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);
|
||||
@@ -60,27 +54,26 @@ index 852266234cf3d63e3b23a71639e40defca91c1b8..4668eebc0776a470a42de94de1752986
|
||||
+ 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 {
|
||||
if (valid && !this.isSpectator() || !this.touchingUnloadedChunk()) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
|
||||
@@ -2374,7 +2402,14 @@ public class ServerPlayer extends Player {
|
||||
@@ -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) {
|
||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
||||
+ List<Packet<?>> packetList = chunksToSend.computeIfAbsent(chunkPos, k -> new java.util.ArrayList<>());
|
||||
+ packetList.add(chunkDataPacket);
|
||||
+ }
|
||||
@@ -8,7 +8,7 @@ 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 b91910eaac0e9c18722e52d223a4420199d77a7f..84bb45aef3c2087cb9c03a99184956c484b3d8e9 100644
|
||||
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
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index f719f8aafe7c75e2ef8fcb05f556a8d6bd94b9a0..06ff5dd9e39e2be8dd8397a764813111019ceaed 100644
|
||||
index 01d5fa265fb2818465b5a71a2e2efeec751a7a05..0f1ebdc20460da22c1ff2fee2ff6428654139969 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -239,7 +239,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -240,7 +240,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@Override
|
||||
public void handleHello(ServerboundHelloPacket packet) {
|
||||
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
||||
@@ -1,28 +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 ff56981a03b55f9ee1ec8ad36adaf9849b2c914b..b22b86d7f226e0e24d6be27ea33ec9d690f8f238 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -275,7 +275,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) && !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.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management
|
||||
@@ -1300,7 +1300,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) && !player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule") ? 22 : 23; // Plazma
|
||||
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));
|
||||
@@ -0,0 +1,40 @@
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,170 +5,165 @@ 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
|
||||
index e95540122ae6a486ce12a5f50fb4d2d073239554..86c9b549e3e75adf9bd5562c4c8d303cf2080e45 100644
|
||||
index 7166f4a39fd615e10d7b1f53c57363832a41f365..599eeb043bba787b88003ad2ac128e8d7f3e69c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -154,6 +154,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier {
|
||||
@@ -151,6 +151,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.allayTakeDamageFromWater;
|
||||
+ return level().purpurConfig.allayTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.allayAlwaysDropExp;
|
||||
+ return level().purpurConfig.allayAlwaysDropExp;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.allayMaxHealth);
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.allayMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
protected Brain.Provider<Allay> brainProvider() {
|
||||
return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
|
||||
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 31922ac1139f34e0da61a719e3645c1aaa188890..94536f25980cf642edbfcf0c3d338a0172e0b77f 100644
|
||||
index 9f19ebfa6392a080672c472e08f755379e9776b4..e5aa7d1cf2e3178f7117e40f2df444963af43d67 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
|
||||
@@ -90,6 +90,23 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
@@ -93,6 +93,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
public int getPurpurBreedTime() {
|
||||
return this.level().purpurConfig.camelBreedingTicks;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+ @Override
|
||||
+ public boolean dismountsUnderwater() {
|
||||
+ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.camelRidableInWater;
|
||||
+ }
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.camelTakeDamageFromWater;
|
||||
+ return level().purpurConfig.camelTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.camelAlwaysDropExp;
|
||||
+ return level().purpurConfig.camelAlwaysDropExp;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
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 c355aaed76663d37a5da8b2f49f9808828b4ef9b..dcc1b75361fe9eb250e3946e54454253a8f0e788 100644
|
||||
index dc1e8bcd8049d79c0e383ccd6a5697f79a3a2ebd..c0fce0582530e24d25368a9600b4f8c06d4f8286 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -145,6 +145,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
@@ -134,6 +134,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
public float getJumpPower() {
|
||||
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.frogTakeDamageFromWater;
|
||||
+ return level().purpurConfig.frogTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.frogAlwaysDropExp;
|
||||
+ return level().purpurConfig.frogAlwaysDropExp;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.frogMaxHealth);
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
@Override
|
||||
protected Brain.Provider<Frog> brainProvider() {
|
||||
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
|
||||
// Purpur end
|
||||
|
||||
public int getPurpurBreedTime() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index aadc6743deb195ac3368548a75be641ffd3da404..90314f86e17ac7756f8211519fc5cde5a411677d 100644
|
||||
index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e11df4c98e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -89,6 +89,23 @@ public class Tadpole extends AbstractFish {
|
||||
@@ -87,6 +87,23 @@ public class Tadpole extends AbstractFish {
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.tadpoleTakeDamageFromWater;
|
||||
+ return level().purpurConfig.tadpoleTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.tadpoleAlwaysDropExp;
|
||||
+ return level().purpurConfig.tadpoleAlwaysDropExp;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.tadpoleMaxHealth);
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
protected PathNavigation createNavigation(Level world) {
|
||||
return new WaterBoundPathNavigation(this, world);
|
||||
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 adae992ade60e0fce7ca0cc10192720025a574fe..9725389b6dd7643d00803799ce195d2d471cdcb8 100644
|
||||
index 552777d7ef6a1190a3b84bdf2f130f735c61d275..87f56c75742d856cdae24f525eac72aa5bce5ce2 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
|
||||
@@ -108,6 +108,18 @@ public class Sniffer extends Animal {
|
||||
@@ -105,6 +105,18 @@ public class Sniffer extends Animal {
|
||||
public boolean isControllable() {
|
||||
return level().purpurConfig.snifferControllable;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.snifferTakeDamageFromWater;
|
||||
+ return level().purpurConfig.snifferTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.snifferAlwaysDropExp;
|
||||
+ return level().purpurConfig.snifferAlwaysDropExp;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// CraftBukkit start - SPIGOT-7295: moved from constructor to appropriate location
|
||||
@Override
|
||||
protected void defineSynchedData() {
|
||||
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 69e5b4b6c8d5725bc2fb7cd819219e4ff9df45bd..41301ad56fbcbe0f13447bd3b515d15bf58554c4 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
|
||||
@@ -146,6 +146,23 @@ public class Warden extends Monster implements VibrationListener.VibrationListen
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
@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
|
||||
index 3fa46affc4d77d01909cfeaeaba6e06ba9fd5592..6d3373393e38f0ee530baab0d828e7c2722e9b9b 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
|
||||
@@ -145,6 +145,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
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
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level.purpurConfig.wardenTakeDamageFromWater;
|
||||
+ return level().purpurConfig.wardenTakeDamageFromWater;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level.purpurConfig.wardenAlwaysDropExp;
|
||||
+ return level().purpurConfig.wardenAlwaysDropExp;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.wardenMaxHealth);
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
public Packet<ClientGamePacketListener> getAddEntityPacket() {
|
||||
return new ClientboundAddEntityPacket(this, this.hasPose(Pose.EMERGING) ? 1 : 0);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
index 3a720375c3daa961a34363f78c2c51d301c3fa06..90bd114feb0924669e61f92f301cdcf7f69405a4 100644
|
||||
index e88c39d405fc7068db64ad34a03dec8d559e749e..bb5d42ca73722f3a02154ed889625ded2ac63e6f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
@@ -41,7 +41,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
||||
@@ -176,7 +171,7 @@ index 3a720375c3daa961a34363f78c2c51d301c3fa06..90bd114feb0924669e61f92f301cdcf7
|
||||
public ChestBoat(EntityType<? extends Boat> type, Level world) {
|
||||
super(type, world);
|
||||
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma - Add missing purpur config options
|
||||
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma
|
||||
}
|
||||
|
||||
public ChestBoat(Level world, double d0, double d1, double d2) {
|
||||
@@ -185,35 +180,35 @@ index 3a720375c3daa961a34363f78c2c51d301c3fa06..90bd114feb0924669e61f92f301cdcf7
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
- return 27;
|
||||
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma - Add missing purpur config options
|
||||
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 38a8f79b0075279389f0b3dc7de4b16d9af05295..072cc011abded538ae643b36cfb1f861d564bcec 100644
|
||||
index d0968eeb0f9edeee43394da8a32d3ee8d491737b..00e4bea74de63da5dc174febe6d6473729ddf8ac 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -329,6 +329,7 @@ public class PurpurConfig {
|
||||
@@ -331,6 +331,7 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static int barrelRows = 3;
|
||||
+ public static int chestBoatRows = 3; // Plazma - Add missing purpur config options
|
||||
+ public static int chestBoatRows = 3; // Plazma
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||
@@ -369,6 +370,7 @@ public class PurpurConfig {
|
||||
@@ -371,6 +372,7 @@ public class PurpurConfig {
|
||||
case 1 -> 9;
|
||||
default -> 27;
|
||||
});
|
||||
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma - Add missing purpur config options
|
||||
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma
|
||||
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
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
|
||||
index ce702e6b5fff3a54f9f254a61becd12eb5c11dd7..7d553b0bb9ae478d54931682501afa9f532db5dd 100644
|
||||
index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73fa3d505f3 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1098,7 +1098,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1117,7 +1117,15 @@ public class PurpurWorldConfig {
|
||||
public boolean allayRidableInWater = true;
|
||||
public boolean allayControllable = true;
|
||||
public List<String> allayRespectNBT = new ArrayList<>();
|
||||
@@ -229,23 +224,23 @@ index ce702e6b5fff3a54f9f254a61becd12eb5c11dd7..7d553b0bb9ae478d54931682501afa9f
|
||||
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
||||
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
||||
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
||||
@@ -1209,7 +1217,15 @@ public class PurpurWorldConfig {
|
||||
public double camelJumpStrengthMax = 0.42D;
|
||||
@@ -1236,7 +1244,15 @@ public class PurpurWorldConfig {
|
||||
public double camelMovementSpeedMin = 0.09D;
|
||||
public double camelMovementSpeedMax = 0.09D;
|
||||
public int camelBreedingTicks = 6000;
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+ public boolean camelRidableInWater = false;
|
||||
+ //public boolean camelRidableInWater = false;
|
||||
+ public boolean camelTakeDamageFromWater = false;
|
||||
+ public boolean camelAlwaysDropExp = false;
|
||||
private void camelSettings() {
|
||||
+ camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
+ //camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
|
||||
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
||||
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
||||
camelJumpStrengthMin = getDouble("mobs.camel.attributes.jump_strength.min", camelJumpStrengthMin);
|
||||
@@ -1636,7 +1652,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1664,7 +1680,15 @@ public class PurpurWorldConfig {
|
||||
public boolean frogControllable = true;
|
||||
public float frogRidableJumpHeight = 0.65F;
|
||||
public int frogBreedingTicks = 6000;
|
||||
@@ -261,7 +256,7 @@ index ce702e6b5fff3a54f9f254a61becd12eb5c11dd7..7d553b0bb9ae478d54931682501afa9f
|
||||
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
||||
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
||||
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
||||
@@ -2587,7 +2611,13 @@ public class PurpurWorldConfig {
|
||||
@@ -2617,7 +2641,13 @@ public class PurpurWorldConfig {
|
||||
public boolean snifferControllable = true;
|
||||
public double snifferMaxHealth = 14.0D;
|
||||
public int snifferBreedingTicks = 6000;
|
||||
@@ -275,7 +270,7 @@ index ce702e6b5fff3a54f9f254a61becd12eb5c11dd7..7d553b0bb9ae478d54931682501afa9f
|
||||
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
||||
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
||||
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
||||
@@ -2686,7 +2716,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2716,7 +2746,15 @@ public class PurpurWorldConfig {
|
||||
public boolean tadpoleRidable = false;
|
||||
public boolean tadpoleRidableInWater = true;
|
||||
public boolean tadpoleControllable = true;
|
||||
@@ -291,7 +286,7 @@ index ce702e6b5fff3a54f9f254a61becd12eb5c11dd7..7d553b0bb9ae478d54931682501afa9f
|
||||
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
||||
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
||||
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
||||
@@ -2896,7 +2934,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2926,7 +2964,15 @@ public class PurpurWorldConfig {
|
||||
public boolean wardenRidable = false;
|
||||
public boolean wardenRidableInWater = true;
|
||||
public boolean wardenControllable = true;
|
||||
@@ -5,7 +5,7 @@ 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 8ba1c5b6731d43c02b415e4d79a20c1de0c03ad5..4ee9f3ca88e89a8dcbfe6c807036386ef679da0a 100644
|
||||
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 {
|
||||
@@ -36,7 +36,7 @@ index e7554ec800f321e4e34c926c53f2375a8c3aa979..677f546cee0ebda24a6e77cb5fedd410
|
||||
|
||||
// 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 4ee9f3ca88e89a8dcbfe6c807036386ef679da0a..1cf5344d3ade76f6c24c7ea68d98b02e0dc62001 100644
|
||||
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 {
|
||||
@@ -5,12 +5,12 @@ 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 a45ff31d08129c0d5f159615d934a4450d54146e..59b9b268467b098e5c21d1d00f599cfb36154179 100644
|
||||
index 4f54ae58bd20481f02aaec3f8406996a5e01b24f..61477d98f10ce7d0ec29d51de8c7a3b42026dd2d 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -34,5 +34,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
@@ -35,5 +35,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean allowAnyUsername = false;
|
||||
public boolean enableBypassReducedDebugInfoPermission = true; // TODO: Move to Player.Permissions class
|
||||
|
||||
+ }
|
||||
+
|
||||
@@ -22,7 +22,7 @@ index a45ff31d08129c0d5f159615d934a4450d54146e..59b9b268467b098e5c21d1d00f599cfb
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 1cf5344d3ade76f6c24c7ea68d98b02e0dc62001..9416ce600d46fad167befe8d42f9a1a7d891a37f 100644
|
||||
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 {
|
||||
@@ -5,7 +5,7 @@ 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 591163d8f8300b084ac734800efee902c4def958..d74401ca3182145d136ad668704f5c043b163317 100644
|
||||
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 {
|
||||
@@ -18,10 +18,10 @@ index 591163d8f8300b084ac734800efee902c4def958..d74401ca3182145d136ad668704f5c04
|
||||
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 40eda117db2e3f578ad9d25522b6aadfe319b5cc..ef624a99c971aa5c4ce3869d10e2435c0bc8e0a4 100644
|
||||
index f39b3f1b5b37d1939766952a985684279cb2bf2d..69d22bc9f0087dc419b840c6626746e12f621012 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -405,7 +405,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -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);
|
||||
@@ -30,12 +30,12 @@ index 40eda117db2e3f578ad9d25522b6aadfe319b5cc..ef624a99c971aa5c4ce3869d10e2435c
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
@@ -442,7 +442,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -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);
|
||||
+ 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;
|
||||
@@ -53,7 +53,7 @@ index 1ef089dbf83de35d875c00efdf468c397be56978..dc111e0d1e7303c56cd12fa83be3ff85
|
||||
}
|
||||
|
||||
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 bcb0f3fd09ed064b64dc6495302b40828d906837..c6152b295a2f46e5204f42fe76e6cd10127ce12e 100644
|
||||
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 {
|
||||
@@ -66,7 +66,7 @@ index bcb0f3fd09ed064b64dc6495302b40828d906837..c6152b295a2f46e5204f42fe76e6cd10
|
||||
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 879c3bb661e24b9682b654def57c2800f4f8ca92..4c465466543e51ff1e8343d3af7ee31a8b04b839 100644
|
||||
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 {
|
||||
@@ -88,7 +88,7 @@ index 879c3bb661e24b9682b654def57c2800f4f8ca92..4c465466543e51ff1e8343d3af7ee31a
|
||||
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 7a3d9c1f8abdbc25e88ca35da1546725f0013c68..79f980cadddbfe234b410f25b5f0bc6edfcbba26 100644
|
||||
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 {
|
||||
@@ -101,10 +101,10 @@ index 7a3d9c1f8abdbc25e88ca35da1546725f0013c68..79f980cadddbfe234b410f25b5f0bc6e
|
||||
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 058449f24eb3260dc230dad2a0b4c552d0b7f40e..cf0ad841267cac84ed058dee6cdd62a835325feb 100644
|
||||
index 6d513c903e06fe79dffdffd02871d00cb958b715..589c58c6057ba5fa9d44796f807b8378ee50d2ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -125,7 +125,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -124,7 +124,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public final Thread thread;
|
||||
private final boolean isDebug;
|
||||
private int skyDarken;
|
||||
@@ -114,10 +114,10 @@ index 058449f24eb3260dc230dad2a0b4c552d0b7f40e..cf0ad841267cac84ed058dee6cdd62a8
|
||||
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 a4cd9869988f414ce1bf14d38442f78207e3f048..f99a7b2da94ef7b413ff10b57fa43e23398aa715 100644
|
||||
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
|
||||
@@ -369,7 +369,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
}
|
||||
|
||||
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
||||
@@ -127,45 +127,32 @@ index a4cd9869988f414ce1bf14d38442f78207e3f048..f99a7b2da94ef7b413ff10b57fa43e23
|
||||
|
||||
@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 e9eb32469a5c03f7a3677ef50fd4541c1ed662ad..75665373c291faaea1cbf5f54c3634fdb042556c 100644
|
||||
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
|
||||
@@ -411,7 +411,7 @@ public class EndDragonFight {
|
||||
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((registry) -> {
|
||||
return registry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
||||
}).ifPresent((reference) -> {
|
||||
- reference.value().place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ reference.value().place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), pos); // Plazma
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ public class EndDragonFight {
|
||||
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
||||
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
||||
}
|
||||
// Paper end
|
||||
- endPodiumFeature.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation);
|
||||
+ endPodiumFeature.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), this.portalLocation); // Plazma
|
||||
- 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/net/minecraft/world/level/storage/loot/LootContext.java b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
index 9e9ac64764cf0a84e25e75d8d6f516cde6047284..2d197a7de77657a19b1b527c0aa53ef9918eb15f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
@@ -202,7 +202,7 @@ public class LootContext {
|
||||
} else {
|
||||
RandomSource randomSource = this.random;
|
||||
if (randomSource == null) {
|
||||
- randomSource = RandomSource.create();
|
||||
+ randomSource = this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create();
|
||||
}
|
||||
|
||||
MinecraftServer minecraftServer = this.level.getServer();
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 59b9b268467b098e5c21d1d00f599cfb36154179..fa33fd5a64fadbfe6507ae9f61fdfbfc816686b5 100644
|
||||
index 61477d98f10ce7d0ec29d51de8c7a3b42026dd2d..3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -39,7 +39,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -40,7 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
@@ -175,7 +162,7 @@ index 59b9b268467b098e5c21d1d00f599cfb36154179..fa33fd5a64fadbfe6507ae9f61fdfbfc
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 9416ce600d46fad167befe8d42f9a1a7d891a37f..2836447cf43e145d1fc1d24f6d054be49e9a14d9 100644
|
||||
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 {
|
||||
@@ -5,7 +5,7 @@ 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 2836447cf43e145d1fc1d24f6d054be49e9a14d9..f560db0cd544c96264ebad8af3ed3dd8379bab1b 100644
|
||||
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 {
|
||||
@@ -10,31 +10,32 @@ Subject: [PATCH] Various Optimizations
|
||||
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 e71eca3ddbbeb3168dd73433b6d6ffe9f6755f77..f8be2d9d454965257de55d2aa572016115d1b346 100644
|
||||
index cf0d8da4c4b5f4aa4e4ef15897ca252a2b52ec8d..42c1b7c635cd22125dbb6b4d195976daac0c9ea1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1993,8 +1993,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -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
|
||||
+ //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();
|
||||
@@ -2023,7 +2024,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -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 6d62cc8fb347ccafd51df05896e616995990f005..c26e4795afd0bd450d304f4528d0b8e4cfa761ce 100644
|
||||
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
|
||||
@@ -43,13 +44,13 @@ index 6d62cc8fb347ccafd51df05896e616995990f005..c26e4795afd0bd450d304f4528d0b8e4
|
||||
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().getLootTables().get(this.lootTable);
|
||||
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 f55c50f6637a4f930b15565d6ac82bb4f27b9059..9c4e65a67bda331625a0891be10495eaae5f3f5e 100644
|
||||
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
|
||||
@@ -73,6 +73,7 @@ public class PhantomSpawner implements CustomSpawner {
|
||||
@@ -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));
|
||||
@@ -81,10 +82,10 @@ index 36af81f0957d17e170d229059c66f4eb4539dfeb..039c952f0c157cba6e79fa9b976958bd
|
||||
}
|
||||
// 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 fa33fd5a64fadbfe6507ae9f61fdfbfc816686b5..590afba7c588e7b9f5f9c61e91805e3dc3b62771 100644
|
||||
index 3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923..e91b404fca2823748c2ed343cbd83301e55b2f0a 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,6 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -41,6 +41,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
@@ -93,7 +94,7 @@ index fa33fd5a64fadbfe6507ae9f61fdfbfc816686b5..590afba7c588e7b9f5f9c61e91805e3d
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index f560db0cd544c96264ebad8af3ed3dd8379bab1b..80ee8293d73ecdb1a942ca88f1aa00813d600849 100644
|
||||
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 {
|
||||
@@ -6,20 +6,20 @@ Subject: [PATCH] Add configuration to disable moved to quickly check for
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index af8cb1f1f0c128923495f51e4828003133ce766b..8f911f589bf04902e38e2c625d84ba0c47cbd9ee 100644
|
||||
index 255b422078880b46dfa6f5140f6c92fef057d09e..6b6e7b8fbc0bb8a177affff0d7c7029d571faea2 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1544,7 +1544,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
if (!this.player.isChangingDimension() && (!this.player.getLevel().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
@@ -1566,7 +1566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
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;
|
||||
|
||||
- if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
+ if (!(this.player.getLevel().plazmaLevelConfiguration().misc.checkSpectatorMovedToQuickly && this.player.isSpectator()) && d11 - d10 > 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()) {
|
||||
+ 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
|
||||
// CraftBukkit end
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d7, d8, d9});
|
||||
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||
// 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
|
||||
index 80ee8293d73ecdb1a942ca88f1aa00813d600849..e6c22ab535ab8fecaadbf06d4982440fd5863f17 100644
|
||||
index 504913e8e05869f8f0b88f0faaf684d39eb14ea7..61c06213b4ceb8e38e9aa41c3517f152d0d669ad 100644
|
||||
--- a/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 {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Apply faster random
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
index e5ea9f27a1936ed9e329e74317c91c5df89b9fbd..7e7a4d872983cd2efdc575bc33353f94d73cc641 100644
|
||||
index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..4f264e098e7907c397f09ee23a579ed7da494edc 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
@@ -13,7 +13,7 @@ import java.util.UUID;
|
||||
@@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
|
||||
public class PaperLootableInventoryData {
|
||||
|
||||
@@ -18,10 +18,10 @@ index e5ea9f27a1936ed9e329e74317c91c5df89b9fbd..7e7a4d872983cd2efdc575bc33353f94
|
||||
private long lastFill = -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
|
||||
index cc6968a064b30f7250d18c20efb2bb8602bb0cdd..3c80e14392ee7a6bf5040d7cb81b7d894e162eff 100644
|
||||
index 0acbaa18a61d1cfdb894c6c756d2b9bdc3599b82..93ff3ef401d4212cede5290990528988c7ca3a0c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -694,7 +694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -691,7 +691,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
||||
// CraftBukkit start
|
||||
if (world.generator != null) {
|
||||
@@ -31,10 +31,10 @@ index cc6968a064b30f7250d18c20efb2bb8602bb0cdd..3c80e14392ee7a6bf5040d7cb81b7d89
|
||||
|
||||
if (spawn != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 68df53648c9b76cf1b6abcaa90c5e8938e9e0d05..90cfe6f05f11f18a818857b1da8da75d8831c40c 100644
|
||||
index 1392e483c363e25d1f16465d876cb7d7c70afa68..f4b99ffec5c84a5fa1f90060ec15d09b08239d49 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -230,7 +230,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -229,7 +229,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -44,10 +44,10 @@ index 68df53648c9b76cf1b6abcaa90c5e8938e9e0d05..90cfe6f05f11f18a818857b1da8da75d
|
||||
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
||||
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 d1c7ab67cba881d96b7a5e9220130d86d0514304..6018c5332410a5a0db29f35c0b4cb628df07f596 100644
|
||||
index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..7cd8a12ad560626ad3965bd46a5a71168ce6bf80 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
@@ -15,7 +15,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
@@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
|
||||
public class CraftFirework extends CraftProjectile implements Firework {
|
||||
|
||||
@@ -57,7 +57,7 @@ index d1c7ab67cba881d96b7a5e9220130d86d0514304..6018c5332410a5a0db29f35c0b4cb628
|
||||
|
||||
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
|
||||
index a9673a804d597599c35c83f4f245510c83005328..202ac2b0d96b870ce853959da89e82a4949ca585 100644
|
||||
index c3972ba41ad61af4c423e6f942ac984dc61716f0..f7b53cf1161e53d49ec2b72fed2473c1814159cd 100644
|
||||
--- a/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 {
|
||||
@@ -5,10 +5,10 @@ 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 6afee2a744a3498d4a0eee35f77cde444f73d12c..dbb987d5896e199aeae3bcd86c69bf3327af8ada 100644
|
||||
index fb11b020d52988360562db23d8568e5ef37e21c8..80ab684a33876d62186dcf86f555e46db1594b09 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -207,6 +207,7 @@ public class ServerEntity {
|
||||
@@ -203,6 +203,7 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
@@ -16,8 +16,8 @@ index 6afee2a744a3498d4a0eee35f77cde444f73d12c..dbb987d5896e199aeae3bcd86c69bf33
|
||||
}
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
@@ -281,6 +282,21 @@ public class ServerEntity {
|
||||
}));
|
||||
@@ -275,6 +276,21 @@ public class ServerEntity {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Plazma start
|
||||
@@ -39,10 +39,10 @@ index 6afee2a744a3498d4a0eee35f77cde444f73d12c..dbb987d5896e199aeae3bcd86c69bf33
|
||||
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 590afba7c588e7b9f5f9c61e91805e3dc3b62771..8ed22e178bd093241592981c06c747524ad24dc3 100644
|
||||
index e91b404fca2823748c2ed343cbd83301e55b2f0a..d21be63b98f026fa3ac7dcdc73f9f488a7000643 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 {
|
||||
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
@@ -5,10 +5,10 @@ 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 8ed22e178bd093241592981c06c747524ad24dc3..0e8d5b01a673ba826c943fcb33552518022a2ea3 100644
|
||||
index d21be63b98f026fa3ac7dcdc73f9f488a7000643..f67ac1a3dddb024af606da14b3929f10d8f22330 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -43,5 +43,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -44,5 +44,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||
|
||||
@@ -40,10 +40,10 @@ index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..c0bd2997fe3ebbfe926de832a36d209c
|
||||
|
||||
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 e6cc2bab1fde2e8c1394772b99201ea8d7eb8057..2ba3291f6c82f633d7ed7b150f2ae3c28d74b21e 100644
|
||||
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
|
||||
@@ -64,4 +64,21 @@ public record ServerStatus(Component description, Optional<ServerStatus.Players>
|
||||
@@ -62,4 +62,21 @@ public record ServerStatus(Component description, Optional<ServerStatus.Players>
|
||||
return new ServerStatus.Version(worldVersion.getName(), worldVersion.getProtocolVersion());
|
||||
}
|
||||
}
|
||||
@@ -66,29 +66,29 @@ index e6cc2bab1fde2e8c1394772b99201ea8d7eb8057..2ba3291f6c82f633d7ed7b150f2ae3c2
|
||||
+ // 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 84bb45aef3c2087cb9c03a99184956c484b3d8e9..778b79ce3530781705f6d6ae11a2631f186e3763 100644
|
||||
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
|
||||
|
||||
@Override
|
||||
public boolean enforceSecureProfile() {
|
||||
- return this.getProperties().enforceSecureProfile && this.getProperties().onlineMode;
|
||||
+ return !org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled && this.getProperties().enforceSecureProfile && this.getProperties().onlineMode; // Plazma - NCR
|
||||
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 8f911f589bf04902e38e2c625d84ba0c47cbd9ee..b15de37a06c3efb1c4bc790ccb23ebff3c97d54d 100644
|
||||
index 6b6e7b8fbc0bb8a177affff0d7c7029d571faea2..93666cc703b349cbd7752c8c59c980da11e5d34c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2235,10 +2235,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -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);
|
||||
+ 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);
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@ index 8f911f589bf04902e38e2c625d84ba0c47cbd9ee..b15de37a06c3efb1c4bc790ccb23ebff
|
||||
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 b22b86d7f226e0e24d6be27ea33ec9d690f8f238..022da50912d357581b2132cf57e1a767e436022c 100644
|
||||
index 86932974a9101779691de336a8c45c464158fca8..b711efca8a834adaf0db902fab34c3c80c9cbad6 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1464,7 +1464,7 @@ public abstract class PlayerList {
|
||||
@@ -1479,7 +1479,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
@@ -116,10 +116,10 @@ index b22b86d7f226e0e24d6be27ea33ec9d690f8f238..022da50912d357581b2132cf57e1a767
|
||||
|
||||
// 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 0e8d5b01a673ba826c943fcb33552518022a2ea3..17454a128f7ef53428920f95e4709180fd8efb32 100644
|
||||
index f67ac1a3dddb024af606da14b3929f10d8f22330..2033c7ff519e30f507e6535004687eb49c08c33b 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -48,7 +48,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -49,7 +49,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public NoChatReports noChatReports;
|
||||
public class NoChatReports extends ConfigurationPart {
|
||||
|
||||
@@ -5,10 +5,10 @@ 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 17454a128f7ef53428920f95e4709180fd8efb32..39eca4acefa8f9cf143398cfc6cf157e8489947e 100644
|
||||
index 2033c7ff519e30f507e6535004687eb49c08c33b..b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -61,4 +61,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -62,4 +62,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ 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 feb65fc9ee04141fe6f77400660442ed207547a1..9c759e71ef1d119d7807886f9e56b7230a334475 100644
|
||||
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 {
|
||||
@@ -38,7 +38,7 @@ index feb65fc9ee04141fe6f77400660442ed207547a1..9c759e71ef1d119d7807886f9e56b723
|
||||
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
||||
// Paper start - Configurable mob spawner tick rate
|
||||
if (spawnDelay > 0 && --tickDelay > 0) return;
|
||||
@@ -292,6 +306,13 @@ public abstract class BaseSpawner {
|
||||
@@ -286,6 +300,13 @@ public abstract class BaseSpawner {
|
||||
this.spawnRange = nbt.getShort("SpawnRange");
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ index feb65fc9ee04141fe6f77400660442ed207547a1..9c759e71ef1d119d7807886f9e56b723
|
||||
this.displayEntity = null;
|
||||
}
|
||||
|
||||
@@ -321,6 +342,12 @@ public abstract class BaseSpawner {
|
||||
@@ -315,6 +336,12 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
|
||||
@@ -1,13 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Tue, 28 Mar 2023 12:42:17 +0900
|
||||
Subject: [PATCH] Implement MemoryLeakFix
|
||||
Subject: [PATCH] Improve BiomeTemperatureCache
|
||||
|
||||
Original: fxmorin/MemoryLeakFix
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
|
||||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644
|
||||
--- a/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 {
|
||||
@@ -15,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
||||
private final BiomeSpecialEffects specialEffects;
|
||||
// Pufferfish start - use our cache
|
||||
- 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(() -> {
|
||||
/*
|
||||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||
@@ -24,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
|
||||
long l = blockPos.asLong();
|
||||
// Pufferfish start
|
||||
- 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);
|
||||
if (!Float.isNaN(f)) {
|
||||
return f;
|
||||
@@ -7,32 +7,32 @@ 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 b67660cda74a4754d1701e746aca99bde868c150..8dcc8ea2450ee14880e2ffff0f013ccee9b33e2f 100644
|
||||
index 49906b4dc8392eee592215d0b4cba85267a875fc..a0759a2f1191cc44a0c441db180ad8bd300ff4a4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1020,20 +1020,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -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 - check head itemstack only when needed
|
||||
+ //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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||
}
|
||||
// Purpur end
|
||||
@@ -7,24 +7,24 @@ 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
|
||||
index 8e2274f7dce34e0997356205cf96e46f8d41cca1..3a365d7efd439cb8ddb99381bd714fb48896f4d2 100644
|
||||
index 5dd0c925af627f7159289dc1e3e79bc593c421f2..699b166b6438cbe0cd197547df4d8dc4359e0b34 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -932,10 +932,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -935,10 +935,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
// Paper end
|
||||
//this.level.getProfiler().push("sensing"); // Purpur
|
||||
//this.level().getProfiler().push("sensing"); // Purpur
|
||||
- this.sensing.tick();
|
||||
+ // Plazma - Configurable Sensor Tick
|
||||
//this.level.getProfiler().pop(); // Purpur
|
||||
int i = this.level.getServer().getTickCount() + this.getId();
|
||||
-
|
||||
+ if (i % this.level.plazmaLevelConfiguration().entity.sensor.tick == 0) this.sensing.tick(); // Plazma - Configurable Sensor Tick
|
||||
+ //this.sensing.tick(); // Plazma - moved down (configurable sensor tick)
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
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 % 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
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index e6c22ab535ab8fecaadbf06d4982440fd5863f17..185e2627596314d979188468f838d008442f2d2e 100644
|
||||
index 61c06213b4ceb8e38e9aa41c3517f152d0d669ad..8dadc3fd21d507bf88f7f75935f7477375f21344 100644
|
||||
--- a/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 {
|
||||
@@ -6,10 +6,16 @@ Subject: [PATCH] Optimize VarInts
|
||||
https://github.com/PaperMC/Paper/pull/8418
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817f096e2eb 100644
|
||||
index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..8bb552410207b39a3b4160a5df51410455107fcf 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -104,7 +104,20 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -99,12 +99,26 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
private static final Gson GSON = new Gson();
|
||||
|
||||
public static boolean hasItemSerializeEvent = false; // Purpur
|
||||
+ public static boolean optimizeVarInts = false; // Plazma
|
||||
|
||||
public FriendlyByteBuf(ByteBuf parent) {
|
||||
this.source = parent;
|
||||
}
|
||||
|
||||
@@ -24,18 +30,18 @@ index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817
|
||||
+ // Plazma end
|
||||
public static int getVarIntSize(int value) {
|
||||
+ // Plazma start - Optimize VarInts
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.optimizeVarInts)
|
||||
+ if (optimizeVarInts)
|
||||
+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)];
|
||||
+ // Plazma end
|
||||
for (int j = 1; j < 5; ++j) {
|
||||
if ((value & -1 << j * 7) == 0) {
|
||||
return j;
|
||||
@@ -620,6 +633,25 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -620,6 +634,25 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
}
|
||||
|
||||
public FriendlyByteBuf writeVarInt(int value) {
|
||||
+ // Plazma start - Optimize VarInts
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.optimizeVarInts) {
|
||||
+ if (optimizeVarInts) {
|
||||
+ // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
|
||||
+ // that the proxy will write, to improve inlining.
|
||||
+ if ((value & (0xFFFFFFFF << 7)) == 0) {
|
||||
@@ -57,14 +63,25 @@ index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..6108f3aa438b96e817c3a2e582c2c817
|
||||
this.writeByte(value & 127 | 128);
|
||||
value >>>= 7;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 39eca4acefa8f9cf143398cfc6cf157e8489947e..754ed13a04631c69e3fb2421a12b17d0a6f732c6 100644
|
||||
index b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0..525fe30b6abba295709fca3d10f9b24679112571 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 {
|
||||
@@ -38,11 +38,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public Misc misc;
|
||||
- public class Misc extends ConfigurationPart {
|
||||
+ public class Misc extends ConfigurationPart.Post {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||
+ public boolean optimizeVarInts = DO_OPTIMIZE;
|
||||
+
|
||||
+ @Override
|
||||
+ public void postProcess() {
|
||||
+ net.minecraft.network.FriendlyByteBuf.optimizeVarInts = optimizeVarInts;
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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
|
||||
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 185e2627596314d979188468f838d008442f2d2e..238e10a35a9e4b300b11c838cda39b8799f16fe2 100644
|
||||
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 {
|
||||
@@ -32,7 +32,7 @@ index 185e2627596314d979188468f838d008442f2d2e..238e10a35a9e4b300b11c838cda39b87
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index ee64ddb0da23ea1e54d0295324aca5b46a438111..d5230a360cd8c296303b494d716d33ad1fca6a96 100644
|
||||
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
|
||||
@@ -40,25 +40,25 @@ index ee64ddb0da23ea1e54d0295324aca5b46a438111..d5230a360cd8c296303b494d716d33ad
|
||||
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
|
||||
+ 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
|
||||
+ 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
|
||||
+ 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 getWakeUpDurationWithVariance(config.wakeUpInactiveMonstersFor, entity.level().plazmaLevelConfiguration().entity.wakeUp.durationVariance.monster); // Plazma - Variable Entity WakeUp Duration
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 10 May 2023 15:30:03 +0900
|
||||
Subject: [PATCH] More-Optimise-State-Lookup
|
||||
Subject: [PATCH] More optimise state lookup
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||
@@ -18,7 +18,7 @@ index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..5c03e26db0f9da992e9b0487a872e0ec
|
||||
|
||||
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
|
||||
index 170f5cb3f01a57ad76e3bbeacd5b7c7e52f29959..ec42cafb7a9caf710f9ec5cea6130d54092dc5d2 100644
|
||||
index 5f285d190186a2ff5a61d05070593e1d633dd79a..62934ef07ef856b917862c6f58ad391984da6327 100644
|
||||
--- a/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> {
|
||||
@@ -26,7 +26,7 @@ index 170f5cb3f01a57ad76e3bbeacd5b7c7e52f29959..ec42cafb7a9caf710f9ec5cea6130d54
|
||||
|
||||
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
|
||||
- Comparable<?> comparable = this.values.get(property);
|
||||
- if (comparable != null && comparable != value) {
|
||||
- if (comparable != null && !comparable.equals(value)) {
|
||||
- S object = this.neighbours.get(property, value);
|
||||
- if (object == null) {
|
||||
- throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
|
||||
@@ -5,21 +5,21 @@ Subject: [PATCH] Suppress-Error-From-DirtyAttributes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index dbb987d5896e199aeae3bcd86c69bf3327af8ada..d6079c9577d65eab51dab8803eab6e46dccc8dd3 100644
|
||||
index 80ab684a33876d62186dcf86f555e46db1594b09..21b18d85563ffd5f93234455dca4dc30582b8925 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -419,8 +419,8 @@ public class ServerEntity {
|
||||
@@ -403,8 +403,8 @@ public class ServerEntity {
|
||||
}
|
||||
|
||||
if (this.entity instanceof LivingEntity) {
|
||||
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
|
||||
-
|
||||
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // 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
|
||||
+ 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()) {
|
||||
// CraftBukkit start - Send scaled max health
|
||||
if (this.entity instanceof ServerPlayer) {
|
||||
@@ -430,7 +430,7 @@ public class ServerEntity {
|
||||
@@ -414,7 +414,7 @@ public class ServerEntity {
|
||||
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index dbb987d5896e199aeae3bcd86c69bf3327af8ada..d6079c9577d65eab51dab8803eab6e46
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 238e10a35a9e4b300b11c838cda39b8799f16fe2..a1b55bb5431d1712fc06da0cf06857a986efeea0 100644
|
||||
index 6db3defbf2634ae37af12246c17f852e6786d0ba..7d5bfd3a5aa5135596f3f1ae7c504a51b02798ef 100644
|
||||
--- a/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 {
|
||||
@@ -7,10 +7,10 @@ Original: malte0811/FerriteCore
|
||||
Copyright (C) 2023 malte0811
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index bee42ce7c1cb0f5ebd4890c02bc9c5dd727f7fd6..22f194956640b88c1d060b732e517f85d9091cf6 100644
|
||||
index 942ce713afe27ec75d849877a88721ef6334fafa..595771af13659fcb365fd3f088762dc01964842f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -737,6 +737,12 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -789,6 +789,12 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
protected BlockBehaviour.BlockStateBase.Cache cache;
|
||||
private FluidState fluidState;
|
||||
private boolean isRandomlyTicking;
|
||||
@@ -23,7 +23,7 @@ index bee42ce7c1cb0f5ebd4890c02bc9c5dd727f7fd6..22f194956640b88c1d060b732e517f85
|
||||
|
||||
protected BlockStateBase(Block block, ImmutableMap<Property<?>, Comparable<?>> propertyMap, MapCodec<BlockState> codec) {
|
||||
super(block, propertyMap, codec);
|
||||
@@ -795,6 +801,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -871,6 +877,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
// Paper end
|
||||
|
||||
public void initCache() {
|
||||
@@ -31,7 +31,7 @@ index bee42ce7c1cb0f5ebd4890c02bc9c5dd727f7fd6..22f194956640b88c1d060b732e517f85
|
||||
this.fluidState = ((Block) this.owner).getFluidState(this.asState());
|
||||
this.isRandomlyTicking = ((Block) this.owner).isRandomlyTicking(this.asState());
|
||||
if (!this.getBlock().hasDynamicShape()) {
|
||||
@@ -832,7 +839,61 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -909,7 +916,61 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
@@ -93,7 +93,7 @@ index bee42ce7c1cb0f5ebd4890c02bc9c5dd727f7fd6..22f194956640b88c1d060b732e517f85
|
||||
|
||||
public Block getBlock() {
|
||||
return (Block) this.owner;
|
||||
@@ -1205,10 +1266,10 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -1305,10 +1366,10 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
final boolean propagatesSkylightDown;
|
||||
final int lightBlock;
|
||||
@Nullable
|
||||
@@ -1,22 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 18 May 2023 16:21:37 +0900
|
||||
Subject: [PATCH] Let Me Despawn Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index a1b55bb5431d1712fc06da0cf06857a986efeea0..116384c1fe27a868bcbe1d21f0b2723c73b9170c 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -131,4 +131,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ public LetMeDespawn letMeDespawn;
|
||||
+ public class LetMeDespawn extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = false;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 18 May 2023 16:42:40 +0900
|
||||
Subject: [PATCH] Implement Let Me Despawn
|
||||
|
||||
Original: frikinjay/let-me-despawn
|
||||
Copyright (C) 2023 frikinjay
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 3a365d7efd439cb8ddb99381bd714fb48896f4d2..b6d27332eb151bdf408909b241c493da54841c8e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -885,7 +885,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
public void checkDespawn() {
|
||||
if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
|
||||
this.discard();
|
||||
- } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
|
||||
+ } else if ((this.level.plazmaLevelConfiguration().letMeDespawn.enabled || !this.isPersistenceRequired()) && !this.requiresCustomPersistence()) {
|
||||
// Paper start - optimise checkDespawn
|
||||
Player entityhuman = this.level.findNearbyPlayer(this, level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard() + 1, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper
|
||||
if (entityhuman == null) {
|
||||
@@ -899,14 +899,14 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
int j = i * i;
|
||||
|
||||
if (d0 > (double) j && this.removeWhenFarAway(d0)) {
|
||||
- this.discard();
|
||||
+ this.dropEquipmentOnDespawn(); this.discard(); // Plazma - Let Me Despawn
|
||||
}
|
||||
|
||||
int k = this.level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - custom despawn distances
|
||||
int l = k * k;
|
||||
|
||||
if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {
|
||||
- this.discard();
|
||||
+ this.dropEquipmentOnDespawn(); this.discard(); // Plazma - Let Me Despawn
|
||||
} else if (d0 < (double) l) {
|
||||
this.noActionTime = 0;
|
||||
}
|
||||
@@ -917,6 +917,19 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Plazma start - Let Me Despawn
|
||||
+ private void dropEquipmentOnDespawn() {
|
||||
+ if (!this.level.plazmaLevelConfiguration().letMeDespawn.dropPickedUpItem()) return;
|
||||
+ for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) {
|
||||
+ ItemStack itemStack = this.getItemBySlot(equipmentSlot);
|
||||
+ if (!itemStack.isEmpty() && !EnchantmentHelper.hasVanishingCurse(itemStack)) {
|
||||
+ this.spawnAtLocation(itemStack);
|
||||
+ this.setItemSlot(equipmentSlot, ItemStack.EMPTY);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
@Override
|
||||
protected final void serverAiStep() {
|
||||
++this.noActionTime;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 116384c1fe27a868bcbe1d21f0b2723c73b9170c..97ffcd1c0e50ab21756404a483fa8d1f4b6579b1 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -136,6 +136,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public class LetMeDespawn extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = false;
|
||||
+ boolean dropPickedUpItem = true;
|
||||
+
|
||||
+ public boolean dropPickedUpItem() {
|
||||
+ return enabled && dropPickedUpItem;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
31
patches/server/0039-Skip-event-if-no-listeners.patch
Normal file
31
patches/server/0039-Skip-event-if-no-listeners.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 29 Jun 2023 05:49:26 +0000
|
||||
Subject: [PATCH] Skip event if no listeners
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..32305a34bcebd53aa523102a6da59bc2eb765055 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -36,15 +36,17 @@ class PaperEventManager {
|
||||
|
||||
// SimplePluginManager
|
||||
public void callEvent(@NotNull Event event) {
|
||||
+ // Plazma start
|
||||
+ HandlerList handlers = event.getHandlers();
|
||||
+ RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
+ if (listeners.length == 0) return;
|
||||
+ // Plazma end
|
||||
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
}
|
||||
|
||||
- HandlerList handlers = event.getHandlers();
|
||||
- RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
-
|
||||
for (RegisteredListener registration : listeners) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
continue;
|
||||
33
patches/server/0040-Optimize-spigot-event-bus.patch
Normal file
33
patches/server/0040-Optimize-spigot-event-bus.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 14:55:37 +0900
|
||||
Subject: [PATCH] Optimize-spigot-event-bus
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 32305a34bcebd53aa523102a6da59bc2eb765055..6feb88b90831ec7106c9d777bdfa68fa185f1b89 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -41,12 +41,17 @@ class PaperEventManager {
|
||||
RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
if (listeners.length == 0) return;
|
||||
// Plazma end
|
||||
- if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
+ // Plazma start - Optimize spigot event bus
|
||||
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
|
||||
+ final boolean isAsync = event.isAsynchronous();
|
||||
+ final boolean onPrimaryThread = this.server.isPrimaryThread();
|
||||
+ if (isAsync && onPrimaryThread) {
|
||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
+ } else if (!isAsync && !onPrimaryThread && !this.server.isStopping()) {
|
||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+ // Plazma end
|
||||
for (RegisteredListener registration : listeners) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
continue;
|
||||
File diff suppressed because it is too large
Load Diff
40
patches/server/0042-CarpetFixes-Configuration.patch
Normal file
40
patches/server/0042-CarpetFixes-Configuration.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:40:34 +0900
|
||||
Subject: [PATCH] CarpetFixes-Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 525fe30b6abba295709fca3d10f9b24679112571..49d5292697fdc6f23874557dd2db9d1fcda750f3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -76,4 +76,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public int timerTimeOut = 0;
|
||||
|
||||
}
|
||||
+
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 7d5bfd3a5aa5135596f3f1ae7c504a51b02798ef..b0deec445b5ea3cd3e4802eca04e99818b539bd8 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -131,4 +131,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
179
patches/server/0043-CarpetFixes-Optimizations-BiomeManager.patch
Normal file
179
patches/server/0043-CarpetFixes-Optimizations-BiomeManager.patch
Normal file
@@ -0,0 +1,179 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:53:37 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-BiomeManager
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
Optimized getBiome call: Reduce the number of calls to the mess of
|
||||
LinearCongruentialGenerator#next(long, long) which is pretty heavy on performance.
|
||||
|
||||
We are able to do this by skipping around 370 of 512 possible calls to getBiome() by predicting the outcome
|
||||
before doing the seed mixing. This seems to be around 25% - 75% faster depending on the use case.
|
||||
We can predict much faster than the seed mixing.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
index 5695c5116c8a338b2e41aafcb2dc9f2146856970..b2291854b9803fe01d40e8a1d76d6ff358cea114 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
@@ -12,6 +12,7 @@ public class BiomeManager {
|
||||
private static final int ZOOM_BITS = 2;
|
||||
private static final int ZOOM = 4;
|
||||
private static final int ZOOM_MASK = 3;
|
||||
+ private static final double maxOffset = 0.4500000001D; // Plazma - CarpetFixes
|
||||
private final BiomeManager.NoiseBiomeSource noiseBiomeSource;
|
||||
private final long biomeZoomSeed;
|
||||
|
||||
@@ -29,39 +30,104 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
public Holder<Biome> getBiome(BlockPos pos) {
|
||||
- int i = pos.getX() - 2;
|
||||
- int j = pos.getY() - 2;
|
||||
- int k = pos.getZ() - 2;
|
||||
- int l = i >> 2;
|
||||
- int m = j >> 2;
|
||||
- int n = k >> 2;
|
||||
- double d = (double)(i & 3) / 4.0D;
|
||||
- double e = (double)(j & 3) / 4.0D;
|
||||
- double f = (double)(k & 3) / 4.0D;
|
||||
- int o = 0;
|
||||
- double g = Double.POSITIVE_INFINITY;
|
||||
-
|
||||
- for(int p = 0; p < 8; ++p) {
|
||||
- boolean bl = (p & 4) == 0;
|
||||
- boolean bl2 = (p & 2) == 0;
|
||||
- boolean bl3 = (p & 1) == 0;
|
||||
- int q = bl ? l : l + 1;
|
||||
- int r = bl2 ? m : m + 1;
|
||||
- int s = bl3 ? n : n + 1;
|
||||
- double h = bl ? d : d - 1.0D;
|
||||
- double t = bl2 ? e : e - 1.0D;
|
||||
- double u = bl3 ? f : f - 1.0D;
|
||||
- double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||
- if (g > v) {
|
||||
- o = p;
|
||||
- g = v;
|
||||
+ // Plazma start - CarpetFixes - Optimized getBiome call
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedBiomeAccess()) {
|
||||
+ int xMinus2 = pos.getX() - 2;
|
||||
+ int yMinus2 = pos.getY() - 2;
|
||||
+ int zMinus2 = pos.getZ() - 2;
|
||||
+ int x = xMinus2 >> 2; // BlockPos to BiomePos
|
||||
+ int y = yMinus2 >> 2;
|
||||
+ int z = zMinus2 >> 2;
|
||||
+ double quartX = (double) (xMinus2 & 3) / 4.0D; // quartLocal divided by 4
|
||||
+ double quartY = (double) (yMinus2 & 3) / 4.0D; // 0/4, 1/4, 2/4, 3/4
|
||||
+ double quartZ = (double) (zMinus2 & 3) / 4.0D; // [0, 0.25, 0.5, 0.75]
|
||||
+ int smallestX = 0;
|
||||
+ double smallestDist = Double.POSITIVE_INFINITY;
|
||||
+ for (int biomeX = 0; biomeX < 8; ++biomeX) {
|
||||
+ boolean everyOtherQuad = (biomeX & 4) == 0; // 1 1 1 1 0 0 0 0
|
||||
+ boolean everyOtherPair = (biomeX & 2) == 0; // 1 1 0 0 1 1 0 0
|
||||
+ boolean everyOther = (biomeX & 1) == 0; // 1 0 1 0 1 0 1 0
|
||||
+ double quartXX = everyOtherQuad ? quartX : quartX - 1.0D; //[-1.0,-0.75,-0.5,-0.25,0.0,0.25,0.5,0.75]
|
||||
+ double quartYY = everyOtherPair ? quartY : quartY - 1.0D;
|
||||
+ double quartZZ = everyOther ? quartZ : quartZ - 1.0D;
|
||||
+
|
||||
+ //This code block is new
|
||||
+ double maxQuartYY = 0.0D, maxQuartZZ = 0.0D;
|
||||
+ if (biomeX != 0) {
|
||||
+ maxQuartYY = Mth.square(Math.max(quartYY + maxOffset, Math.abs(quartYY - maxOffset)));
|
||||
+ maxQuartZZ = Mth.square(Math.max(quartZZ + maxOffset, Math.abs(quartZZ - maxOffset)));
|
||||
+ double maxQuartXX = Mth.square(Math.max(quartXX + maxOffset, Math.abs(quartXX - maxOffset)));
|
||||
+ if (smallestDist < maxQuartXX + maxQuartYY + maxQuartZZ) continue;
|
||||
+ }
|
||||
+
|
||||
+ int xx = everyOtherQuad ? x : x + 1;
|
||||
+ int yy = everyOtherPair ? y : y + 1;
|
||||
+ int zz = everyOther ? z : z + 1;
|
||||
+
|
||||
+ //I transferred the code from method_38106 to here, so I could call continue halfway through
|
||||
+ long seed = LinearCongruentialGenerator.next(this.biomeZoomSeed, xx);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, xx);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||
+ double offsetX = getFiddle(seed);
|
||||
+ double sqrX = Mth.square(quartXX + offsetX);
|
||||
+ if (biomeX != 0 && smallestDist < sqrX + maxQuartYY + maxQuartZZ) continue; //skip the rest of the loop
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double offsetY = getFiddle(seed);
|
||||
+ double sqrY = Mth.square(quartYY + offsetY);
|
||||
+ if (biomeX != 0 && smallestDist < sqrX + sqrY + maxQuartZZ) continue; // skip the rest of the loop
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double offsetZ = getFiddle(seed);
|
||||
+ double biomeDist = sqrX + sqrY + Mth.square(quartZZ + offsetZ);
|
||||
+
|
||||
+ if (smallestDist > biomeDist) {
|
||||
+ smallestX = biomeX;
|
||||
+ smallestDist = biomeDist;
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
+ return this.noiseBiomeSource.getNoiseBiome(
|
||||
+ (smallestX & 4) == 0 ? x : x + 1,
|
||||
+ (smallestX & 2) == 0 ? y : y + 1,
|
||||
+ (smallestX & 1) == 0 ? z : z + 1
|
||||
+ );
|
||||
+ } else {
|
||||
+ int i = pos.getX() - 2;
|
||||
+ int j = pos.getY() - 2;
|
||||
+ int k = pos.getZ() - 2;
|
||||
+ int l = i >> 2;
|
||||
+ int m = j >> 2;
|
||||
+ int n = k >> 2;
|
||||
+ double d = (double) (i & 3) / 4.0D;
|
||||
+ double e = (double) (j & 3) / 4.0D;
|
||||
+ double f = (double) (k & 3) / 4.0D;
|
||||
+ int o = 0;
|
||||
+ double g = Double.POSITIVE_INFINITY;
|
||||
+
|
||||
+ for (int p = 0; p < 8; ++p) {
|
||||
+ boolean bl = (p & 4) == 0;
|
||||
+ boolean bl2 = (p & 2) == 0;
|
||||
+ boolean bl3 = (p & 1) == 0;
|
||||
+ int q = bl ? l : l + 1;
|
||||
+ int r = bl2 ? m : m + 1;
|
||||
+ int s = bl3 ? n : n + 1;
|
||||
+ double h = bl ? d : d - 1.0D;
|
||||
+ double t = bl2 ? e : e - 1.0D;
|
||||
+ double u = bl3 ? f : f - 1.0D;
|
||||
+ double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||
+ if (g > v) {
|
||||
+ o = p;
|
||||
+ g = v;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- int w = (o & 4) == 0 ? l : l + 1;
|
||||
- int x = (o & 2) == 0 ? m : m + 1;
|
||||
- int y = (o & 1) == 0 ? n : n + 1;
|
||||
- return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||
+ int w = (o & 4) == 0 ? l : l + 1;
|
||||
+ int x = (o & 2) == 0 ? m : m + 1;
|
||||
+ int y = (o & 1) == 0 ? n : n + 1;
|
||||
+ return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public Holder<Biome> getNoiseBiomeAtPosition(double x, double y, double z) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 49d5292697fdc6f23874557dd2db9d1fcda750f3..d329f77ab19ac781506c26909591fa4ae9dabb1e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -82,6 +82,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class CarpetFixes extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
+ boolean optimizedBiomeAccess = true;
|
||||
+
|
||||
+ public boolean optimizedBiomeAccess() {
|
||||
+ return enabled && optimizedBiomeAccess;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
127
patches/server/0044-CarpetFixes-Optimizations-Sheep.patch
Normal file
127
patches/server/0044-CarpetFixes-Optimizations-Sheep.patch
Normal file
@@ -0,0 +1,127 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 16:35:34 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-Sheep
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
The game determines the child sheep's color by getting a wool block from the parents, putting them in a crafting
|
||||
recipe, getting the output wool and getting the color from that.
|
||||
I don't know in what world we would consider a data-driven method with that much overhead as a smart idea. Instead,
|
||||
we used a prebaked list of all the possible colors and combinations, however this means that you can't use a
|
||||
datapack to change it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3b873dd76c0f10a7f29206e46c1bf9b230555170 100644
|
||||
--- a/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 {
|
||||
}
|
||||
|
||||
private DyeColor getOffspringColor(Animal firstParent, Animal secondParent) {
|
||||
+ // Plazma start - CarpetFixes - Optimized sheep child color
|
||||
DyeColor enumcolor = ((Sheep) firstParent).getColor();
|
||||
DyeColor enumcolor1 = ((Sheep) secondParent).getColor();
|
||||
- CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||
- Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level()).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||
- return recipecrafting.assemble(inventorycrafting, this.level().registryAccess());
|
||||
- }).map(ItemStack::getItem);
|
||||
-
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- optional = optional.filter(DyeItem.class::isInstance);
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||
- return this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
- });
|
||||
+ if (this.level().plazmaLevelConfiguration().carpetFixes.optimizedSheepChildColor()) {
|
||||
+ DyeColor col = org.plazmamc.plazma.util.CarpetFixesUtils.properDyeMixin(enumcolor, enumcolor1);
|
||||
+ if (col == null) col = this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
+ return col;
|
||||
+ } else {
|
||||
+ CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||
+ Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level()).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||
+ return recipecrafting.assemble(inventorycrafting, this.level().registryAccess());
|
||||
+ }).map(ItemStack::getItem);
|
||||
+
|
||||
+ Objects.requireNonNull(DyeItem.class);
|
||||
+ optional = optional.filter(DyeItem.class::isInstance);
|
||||
+ Objects.requireNonNull(DyeItem.class);
|
||||
+ return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||
+ return this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
+ });
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
private static CraftingContainer makeContainer(DyeColor firstColor, DyeColor secondColor) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..de1fa9ccb088597d059e8dc7fbb0c8788e3815fc 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public class CarpetFixes extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
+ boolean optimizedSheepChildColor = false;
|
||||
+
|
||||
+ public boolean optimizedSheepChildColor() {
|
||||
+ return enabled && optimizedSheepChildColor;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..aae3cf170bca4b3e6cdd0a964967dfafe2759f65
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||
@@ -0,0 +1,48 @@
|
||||
+package org.plazmamc.plazma.util;
|
||||
+
|
||||
+import net.minecraft.world.item.DyeColor;
|
||||
+
|
||||
+public class CarpetFixesUtils {
|
||||
+
|
||||
+ //If I was actually implementing this, the color values would have been binary in order for fast calculations.
|
||||
+ //Never do this in a production build, although this is better than using the RecipeManager xD
|
||||
+ public static DyeColor properDyeMixin(DyeColor col1, DyeColor col2) {
|
||||
+ if (col1.equals(col2)) return col1;
|
||||
+ switch(col1) {
|
||||
+ case WHITE -> {
|
||||
+ switch(col2) {
|
||||
+ case BLUE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GRAY -> {return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {return DyeColor.GRAY;}
|
||||
+ case GREEN -> {return DyeColor.LIME;}
|
||||
+ case RED -> {return DyeColor.PINK;}
|
||||
+ }
|
||||
+ }
|
||||
+ case BLUE -> {
|
||||
+ switch(col2) {
|
||||
+ case WHITE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GREEN -> {return DyeColor.CYAN;}
|
||||
+ case RED -> {return DyeColor.PURPLE;}
|
||||
+ }
|
||||
+ }
|
||||
+ case RED -> {
|
||||
+ switch(col2) {
|
||||
+ case YELLOW -> {return DyeColor.ORANGE;}
|
||||
+ case WHITE -> {return DyeColor.PINK;}
|
||||
+ case BLUE -> {return DyeColor.PURPLE;}
|
||||
+ }
|
||||
+ }case GREEN -> {
|
||||
+ switch(col2) {
|
||||
+ case BLUE -> {return DyeColor.CYAN;}
|
||||
+ case WHITE -> {return DyeColor.LIME;}
|
||||
+ }
|
||||
+ }
|
||||
+ case YELLOW -> {if (col2.equals(DyeColor.RED)) return DyeColor.ORANGE;}
|
||||
+ case PURPLE -> {if (col2.equals(DyeColor.PINK)) return DyeColor.MAGENTA;}
|
||||
+ case PINK -> {if (col2.equals(DyeColor.PURPLE)) return DyeColor.MAGENTA;}
|
||||
+ case GRAY -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.GRAY;}
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+}
|
||||
1367
patches/server/0045-Async-PathProcessing.patch
Normal file
1367
patches/server/0045-Async-PathProcessing.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Sat, 30 Dec 2023 21:50:18 +0900
|
||||
Subject: [PATCH] Paper-Add-another-slot-sanity-check
|
||||
|
||||
Backport of Paper ver/1.20.2 8493340
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 38d47fbcd49cc291040ea00470abeb982fe2714c..662f3eee6ff17e0b0191b1c59066465db818ed2b 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -600,7 +600,7 @@ public abstract class AbstractContainerMenu {
|
||||
int j2;
|
||||
|
||||
if (actionType == ClickType.SWAP) {
|
||||
- if (slotIndex < 0) return; // Paper
|
||||
+ if (slotIndex < 0 || button < 0) return; // Paper
|
||||
slot2 = (Slot) this.slots.get(slotIndex);
|
||||
itemstack1 = playerinventory.getItem(button);
|
||||
itemstack = slot2.getItem();
|
||||
@@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: jihwan0511 <cgjjj320@gmail.com>
|
||||
Date: Thu, 5 Jan 2024 06:04:37 +0100
|
||||
Subject: [PATCH] Validate ResourceLocation in NBT reading
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
index 18fad4f083862ace2bc56579883f548f6d697091..80083fed4b44b9d433925f09db83e559582109a1 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
@@ -230,8 +230,10 @@ public final class NbtUtils {
|
||||
if (!nbt.contains("Name", 8)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
- ResourceLocation resourceLocation = new ResourceLocation(nbt.getString("Name"));
|
||||
- Optional<? extends Holder<Block>> optional = blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation));
|
||||
+ // Paper start - Validate resource location
|
||||
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name"));
|
||||
+ Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
||||
+ // Paper end
|
||||
if (optional.isEmpty()) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index e0cf7771488ab0065708d68b4e8550b865af0ed4..a7fbd329ea6d36a46c00b4476c74e426dbbfe238 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -620,7 +620,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
||||
if (nbt.contains("DeathLootTable", 8)) {
|
||||
- this.lootTable = new ResourceLocation(nbt.getString("DeathLootTable"));
|
||||
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable")); // Paper - Validate ResourceLocation
|
||||
this.lootTableSeed = nbt.getLong("DeathLootTableSeed");
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 42ebd91196ae420eee57f4380abc558555457163..b61a367048c3d6dfef187fef35a5dc7471f891d0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -560,7 +560,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
this.setCritArrow(nbt.getBoolean("crit"));
|
||||
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
||||
if (nbt.contains("SoundEvent", 8)) {
|
||||
- this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(new ResourceLocation(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent());
|
||||
+ this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(ResourceLocation.tryParse(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent()); // Paper - Validate resource location
|
||||
}
|
||||
|
||||
this.setShotFromCrossbow(nbt.getBoolean("ShotFromCrossbow"));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
index 7529751afa2932fd16bc4591189b0358268a7b14..e2e1c7a017e82dc7299e5cd1783818e4f0319c0b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
@@ -67,7 +67,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
||||
default void readChestVehicleSaveData(CompoundTag nbt) {
|
||||
this.clearItemStacks();
|
||||
if (nbt.contains("LootTable", 8)) {
|
||||
- this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
|
||||
+ this.setLootTable(ResourceLocation.tryParse(nbt.getString("LootTable"))); // Paper - Validate ResourceLocation
|
||||
this.setLootTableSeed(nbt.getLong("LootTableSeed"));
|
||||
}
|
||||
|
||||
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