Compare commits
48 Commits
release-64
...
build/1.20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f0b4273b3 | ||
|
|
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 |
61
.github/workflows/build.yml
vendored
61
.github/workflows/build.yml
vendored
@@ -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
|
||||
|
||||
14
.github/workflows/close-invalid-prs.yml
vendored
14
.github/workflows/close-invalid-prs.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: Close invalid PRs
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ opened ]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && !startsWith(github.head_ref, 'ver/') }}
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: "Please do not open pull requests from the `master` branch, create a new branch instead."
|
||||
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 = 423c2af60ca5e9d18ac0bd955d0313efc693d2a3
|
||||
pufferfishCommit = a3c0a4d2f177d80283d03de52617732a7b493665
|
||||
purpurCommit = f6fd5f6ba6e672bfdbc79def7e8598d984ec8b3c
|
||||
pufferfishCommit = 040d0aa58ee6bdadc1cb040de2cb24e9f3bf4fb2
|
||||
|
||||
41
README.md
41
README.md
@@ -1,17 +1,15 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||

|
||||
|
||||
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
||||
|
||||
[](README.md)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
|
||||
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
||||
|
||||
[](LICENSE)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
|
||||
|
||||
[](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)
|
||||
@@ -19,30 +17,17 @@
|
||||
|
||||
</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.20.1/plazma-paperclip-1.20.1-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) |
|
||||
|
||||
109
build.gradle.kts
109
build.gradle.kts
@@ -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,38 +18,58 @@ 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")
|
||||
}
|
||||
|
||||
subprojects {
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
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 {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(17)
|
||||
}
|
||||
apply(plugin = "java")
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks {
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
minHeapSize = "2g"
|
||||
maxHeapSize = "2g"
|
||||
withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType<Test> {
|
||||
minHeapSize = "2g"
|
||||
maxHeapSize = "2g"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -83,28 +103,39 @@ paperweight {
|
||||
}
|
||||
}
|
||||
|
||||
val upstreamTask = tasks.register("updateUpstream") {
|
||||
val tempDir = layout.cacheDir("updateUpstream");
|
||||
val file = "gradle.properties";
|
||||
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/"
|
||||
)
|
||||
}
|
||||
|
||||
doFirst {
|
||||
val apiResponse = layout.cache.resolve("apiResponse.json");
|
||||
download.get().download("https://api.github.com/repos/PaperMC/Paper/commits/master", apiResponse);
|
||||
val latestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(apiResponse)["sha"].asString;
|
||||
register("updateUpstream") {
|
||||
val tempDir = layout.cacheDir("updateUpstream");
|
||||
val file = "gradle.properties";
|
||||
|
||||
copy {
|
||||
from(file)
|
||||
into(tempDir)
|
||||
filter { line: String ->
|
||||
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
|
||||
doFirst {
|
||||
val apiResponse = layout.cache.resolve("apiResponse.json");
|
||||
download.get().download("https://api.github.com/repos/PaperMC/Paper/commits/master", apiResponse);
|
||||
val latestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(apiResponse)["sha"].asString;
|
||||
|
||||
copy {
|
||||
from(file)
|
||||
into(tempDir)
|
||||
filter { line: String ->
|
||||
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(tempDir.file("gradle.properties"))
|
||||
into(project.file(file).parent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(tempDir.file("gradle.properties"))
|
||||
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.20.1-R0.1-SNAPSHOT
|
||||
|
||||
paperCommit = b4e3b3d1dd447bac4cbf478595c1ec320bc6dd4b
|
||||
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: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Tue, 9 Nov 2021 14:01:56 -0500
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 23 Sep 2023 10:20:55 +0000
|
||||
Subject: [PATCH] Pufferfish API Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 8045f92ffdfb4164bcbef99c41359590c45f9006..3676035ba011fb874ad6bb8995940d9bb2a0f0ae 100644
|
||||
index aed834334385ff3038ae69f3f34d129ad2507960..1ae1907f94a19c37b5820cfb3e9df3bd6bb1a49d 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
|
||||
@@ -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,7 +25,7 @@ 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 3676035ba011fb874ad6bb8995940d9bb2a0f0ae..0c557f34ed438980c6fd9d6a8bce7c1152468735 100644
|
||||
index 1ae1907f94a19c37b5820cfb3e9df3bd6bb1a49d..dfb989a18ab17fec3b8f0cf90ce2fc1048215265 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -109,6 +109,8 @@ tasks.jar {
|
||||
@@ -724,10 +724,10 @@ index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 6917931966377c51db88a3364997a110dd987970..bf39c6602cfca70a6352519fa26059cd79143cdd 100644
|
||||
index b8b97df069b28fa3cf32f1ad1f01f586a0cfbc78..63bf1d70cce9176f47a158a4a767b1bf38d60dbd 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3992,6 +3992,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -4008,6 +4008,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
@@ -1200,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 f9dd00210c1762a40259f823aeb8d8a5ddc78e3e..9193288438671409cc3cf92033ef7cb60d798b69 100644
|
||||
index f59cbc92334c7b7b20e593a58232fb3c4434f12b..d3d5d2c78cc4ee36beaa355ef7e61ef13332abab 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3271,4 +3271,143 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3273,4 +3273,143 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
@@ -1491,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;
|
||||
@@ -1513,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
|
||||
+
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 12:43:06 +0900
|
||||
Subject: [PATCH] Bump-Dependencies
|
||||
Date: Thu, 19 Oct 2023 22:10:35 +0900
|
||||
Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index c954a7776811c4127563a410e8080f5466e75024..8f6b683d2cf300724a024e3e76284d582c8ff3d6 100644
|
||||
index dfb989a18ab17fec3b8f0cf90ce2fc1048215265..90a85736247f1d5520a02b66e77405637c033fe9 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -11,8 +11,8 @@ java {
|
||||
@@ -19,7 +19,7 @@ index c954a7776811c4127563a410e8080f5466e75024..8f6b683d2cf300724a024e3e76284d58
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -27,16 +27,16 @@ configurations.api {
|
||||
@@ -27,8 +27,8 @@ configurations.api {
|
||||
|
||||
dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
@@ -28,19 +28,9 @@ index c954a7776811c4127563a410e8080f5466e75024..8f6b683d2cf300724a024e3e76284d58
|
||||
+ api("com.google.guava:guava:32.1.2-jre") // Plazma - Bump Dependencies
|
||||
+ api("com.google.code.gson:gson:2.10.1") // Plazma - Bump Dependencies
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
|
||||
- api("org.yaml:snakeyaml:2.0")
|
||||
+ api("org.yaml:snakeyaml:2.2") // Plazma - Bump Dependencies
|
||||
api("org.yaml:snakeyaml:2.0")
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
isTransitive = false // includes junit
|
||||
}
|
||||
- api("it.unimi.dsi:fastutil:8.5.6")
|
||||
+ api("it.unimi.dsi:fastutil:8.5.12") // Plazma - Bump Dependencies
|
||||
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
|
||||
apiAndDocs("net.kyori:adventure-api")
|
||||
apiAndDocs("net.kyori:adventure-text-minimessage")
|
||||
@@ -46,31 +46,31 @@ dependencies {
|
||||
@@ -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")
|
||||
@@ -72,15 +62,12 @@ index c954a7776811c4127563a410e8080f5466e75024..8f6b683d2cf300724a024e3e76284d58
|
||||
compileOnlyApi(checkerQual)
|
||||
testCompileOnly(checkerQual)
|
||||
// Paper end
|
||||
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - add mockito
|
||||
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - add mockito // Plazma - Bump Dependencies
|
||||
|
||||
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
- testImplementation("junit:junit:4.13.2")
|
||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
|
||||
+ testImplementation("junit:junit:4.13.2") // Plazma - Bump Dependencies
|
||||
testImplementation("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,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Mon, 19 Jun 2023 18:19:50 +0900
|
||||
Subject: [PATCH] Publish-Packages
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 1261dbb7a1c22860922afd0ac8c341aea3569df3..299ce875ee51294d87b31571b624a7991e0fdb1c 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -163,3 +163,22 @@ 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
|
||||
\ No newline at end of file
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Wed, 3 Feb 2021 23:02:38 -0600
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 23 Sep 2023 10:20:55 +0000
|
||||
Subject: [PATCH] Pufferfish Server Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
@@ -16,8 +16,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
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 fb98936bb8a5488db75d676c5bcb4060597fbbf8..f6cd7b910ce41a254e71bf0fcfe93c38abbb1445 100644
|
||||
index 7e0580bbd0a557c7bb269507a99d25db07bf31f1..4d89c46c7ee559acf986ff5081a42fe91cb5a257 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@@ -613,10 +616,10 @@ index 0000000000000000000000000000000000000000..020368da69b9a492155f6de6297f7473
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3d4bb28fe686a9ad2e4c0f75f21e6289c2ea5cf9
|
||||
index 0000000000000000000000000000000000000000..95d1a8a5b349f7849c040026bfa3469d03d92bfd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -0,0 +1,296 @@
|
||||
@@ -0,0 +1,295 @@
|
||||
+package gg.pufferfish.pufferfish;
|
||||
+
|
||||
+import gg.pufferfish.pufferfish.simd.SIMDDetection;
|
||||
@@ -901,7 +904,6 @@ index 0000000000000000000000000000000000000000..3d4bb28fe686a9ad2e4c0f75f21e6289
|
||||
+ "the ender dragon whenever a player places an end crystal.");
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ public static boolean disableMethodProfiler;
|
||||
+ public static boolean disableOutOfOrderChat;
|
||||
+ public static boolean suppressNullIdDisconnections;
|
||||
@@ -1518,7 +1520,7 @@ index c49802c936ae8e3f4dc1badd98414d96714ecd60..10501842887c1ffdb6bb667480682b71
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 65d947df910d60f478e7a449eb161e5105e2c0c9..3770ced0b227f7eea1f04d6afd5c14331f6a1480 100644
|
||||
index fb6cbcc4839aef7dc4bd4a49613f892b07aab353..d60ae9f8d3afe3e996a66331ee510cfa5841388c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -342,7 +342,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1530,7 +1532,7 @@ index 65d947df910d60f478e7a449eb161e5105e2c0c9..3770ced0b227f7eea1f04d6afd5c1433
|
||||
// Paper start - use distance map to optimise entity tracker
|
||||
this.playerEntityTrackerTrackMaps = new com.destroystokyo.paper.util.misc.PlayerAreaMap[TRACKING_RANGE_TYPES.length];
|
||||
this.entityTrackerTrackRanges = new int[TRACKING_RANGE_TYPES.length];
|
||||
@@ -1593,8 +1593,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1596,8 +1596,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
|
||||
}
|
||||
|
||||
@@ -1559,7 +1561,7 @@ index 65d947df910d60f478e7a449eb161e5105e2c0c9..3770ced0b227f7eea1f04d6afd5c1433
|
||||
Iterator iterator = this.entity.getIndirectPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1606,6 +1626,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1609,6 +1629,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
@@ -1781,7 +1783,7 @@ index 18aac3da3c88f33b1a71a5920a8daa27e9723913..eac31c3fcc9161711328588ac852fcae
|
||||
this.getRandomBlockPosition(j, 0, k, 15, blockposition);
|
||||
int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3c0651fa5a5db880202c9a3805a6455269c5f16d..776c7df81d2b71a5610fe90475f4e8044850beab 100644
|
||||
index ab58827001b3b42e44d7f701c390480fed1fa1f1..6cafc20ce006872bedd28a34db11204c3c1fef58 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1233,6 +1233,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1848,7 +1850,7 @@ index 241fec02e6869c638d3a160819b32173a081467b..6a8f9e8f5bf108674c47018def28906e
|
||||
public int getContainerSize() {
|
||||
return this.container1.getContainerSize() + this.container2.getContainerSize();
|
||||
diff --git a/src/main/java/net/minecraft/world/Container.java b/src/main/java/net/minecraft/world/Container.java
|
||||
index 04b1531572e8fff1e46fe1c94e7fc863841e0f66..47ddc42f2b63d9d3fae5ae6ea93d418352d76c94 100644
|
||||
index aee02acd4b2f2fdcb574c37c077fb57013ccb596..5a1c2d62c0e55c5bf16ca3e208dc486bf3b064b2 100644
|
||||
--- a/src/main/java/net/minecraft/world/Container.java
|
||||
+++ b/src/main/java/net/minecraft/world/Container.java
|
||||
@@ -3,6 +3,8 @@ package net.minecraft.world;
|
||||
@@ -2132,7 +2134,7 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..aa5cec6d56d7a8e80861aa4c9b4a74ca
|
||||
private String descriptionId;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd9806741222397c3072d7 100644
|
||||
index 78c98f38bc263664ea4cd344670243a7d372885c..d265a32bd273beed0e65e224e1c5f9c0bca7b3fb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -2148,11 +2150,11 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
- if (this.isInWall()) {
|
||||
+ if ((!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Pufferfish - optimize suffocation
|
||||
+ if (shouldCheckForSuffocation() && this.isInWall()) { // Pufferfish - optimize suffocation
|
||||
this.hurt(this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -1369,6 +1368,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1369,6 +1368,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -2163,12 +2165,16 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ public boolean shouldCheckForSuffocation() {
|
||||
+ return !gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F));
|
||||
+ }
|
||||
+ // Pufferfish end
|
||||
+
|
||||
@Override
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
@@ -1965,6 +1973,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1965,6 +1977,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
|
||||
@@ -2189,20 +2195,8 @@ index e11d7283662834047b2ff81a2fd25a4263792deb..e9a31314424d9db911cd980674122239
|
||||
public boolean onClimbable() {
|
||||
if (this.isSpectator()) {
|
||||
return false;
|
||||
@@ -3651,7 +3673,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
|
||||
|
||||
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
|
||||
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
|
||||
+ // Pufferfish start
|
||||
+ //return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
|
||||
+ return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ // Pufferfish end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..f6eb032897c6d5d16ab5c8c287e49e189c24571c 100644
|
||||
index a99d737f71277ea3082816c7a7fc47ab3a201d30..7e453b4c49975bb06cb080f3626545286b947ddc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -218,14 +218,16 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -2275,18 +2269,6 @@ index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..e283eb57c25f7de222f9d09dca851169
|
||||
}
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
index d4c91e0a0c64fcb7f1145de3f30134cb1f1f8ee6..fe502445a77afe7e3807afae48d7bf03f370e290 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -47,6 +47,7 @@ public class AcquirePoi {
|
||||
return false;
|
||||
} else {
|
||||
mutableLong.setValue(time + 20L + (long)world.getRandom().nextInt(20));
|
||||
+ if (entity.getNavigation().isStuck()) mutableLong.add(200); // Pufferfish - wait an additional 10s to check again if they're stuck
|
||||
PoiManager poiManager = world.getPoiManager();
|
||||
long2ObjectMap.long2ObjectEntrySet().removeIf((entry) -> {
|
||||
return !entry.getValue().isStillValid(time);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerPanicTrigger.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerPanicTrigger.java
|
||||
index 646d9a121d908a2fc3e4e302484dd5cd1bfc6804..e546ecdccde352502e26a8668eaaafe048d6e282 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerPanicTrigger.java
|
||||
@@ -2468,27 +2450,24 @@ index 247aca0b612f5079a0596350e8311c385df8ab1c..7f21d1d400c8a5615ed1a787dcb06803
|
||||
this.getBrain().tick((ServerLevel) this.level(), this);
|
||||
this.level().getProfiler().pop();
|
||||
this.level().getProfiler().push("goatActivityUpdate");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 52196431a6538872755344859a0454a0e50c3b6e..80fc7918cb294b0d88a293bd6a920441cb55c3ad 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -270,10 +270,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
if (entityitem.isMergable()) {
|
||||
// Paper Start - Fix items merging through walls
|
||||
if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) {
|
||||
+ // Pufferfish start - skip the allocations
|
||||
+ /*
|
||||
net.minecraft.world.level.ClipContext rayTrace = new net.minecraft.world.level.ClipContext(this.position(), entityitem.position(),
|
||||
net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, this);
|
||||
net.minecraft.world.phys.BlockHitResult rayTraceResult = this.level().clip(rayTrace);
|
||||
if (rayTraceResult.getType() == net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ */
|
||||
+ if (level().rayTraceDirect(this.position(), entityitem.position(), net.minecraft.world.phys.shapes.CollisionContext.of(this)) ==
|
||||
+ net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ // Pufferfish end
|
||||
}
|
||||
// Paper End
|
||||
this.tryToMerge(entityitem);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..c65ab566c6241dd6a44bd11a449ef0c4b2f6dc65 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -150,6 +150,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
this.bossEvent.setName(this.getDisplayName());
|
||||
}
|
||||
|
||||
+ // Pufferfish start - optimize suffocation
|
||||
+ @Override
|
||||
+ public boolean shouldCheckForSuffocation() {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Pufferfish end
|
||||
+
|
||||
@Override
|
||||
protected SoundEvent getAmbientSound() {
|
||||
return SoundEvents.WITHER_AMBIENT;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index b62457313a1e30aad0c5313d608667b5d3811455..410f10ad93935d1c078447a4596023f367a8e9b7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -2630,7 +2609,7 @@ index 96d664c28738d6090f7067761c2978dd1aa0fd0e..b1c24a02b87aca7b180a6efbce177f23
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 1b7cf6d06bdf36f146656727511a461f2520762e..459aee61b519a40d9136546c0d9356562f5757c8 100644
|
||||
index a90317100d32974e481e14476843f66997a2cf3a..cd0629581bae5f805842157af36c2d838e01bee3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -44,6 +44,36 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -2777,29 +2756,8 @@ index 2e60bdc44c33d434bfd9ca5bf8f75de799c6768c..565318c2afaa1661ed9963453a6354df
|
||||
StackedContents autorecipestackmanager = new StackedContents();
|
||||
autorecipestackmanager.initialize(this); // Paper - better exact choice recipes
|
||||
int i = 0;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
index 0e8746759752b692668886370181aa5db1fd0bb0..58e5ce2afabf480f5dfd9adf43f8fc12666861c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
@@ -68,6 +68,16 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Pufferfish start - broken down variant of below rayTraceBlock, used by World#rayTraceDirect
|
||||
+ default net.minecraft.world.phys.BlockHitResult.Type rayTraceBlockDirect(Vec3 vec3d, Vec3 vec3d1, BlockPos blockposition, BlockState iblockdata, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||
+ if (iblockdata.isAir()) return null; // Tuinity - optimise air cases
|
||||
+ VoxelShape voxelshape = ClipContext.Block.COLLIDER.get(iblockdata, this, blockposition, voxelshapecoll);
|
||||
+ net.minecraft.world.phys.BlockHitResult movingobjectpositionblock = this.clipWithInteractionOverride(vec3d, vec3d1, blockposition, voxelshape, iblockdata);
|
||||
+
|
||||
+ return movingobjectpositionblock == null ? null : movingobjectpositionblock.getType();
|
||||
+ }
|
||||
+ // Pufferfish end
|
||||
+
|
||||
// CraftBukkit start - moved block handling into separate method for use by Block#rayTrace
|
||||
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||
// Paper start - Prevent raytrace from loading chunks
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index f39ab10c5b0b8d86b579a5b683491204c51db70b..d8d4a1ca2eb062af8b2de4ab44503983587cdd77 100644
|
||||
index 7d54c79f46f99f5500e9cb1f486037cafb27ee3a..21c11ff8d5ae9bf97dfcf3118cabe678deb4c064 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -273,6 +273,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -2834,99 +2792,7 @@ index f39ab10c5b0b8d86b579a5b683491204c51db70b..d8d4a1ca2eb062af8b2de4ab44503983
|
||||
this.dimension = resourcekey;
|
||||
this.isClientSide = flag;
|
||||
if (dimensionmanager.coordinateScale() != 1.0D) {
|
||||
@@ -412,6 +430,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return null;
|
||||
}
|
||||
|
||||
+ // Pufferfish start - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace)
|
||||
+ public net.minecraft.world.phys.BlockHitResult.Type rayTraceDirect(net.minecraft.world.phys.Vec3 vec3d, net.minecraft.world.phys.Vec3 vec3d1, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||
+ // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions
|
||||
+ if (vec3d.equals(vec3d1)) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ double endX = Mth.lerp(-1.0E-7D, vec3d1.x, vec3d.x);
|
||||
+ double endY = Mth.lerp(-1.0E-7D, vec3d1.y, vec3d.y);
|
||||
+ double endZ = Mth.lerp(-1.0E-7D, vec3d1.z, vec3d.z);
|
||||
+
|
||||
+ double startX = Mth.lerp(-1.0E-7D, vec3d.x, vec3d1.x);
|
||||
+ double startY = Mth.lerp(-1.0E-7D, vec3d.y, vec3d1.y);
|
||||
+ double startZ = Mth.lerp(-1.0E-7D, vec3d.z, vec3d1.z);
|
||||
+
|
||||
+ int currentX = Mth.floor(startX);
|
||||
+ int currentY = Mth.floor(startY);
|
||||
+ int currentZ = Mth.floor(startZ);
|
||||
+
|
||||
+ BlockPos.MutableBlockPos currentBlock = new BlockPos.MutableBlockPos(currentX, currentY, currentZ);
|
||||
+
|
||||
+ LevelChunk chunk = this.getChunkIfLoaded(currentBlock);
|
||||
+ if (chunk == null) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ net.minecraft.world.phys.BlockHitResult.Type initialCheck = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||
+
|
||||
+ if (initialCheck != null) {
|
||||
+ return initialCheck;
|
||||
+ }
|
||||
+
|
||||
+ double diffX = endX - startX;
|
||||
+ double diffY = endY - startY;
|
||||
+ double diffZ = endZ - startZ;
|
||||
+
|
||||
+ int xDirection = Mth.sign(diffX);
|
||||
+ int yDirection = Mth.sign(diffY);
|
||||
+ int zDirection = Mth.sign(diffZ);
|
||||
+
|
||||
+ double normalizedX = xDirection == 0 ? Double.MAX_VALUE : (double) xDirection / diffX;
|
||||
+ double normalizedY = yDirection == 0 ? Double.MAX_VALUE : (double) yDirection / diffY;
|
||||
+ double normalizedZ = zDirection == 0 ? Double.MAX_VALUE : (double) zDirection / diffZ;
|
||||
+
|
||||
+ double normalizedXDirection = normalizedX * (xDirection > 0 ? 1.0D - Mth.frac(startX) : Mth.frac(startX));
|
||||
+ double normalizedYDirection = normalizedY * (yDirection > 0 ? 1.0D - Mth.frac(startY) : Mth.frac(startY));
|
||||
+ double normalizedZDirection = normalizedZ * (zDirection > 0 ? 1.0D - Mth.frac(startZ) : Mth.frac(startZ));
|
||||
+
|
||||
+ net.minecraft.world.phys.BlockHitResult.Type result;
|
||||
+
|
||||
+ do {
|
||||
+ if (normalizedXDirection > 1.0D && normalizedYDirection > 1.0D && normalizedZDirection > 1.0D) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ if (normalizedXDirection < normalizedYDirection) {
|
||||
+ if (normalizedXDirection < normalizedZDirection) {
|
||||
+ currentX += xDirection;
|
||||
+ normalizedXDirection += normalizedX;
|
||||
+ } else {
|
||||
+ currentZ += zDirection;
|
||||
+ normalizedZDirection += normalizedZ;
|
||||
+ }
|
||||
+ } else if (normalizedYDirection < normalizedZDirection) {
|
||||
+ currentY += yDirection;
|
||||
+ normalizedYDirection += normalizedY;
|
||||
+ } else {
|
||||
+ currentZ += zDirection;
|
||||
+ normalizedZDirection += normalizedZ;
|
||||
+ }
|
||||
+
|
||||
+ currentBlock.set(currentX, currentY, currentZ);
|
||||
+ if (chunk.getPos().x != currentBlock.getX() >> 4 || chunk.getPos().z != currentBlock.getZ() >> 4) {
|
||||
+ chunk = this.getChunkIfLoaded(currentBlock);
|
||||
+ if (chunk == null) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+ }
|
||||
+ result = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||
+ } while (result == null);
|
||||
+
|
||||
+ return result;
|
||||
+ }
|
||||
+ // Pufferfish end
|
||||
+
|
||||
public boolean isInWorldBounds(BlockPos pos) {
|
||||
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
|
||||
}
|
||||
@@ -919,13 +1022,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1003,13 +1021,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
try {
|
||||
tickConsumer.accept(entity);
|
||||
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
@@ -2942,7 +2808,7 @@ index f39ab10c5b0b8d86b579a5b683491204c51db70b..d8d4a1ca2eb062af8b2de4ab44503983
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
@@ -1380,6 +1483,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1464,6 +1482,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -3496,7 +3362,7 @@ index ebe65474a4a05ff1637d7f37ebcfe690af59def5..42142c512b12e5b269c19f1e821c50e7
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ec4b73321205b472f19fa5bd4ad95893020d1340..74c46cea456f4a736325892bb7b4d0f1b35b62cd 100644
|
||||
index 74d06790de674cbd230a0b14ac9a6b614c9f84ef..0f89716d1131178bd7ac927ef68337357139e2b7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -3508,7 +3374,7 @@ index ec4b73321205b472f19fa5bd4ad95893020d1340..74c46cea456f4a736325892bb7b4d0f1
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
@@ -1140,6 +1140,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1120,6 +1120,11 @@ public final class CraftServer implements Server {
|
||||
plugin.getPluginMeta().getDisplayName(),
|
||||
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
|
||||
));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 Jun 2022 09:18:57 -0500
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 23 Sep 2023 10:28:30 +0000
|
||||
Subject: [PATCH] Purpur Server Changes
|
||||
|
||||
Original: PurpurMC
|
||||
@@ -25,7 +25,7 @@ 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 f6cd7b910ce41a254e71bf0fcfe93c38abbb1445..139e2b17b899da6f0147bb8b4412e2e54e817be4 100644
|
||||
index 4d89c46c7ee559acf986ff5081a42fe91cb5a257..3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@@ -342,7 +342,7 @@ index fa56cd09102a89692b42f1d14257990508c5c720..f9251183df72ddc56662fd3f02acf216
|
||||
setListData(vector);
|
||||
}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 3d4bb28fe686a9ad2e4c0f75f21e6289c2ea5cf9..bff1b41501c040487583a5a279fc7800fc6aedca 100644
|
||||
index 95d1a8a5b349f7849c040026bfa3469d03d92bfd..3e36958365bc136516bafbaad0c168f7956406f1 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -28,6 +28,7 @@ public class PufferfishConfig {
|
||||
@@ -914,10 +914,10 @@ index d0a8092bf57a29ab7c00ec0ddf52a9fdb2a33267..defe5951938ce3a7b7f83017d4af36bb
|
||||
throw new IllegalStateException("Unable to get CCW facing of " + this);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
index 70aade6a8d36f8376cc567800258ea6fabb0607f..d44fde7e44cc862253fe577eb0753524ab7a39dc 100644
|
||||
index 8c2750de3be202122ccf9923a9fa32fcb8bdb743..7961a69d3e70a8ae1d74c732cd97a9cbd824a8d0 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -1186,6 +1186,23 @@ public interface DispenseItemBehavior {
|
||||
@@ -1187,6 +1187,23 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -955,7 +955,7 @@ index 9b0049dfeaec9b688bf276f2ac2b18943b5696b2..d7563904232353cbf3b9255cedfb7592
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index cf20f0983fc25b26cf92b9d3a28746b1909fc56b..89c1b69ddeb420c2fbda5f588e7c9a467a76089d 100644
|
||||
index 52cb6476604c98465f81ff9e8d8344d7536a8868..13144ea01bc27db95a13b267d39529b012a4c9c4 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -579,11 +579,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -1941,10 +1941,10 @@ index dd9f611efc95f7d06fd3011fedd5d0317b1d0a85..be7b3fe2dc84493dcde9e185717b0b7c
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 3770ced0b227f7eea1f04d6afd5c14331f6a1480..319c469c20f3cb4f6d61425bfa6d98b55b55c4d6 100644
|
||||
index d60ae9f8d3afe3e996a66331ee510cfa5841388c..3a7c694ff0e248df3f4d168a5e2e883c0e3cb167 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -637,20 +637,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -640,20 +640,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -1973,7 +1973,7 @@ index 3770ced0b227f7eea1f04d6afd5c14331f6a1480..319c469c20f3cb4f6d61425bfa6d98b5
|
||||
}
|
||||
|
||||
public boolean hasWork() {
|
||||
@@ -1269,24 +1269,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1272,24 +1272,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
// Paper start - optimised tracker
|
||||
private final void processTrackQueue() {
|
||||
@@ -2002,7 +2002,7 @@ index 3770ced0b227f7eea1f04d6afd5c14331f6a1480..319c469c20f3cb4f6d61425bfa6d98b5
|
||||
}
|
||||
}
|
||||
// Paper end - optimised tracker
|
||||
@@ -1301,7 +1301,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1304,7 +1304,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
List<ServerPlayer> list = Lists.newArrayList();
|
||||
List<ServerPlayer> list1 = this.level.players();
|
||||
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
||||
@@ -2011,7 +2011,7 @@ index 3770ced0b227f7eea1f04d6afd5c14331f6a1480..319c469c20f3cb4f6d61425bfa6d98b5
|
||||
|
||||
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
||||
|
||||
@@ -1326,17 +1326,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1329,17 +1329,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
||||
}
|
||||
}
|
||||
@@ -3158,7 +3158,7 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..acd7468ee3c86d3456e96e4ec3d7e6a4
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
hasSetFarWarned = true;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0bd757eec 100644
|
||||
index 6cafc20ce006872bedd28a34db11204c3c1fef58..255b422078880b46dfa6f5140f6c92fef057d09e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -265,6 +265,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3449,16 +3449,16 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
}
|
||||
} while (!this.lastChatTimeStamp.compareAndSet(instant1, timestamp));
|
||||
|
||||
@@ -2558,7 +2650,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
}
|
||||
// Paper End
|
||||
@@ -2537,7 +2629,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
public void handleCommand(String s) { // Paper - private -> public
|
||||
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
|
||||
- co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper
|
||||
+ //co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper // Purpur
|
||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
||||
|
||||
@@ -2568,7 +2660,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2547,7 +2639,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@@ -3467,7 +3467,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2581,7 +2673,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2560,7 +2652,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
return;
|
||||
} finally {
|
||||
@@ -3476,7 +3476,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -2857,6 +2949,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2836,6 +2928,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
AABB axisalignedbb = entity.getBoundingBox();
|
||||
|
||||
if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) {
|
||||
@@ -3484,7 +3484,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
|
||||
@@ -2870,6 +2963,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2849,6 +2942,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
@@ -3493,7 +3493,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859a
|
||||
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
|
||||
entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it.
|
||||
@@ -3450,6 +3545,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3429,6 +3524,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3506,7 +3506,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
|
||||
boolean flag1 = packet.getSlotNum() >= 1 && packet.getSlotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||
@@ -3545,6 +3646,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3524,6 +3625,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||
@@ -3523,7 +3523,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
|
||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||
int i = (int) (Util.getMillis() - this.keepAliveTime);
|
||||
@@ -3595,6 +3706,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3574,6 +3685,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
|
||||
|
||||
private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
|
||||
@@ -3531,7 +3531,7 @@ index 776c7df81d2b71a5610fe90475f4e8044850beab..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
@@ -3619,6 +3731,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3598,6 +3710,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
|
||||
this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
|
||||
}
|
||||
@@ -4794,7 +4794,7 @@ index 759713f7c646aaf1a918c87a2834a1d405385dad..43cdda0cb26c5d5cc9025199eb71673d
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3e197d810 100644
|
||||
index d265a32bd273beed0e65e224e1c5f9c0bca7b3fb..49906b4dc8392eee592215d0b4cba85267a875fc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -218,9 +218,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4880,15 +4880,6 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
if (this.fireImmune() || this.level().isClientSide) {
|
||||
this.clearFire();
|
||||
}
|
||||
@@ -413,7 +419,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
- if ((!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Pufferfish - optimize suffocation
|
||||
+ if (shouldCheckForSuffocation() && this.isInWall()) { // Pufferfish - optimize suffocation // Purpur
|
||||
this.hurt(this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -422,6 +428,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
double d1 = this.level().getWorldBorder().getDamagePerBlock();
|
||||
|
||||
@@ -4986,19 +4977,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
@@ -1376,6 +1412,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return true;
|
||||
}
|
||||
// Pufferfish end
|
||||
+ // Purpur start
|
||||
+ public boolean shouldCheckForSuffocation() {
|
||||
+ return (!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F)));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
@Override
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
@@ -1467,13 +1508,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1471,13 +1507,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (entity1 instanceof net.minecraft.world.entity.player.Player) {
|
||||
net.minecraft.world.entity.player.Player entityhuman = (net.minecraft.world.entity.player.Player) entity1;
|
||||
|
||||
@@ -5014,7 +4993,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
LivingEntity entityliving2 = entitywolf.getOwner();
|
||||
|
||||
if (entityliving2 instanceof net.minecraft.world.entity.player.Player) {
|
||||
@@ -1584,6 +1625,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1588,6 +1624,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5033,7 +5012,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||
EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
||||
event.setCancelled(itemstack == null);
|
||||
@@ -1750,7 +1803,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1754,7 +1802,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = false;
|
||||
|
||||
if (this.dead && adversary instanceof WitherBoss) { // Paper
|
||||
@@ -5042,7 +5021,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
BlockPos blockposition = this.blockPosition();
|
||||
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||
|
||||
@@ -1796,6 +1849,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1800,6 +1848,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.dropEquipment(); // CraftBukkit - from below
|
||||
if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
@@ -5050,7 +5029,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
this.dropFromLootTable(source, flag);
|
||||
// Paper start
|
||||
final boolean prev = this.clearEquipmentSlots;
|
||||
@@ -1804,6 +1858,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1808,6 +1857,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
// Paper end
|
||||
this.dropCustomDeathLoot(source, i, flag);
|
||||
this.clearEquipmentSlots = prev; // Paper
|
||||
@@ -5058,7 +5037,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
}
|
||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> {
|
||||
@@ -2050,7 +2105,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2054,7 +2104,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP);
|
||||
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
||||
|
||||
@@ -5067,7 +5046,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2273,6 +2328,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2277,6 +2327,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5088,7 +5067,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
if (f > 0 || !human) {
|
||||
if (human) {
|
||||
// PAIL: Be sure to drag all this code from the EntityHuman subclass each update.
|
||||
@@ -2489,7 +2558,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2493,7 +2557,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@Override
|
||||
protected void onBelowWorld() {
|
||||
@@ -5097,7 +5076,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
@@ -2686,7 +2755,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2690,7 +2754,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected long lastJumpTime = 0L; // Paper
|
||||
@@ -5106,7 +5085,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
Vec3 vec3d = this.getDeltaMovement();
|
||||
// Paper start
|
||||
long time = System.nanoTime();
|
||||
@@ -2838,6 +2907,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2842,6 +2906,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
if (f3 > 0.0F) {
|
||||
this.playSound(this.getFallDamageSound((int) f3), 1.0F, 1.0F);
|
||||
@@ -5114,7 +5093,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
this.hurt(this.damageSources().flyIntoWall(), f3);
|
||||
}
|
||||
}
|
||||
@@ -3059,10 +3129,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3063,10 +3128,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
this.run += (f3 - this.run) * 0.3F;
|
||||
@@ -5128,7 +5107,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
|
||||
// Paper start - stop large pitch and yaw changes from crashing the server
|
||||
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F;
|
||||
@@ -3074,7 +3144,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3078,7 +3143,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
|
||||
// Paper end
|
||||
|
||||
@@ -5137,7 +5116,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
this.animStep += f2;
|
||||
if (this.isFallFlying()) {
|
||||
++this.fallFlyTicks;
|
||||
@@ -3363,19 +3433,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3367,19 +3432,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
this.setDeltaMovement(d4, d5, d6);
|
||||
@@ -5162,7 +5141,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
if (this.jumping && this.isAffectedByFluids()) {
|
||||
double d7;
|
||||
|
||||
@@ -3402,8 +3472,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3406,8 +3471,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.noJumpDelay = 0;
|
||||
}
|
||||
|
||||
@@ -5173,7 +5152,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
this.xxa *= 0.98F;
|
||||
this.zza *= 0.98F;
|
||||
this.updateFallFlying();
|
||||
@@ -3430,8 +3500,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3434,8 +3499,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.travel(vec3d1);
|
||||
}
|
||||
|
||||
@@ -5184,7 +5163,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
if (!this.level().isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API
|
||||
int i = this.getTicksFrozen();
|
||||
|
||||
@@ -3448,18 +3518,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3452,18 +3517,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.hurt(this.damageSources().freeze(), 1.0F);
|
||||
}
|
||||
|
||||
@@ -5210,7 +5189,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
|
||||
Location to = new Location (this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
|
||||
@@ -3469,12 +3541,48 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3473,12 +3540,48 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
||||
}
|
||||
}
|
||||
@@ -5259,7 +5238,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
}
|
||||
|
||||
public boolean isSensitiveToWater() {
|
||||
@@ -3495,7 +3603,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3499,7 +3602,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
int j = i / 10;
|
||||
|
||||
if (j % 2 == 0) {
|
||||
@@ -5278,7 +5257,7 @@ index e9a31314424d9db911cd9806741222397c3072d7..4cd04661b39a7055f5767a3dff88f9a3
|
||||
});
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd18f62f89 100644
|
||||
index 7e453b4c49975bb06cb080f3626545286b947ddc..5dd0c925af627f7159289dc1e3e79bc593c421f2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -65,6 +65,7 @@ import net.minecraft.world.item.ProjectileWeaponItem;
|
||||
@@ -5461,7 +5440,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
this.sendDebugPackets();
|
||||
}
|
||||
|
||||
@@ -1166,6 +1195,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1173,6 +1202,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
}
|
||||
|
||||
@@ -5474,7 +5453,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
@Nullable
|
||||
public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel) {
|
||||
switch (equipmentSlot) {
|
||||
@@ -1260,7 +1295,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1267,7 +1302,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
RandomSource randomsource = world.getRandom();
|
||||
|
||||
this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.MULTIPLY_BASE));
|
||||
@@ -5483,7 +5462,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
this.setLeftHanded(true);
|
||||
} else {
|
||||
this.setLeftHanded(false);
|
||||
@@ -1308,6 +1343,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1315,6 +1350,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
if (!this.isAlive()) {
|
||||
return InteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == player) {
|
||||
@@ -5491,7 +5470,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
// Paper start - drop leash variable
|
||||
org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.getAbilities().instabuild);
|
||||
@@ -1381,7 +1417,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1388,7 +1424,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
protected void onOffspringSpawnedFromEgg(Player player, Mob child) {}
|
||||
|
||||
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
@@ -5500,7 +5479,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
}
|
||||
|
||||
public boolean isWithinRestriction() {
|
||||
@@ -1686,6 +1722,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1693,6 +1729,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.setLastHurtMob(target);
|
||||
}
|
||||
|
||||
@@ -5508,7 +5487,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -1702,17 +1739,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1709,17 +1746,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
|
||||
public boolean isSunBurnTick() {
|
||||
@@ -5527,7 +5506,7 @@ index f6eb032897c6d5d16ab5c8c287e49e189c24571c..19d9d3a9f634631e2ec5a6fa7f2cd9dd
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1759,4 +1786,56 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1766,4 +1793,56 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
return itemmonsteregg == null ? null : new ItemStack(itemmonsteregg);
|
||||
}
|
||||
@@ -10760,7 +10739,7 @@ index a24ae93efcdb2da5782d342c7697a1bb253400c7..ec595b74a6376adb65840035cdaa7502
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879e0d544b5 100644
|
||||
index c65ab566c6241dd6a44bd11a449ef0c4b2f6dc65..c94a1b75593ad01e7f79fdc84818ea8ec269e124 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -84,20 +84,59 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -10954,21 +10933,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
|
||||
}
|
||||
|
||||
@@ -150,6 +291,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
this.bossEvent.setName(this.getDisplayName());
|
||||
}
|
||||
|
||||
+ // Purpur start - optimize suffocation
|
||||
+ @Override
|
||||
+ public boolean shouldCheckForSuffocation() {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected SoundEvent getAmbientSound() {
|
||||
return SoundEvents.WITHER_AMBIENT;
|
||||
@@ -256,6 +404,16 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -263,6 +404,16 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
@@ -10985,7 +10950,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
int i;
|
||||
|
||||
if (this.getInvulnerableTicks() > 0) {
|
||||
@@ -272,7 +430,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -279,7 +430,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -10994,7 +10959,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
// CraftBukkit start - Use relative location for far away sounds
|
||||
// this.level().globalLevelEvent(1023, new BlockPosition(this), 0);
|
||||
int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16;
|
||||
@@ -296,7 +454,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -303,7 +454,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
this.setInvulnerableTicks(i);
|
||||
if (this.tickCount % 10 == 0) {
|
||||
@@ -11003,7 +10968,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -356,7 +514,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -363,7 +514,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
if (this.destroyBlocksTick > 0) {
|
||||
--this.destroyBlocksTick;
|
||||
@@ -11012,7 +10977,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
i = Mth.floor(this.getY());
|
||||
j = Mth.floor(this.getX());
|
||||
int i1 = Mth.floor(this.getZ());
|
||||
@@ -389,8 +547,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -396,8 +547,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11025,7 +10990,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
}
|
||||
|
||||
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
|
||||
@@ -576,11 +736,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -583,11 +736,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
}
|
||||
|
||||
public int getAlternativeTarget(int headIndex) {
|
||||
@@ -11039,7 +11004,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..4952a7daa1aad68e3ba53123093cd879
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -595,6 +755,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -602,6 +755,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
@Override
|
||||
protected boolean canRide(Entity entity) {
|
||||
@@ -11178,7 +11143,7 @@ index 18eaccb39a4c81338a8cbebe3de03934913ac2a4..7ad5583f05b608d5a34a33fb77c5bf91
|
||||
}
|
||||
// Paper end - fix sand duping
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 80fc7918cb294b0d88a293bd6a920441cb55c3ad..d045877bfb0f364a43c8448cad21cc39d0565964 100644
|
||||
index d39f31e7cf315c7cdc1daab28164380e44dd8341..028b83b8e835cfdad19ae9edad76c524b98ead7f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -56,6 +56,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -11194,23 +11159,25 @@ index 80fc7918cb294b0d88a293bd6a920441cb55c3ad..d045877bfb0f364a43c8448cad21cc39
|
||||
|
||||
public ItemEntity(EntityType<? extends ItemEntity> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -358,6 +364,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
return false;
|
||||
} else if (!this.getItem().getItem().canBeHurtBy(source)) {
|
||||
return false;
|
||||
@@ -346,7 +352,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
|
||||
@Override
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
- if (this.isInvulnerableTo(source)) {
|
||||
+ // Purpur start
|
||||
+ } else if (
|
||||
+ (immuneToCactus && source.is(net.minecraft.world.damagesource.DamageTypes.CACTUS)) ||
|
||||
+ (immuneToFire && (source.is(DamageTypeTags.IS_FIRE) && source.is(net.minecraft.world.damagesource.DamageTypes.IN_FIRE)) ||
|
||||
+ (immuneToLightning && source.is(net.minecraft.world.damagesource.DamageTypes.LIGHTNING_BOLT)) ||
|
||||
+ (immuneToExplosion && source.is(DamageTypeTags.IS_EXPLOSION)))
|
||||
+ if (
|
||||
+ (immuneToCactus && source.is(net.minecraft.world.damagesource.DamageTypes.CACTUS)) ||
|
||||
+ (immuneToFire && (source.is(DamageTypeTags.IS_FIRE) || source.is(net.minecraft.world.damagesource.DamageTypes.ON_FIRE) || source.is(net.minecraft.world.damagesource.DamageTypes.IN_FIRE))) ||
|
||||
+ (immuneToLightning && source.is(net.minecraft.world.damagesource.DamageTypes.LIGHTNING_BOLT)) ||
|
||||
+ (immuneToExplosion && source.is(DamageTypeTags.IS_EXPLOSION))
|
||||
+ ) {
|
||||
+ return false;
|
||||
+ } else if (this.isInvulnerableTo(source)) {
|
||||
+ // Purpur end
|
||||
} else if (this.level().isClientSide) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -555,6 +570,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
return false;
|
||||
} else if (!this.getItem().isEmpty() && this.getItem().is(Items.NETHER_STAR) && source.is(DamageTypeTags.IS_EXPLOSION)) {
|
||||
return false;
|
||||
@@ -549,6 +564,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
// com.google.common.base.Preconditions.checkArgument(!stack.isEmpty(), "Cannot drop air"); // CraftBukkit // Paper - Remove check
|
||||
this.getEntityData().set(ItemEntity.DATA_ITEM, stack);
|
||||
this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper
|
||||
@@ -11258,7 +11225,7 @@ index 4ce3e69970dd9eb251d0538a2d233ca30e9e5e47..afc65b8bb7e7f7f70a25f2d869412ed3
|
||||
+ // Purpur end - Shears can defuse TNT
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index 9ca1e9d95e62929c0015d5ca2c2f9c70e421842e..dd84433a988712da9d799cbda2487a902315fb92 100644
|
||||
index 26c7b2f18f21b04529f989b345c385693d98c903..917648c2cc52790f40123b27b1cafa3fc3ba4b3f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -66,16 +66,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@@ -15725,10 +15692,10 @@ index 0bbe853f7df93f9dcd2b21d762939f8b6be069aa..7db9844083703944f59e112c6dc5e1a5
|
||||
public void tick() {
|
||||
super.tick();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 459aee61b519a40d9136546c0d9356562f5757c8..134b5758e5c6335a52ffb2703c3fa98dc792948e 100644
|
||||
index cd0629581bae5f805842157af36c2d838e01bee3..b0a559dfefac693bda8692a30fbaa5ac8062ef27 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -319,6 +319,6 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -326,6 +326,6 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
public boolean mayInteract(Level world, BlockPos pos) {
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@@ -16136,7 +16103,7 @@ index b16d9e2eaa589f19c563ee70b1a56d67dbcdecb0..71beab673f04cd051c46ea37f8c84731
|
||||
public static final FoodProperties BAKED_POTATO = (new FoodProperties.Builder()).nutrition(5).saturationMod(0.6F).build();
|
||||
public static final FoodProperties BEEF = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.3F).meat().build();
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 706b354ac9a1a6a4a1e61b2a109180d1dd22bbbd..9ca261c9f21279558961649cb4849ac379d67573 100644
|
||||
index 7bba845462813615224f48322c51c7b480adcaa7..38d47fbcd49cc291040ea00470abeb982fe2714c 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -76,6 +76,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -16381,7 +16348,7 @@ index 0dbfd23bbfc6ad203f048142f8c90ef741849fe1..9a80427d2bb470b6b1638e59aba57216
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
index 93e8316f9d64625dcc4df0644a2187bcc884ef65..1711406996ec4a9cb7b1838bd2446e5cf802e043 100644
|
||||
index 496c3fcf49043bba4d249e1c05aac7d7b4897ea8..f0a84889103cb605d3b1496f03d855848a5f5067 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
@@ -38,6 +38,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
|
||||
@@ -16447,7 +16414,7 @@ index 93e8316f9d64625dcc4df0644a2187bcc884ef65..1711406996ec4a9cb7b1838bd2446e5c
|
||||
});
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
index b56766ff0e61691294b40ea8c2370940c0e8b640..23a8522b80475ad29ffb4afd2f4836acda2538e3 100644
|
||||
index a21eadcdfbdc4be803c5793bc97996db3e706071..3b721092a7a73472756064e0eb91d3220fdc4bc8 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
|
||||
@@ -95,9 +95,11 @@ public class GrindstoneMenu extends AbstractContainerMenu {
|
||||
@@ -16543,10 +16510,10 @@ index c549618421c5d077c3d977d8d2064eca2acc438a..5972fa434847d24fa98b7895fd8386d2
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
index ff770b9ce68a62418de0c7ed389650626fa1dcb2..102739c0089ff3f6b3432f954304d43a3dfebc35 100644
|
||||
index c2cf5a8e788637c6264cf43d712a5be223ff1cc5..a578882b64c581ef4f47fa483a9f2988cfa4c8cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
@@ -177,7 +177,9 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
|
||||
@@ -178,7 +178,9 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -17011,7 +16978,7 @@ index 180aec596110309aade13d2080f8824d152b07cb..552c31c0f3746dd35388395036e70a92
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce37cc5656 100644
|
||||
index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..50ea2bc3f785dabc686162c895590b7d7f15a93d 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -113,6 +113,7 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
@@ -17022,7 +16989,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
return instance.group(BuiltInRegistries.ITEM.byNameCodec().fieldOf("id").forGetter(ItemStack::getItem), Codec.INT.fieldOf("Count").forGetter(ItemStack::getCount), CompoundTag.CODEC.optionalFieldOf("tag").forGetter((itemstack) -> {
|
||||
return Optional.ofNullable(itemstack.getTag());
|
||||
@@ -426,6 +427,7 @@ public final class ItemStack {
|
||||
@@ -427,6 +428,7 @@ public final class ItemStack {
|
||||
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
|
||||
for (BlockState blockstate : blocks) {
|
||||
blockstate.update(true, false);
|
||||
@@ -17030,7 +16997,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
}
|
||||
world.preventPoiUpdated = false;
|
||||
|
||||
@@ -455,6 +457,7 @@ public final class ItemStack {
|
||||
@@ -456,6 +458,7 @@ public final class ItemStack {
|
||||
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
||||
block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, context); // Paper - pass context
|
||||
}
|
||||
@@ -17038,7 +17005,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
|
||||
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
|
||||
}
|
||||
@@ -583,6 +586,16 @@ public final class ItemStack {
|
||||
@@ -584,6 +587,16 @@ public final class ItemStack {
|
||||
return this.isDamageableItem() && this.getDamageValue() > 0;
|
||||
}
|
||||
|
||||
@@ -17055,7 +17022,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
public int getDamageValue() {
|
||||
return this.tag == null ? 0 : this.tag.getInt("Damage");
|
||||
}
|
||||
@@ -602,7 +615,7 @@ public final class ItemStack {
|
||||
@@ -603,7 +616,7 @@ public final class ItemStack {
|
||||
int j;
|
||||
|
||||
if (amount > 0) {
|
||||
@@ -17064,7 +17031,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
int k = 0;
|
||||
|
||||
for (int l = 0; j > 0 && l < amount; ++l) {
|
||||
@@ -657,6 +670,12 @@ public final class ItemStack {
|
||||
@@ -658,6 +671,12 @@ public final class ItemStack {
|
||||
if (this.hurt(amount, entity.getRandom(), entity /*instanceof ServerPlayer ? (ServerPlayer) entity : null*/)) { // Paper - pass LivingEntity for EntityItemDamageEvent
|
||||
breakCallback.accept(entity);
|
||||
Item item = this.getItem();
|
||||
@@ -17077,7 +17044,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
// CraftBukkit start - Check for item breaking
|
||||
if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((net.minecraft.world.entity.player.Player) entity, this);
|
||||
@@ -1183,7 +1202,7 @@ public final class ItemStack {
|
||||
@@ -1184,7 +1203,7 @@ public final class ItemStack {
|
||||
|
||||
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
|
||||
|
||||
@@ -17086,7 +17053,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..7e68596e28db88213e9352f798c5a4ce
|
||||
processEnchantOrder(this.tag); // Paper
|
||||
}
|
||||
|
||||
@@ -1191,6 +1210,12 @@ public final class ItemStack {
|
||||
@@ -1192,6 +1211,12 @@ public final class ItemStack {
|
||||
return this.tag != null && this.tag.contains("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
|
||||
}
|
||||
|
||||
@@ -17591,7 +17558,7 @@ index 8f97c9df726ac20cfce7bdddd5dd4f8c5aa76c35..4932374ab9a3d8582fb0ef024d817ad8
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0cb805b6d 100644
|
||||
index 21c11ff8d5ae9bf97dfcf3118cabe678deb4c064..713a091b8083e46b395311889c2a1482279c27ec 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -17670,7 +17637,7 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
@@ -967,18 +1013,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -966,18 +1012,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -17694,7 +17661,7 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
// Spigot start
|
||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||
int tilesThisCycle = 0;
|
||||
@@ -1011,10 +1057,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1010,10 +1056,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove);
|
||||
|
||||
@@ -17707,7 +17674,7 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
spigotConfig.currentPrimedTnt = 0; // Spigot
|
||||
}
|
||||
|
||||
@@ -1207,7 +1253,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1206,7 +1252,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||
@@ -17716,7 +17683,7 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
|
||||
return list;
|
||||
@@ -1226,7 +1272,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1225,7 +1271,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
|
||||
@@ -17725,7 +17692,7 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
// Paper start - optimise this call
|
||||
//TODO use limit
|
||||
if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
|
||||
@@ -1483,7 +1529,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1482,7 +1528,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -17734,8 +17701,8 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..bdb32964524cb2a4398b8d3bedfb03b0
|
||||
return (ProfilerFiller) this.profiler.get();
|
||||
}
|
||||
|
||||
@@ -1574,4 +1620,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return null;
|
||||
@@ -1584,4 +1630,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
@@ -19359,7 +19326,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..e38a0adf5463c48311ad08b8d2e5b5c2
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index 3b866e2c20ee7bfc981ff09b29065530de993778..2e6220c5a6c871401ce9734adfab710dcf86ad44 100644
|
||||
index 5c951ef93fe4cf4f085df86b0cefc02bc2610ab9..2979c1eceaac79a82da19eba5d8fb1db6537ff45 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -84,6 +84,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -20389,7 +20356,7 @@ index c1b874cd6e0498fce3cd53fdbaca30d290e004d7..23087d511b609693f0bb06cbaac8b6cf
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103d83ad96c 100644
|
||||
index 0f89716d1131178bd7ac927ef68337357139e2b7..b21bc96232d0fd52e5dae7fa1c413714f8ddd7ee 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -20420,9 +20387,9 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
+ });
|
||||
+ // Purpur end
|
||||
|
||||
// Register all the Enchantments and PotionTypes now so we can stop new registration immediately after
|
||||
Enchantments.SHARPNESS.getClass();
|
||||
@@ -1057,6 +1071,7 @@ public final class CraftServer implements Server {
|
||||
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
||||
|
||||
@@ -1037,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);
|
||||
@@ -20430,7 +20397,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1072,6 +1087,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1052,6 +1067,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
@@ -20438,7 +20405,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1087,6 +1103,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1067,6 +1083,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
@@ -20446,7 +20413,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -1552,6 +1569,55 @@ public final class CraftServer implements Server {
|
||||
@@ -1532,6 +1549,55 @@ public final class CraftServer implements Server {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20502,7 +20469,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
@Override
|
||||
public List<Recipe> getRecipesFor(ItemStack result) {
|
||||
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
|
||||
@@ -2891,6 +2957,7 @@ public final class CraftServer implements Server {
|
||||
@@ -2871,6 +2937,7 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public double[] getTPS() {
|
||||
return new double[] {
|
||||
@@ -20510,7 +20477,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
||||
@@ -2937,6 +3004,18 @@ public final class CraftServer implements Server {
|
||||
@@ -2917,6 +2984,18 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
@@ -20529,7 +20496,7 @@ index 74c46cea456f4a736325892bb7b4d0f1b35b62cd..b08d4a2a74392b1d59b1eeeab3108103
|
||||
@Override
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
@@ -3150,4 +3229,16 @@ public final class CraftServer implements Server {
|
||||
@@ -3130,4 +3209,16 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
@@ -20600,7 +20567,7 @@ index f857f490ffba2f25f7c06c5fb1a1905f0b51fbe2..1392e483c363e25d1f16465d876cb7d7
|
||||
public PersistentDataContainer getPersistentDataContainer() {
|
||||
return this.persistentDataContainer;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 776b7fc26fe96b69be260bbd36efae147d988640..9a3374a1236164194ef0df43ed639296cbe1c731 100644
|
||||
index 7c29d92362a82330440dff151bcf421f15c68f71..4bc0a370c7aec06d30b4ebf7fa7d73263d0543bc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -173,6 +173,20 @@ public class Main {
|
||||
@@ -20624,7 +20591,7 @@ index 776b7fc26fe96b69be260bbd36efae147d988640..9a3374a1236164194ef0df43ed639296
|
||||
// Paper start
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
@@ -284,7 +298,7 @@ public class Main {
|
||||
@@ -292,7 +306,7 @@ public class Main {
|
||||
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
@@ -20938,7 +20905,7 @@ index 5e83fabb20bc2b0668cbf48530053ca1bb9092f3..4ffb4046b63cbc140c76721f51c9a7a0
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index f0ce29d21fe9af803ce4e41b8c037b2ec5d1b124..99dd93c066d4acc177de7f03ae45e491b535f4d1 100644
|
||||
index b25f5931f836fd4d8695120f0bcb7c52deff8583..b473f89c59c0fc080fadd0d4db320895e917fd41 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -453,7 +453,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -20977,7 +20944,7 @@ index f0ce29d21fe9af803ce4e41b8c037b2ec5d1b124..99dd93c066d4acc177de7f03ae45e491
|
||||
}
|
||||
return effects;
|
||||
}
|
||||
@@ -907,7 +907,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return EntityCategory.WATER;
|
||||
}
|
||||
|
||||
@@ -20986,7 +20953,7 @@ index f0ce29d21fe9af803ce4e41b8c037b2ec5d1b124..99dd93c066d4acc177de7f03ae45e491
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1094,4 +1094,32 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -1099,4 +1099,32 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
getHandle().knockback(strength, directionX, directionZ);
|
||||
};
|
||||
// Paper end
|
||||
@@ -21041,7 +21008,7 @@ index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d74
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 4e6fea7cf11b1e29ae7c7098a6f5d06bb5f93cc2..668d825a2469706e4de11629a0b41877de700ca6 100644
|
||||
index 3d5876cbadb5c8c02de751c3e15fc7f251ea7d35..720a81da72a8002ff02cc39e5fca42354519c742 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -517,10 +517,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -27864,7 +27831,7 @@ index bf970bf3356a914459c2d6db93537ce2d32c7e18..08221c7256f41ca511a4a61ffb2b9793
|
||||
sender.sendMessage(builder.asComponent());
|
||||
if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 98fba0288be9ed2cb18ffba5cf81148157dd4fcf..0801dea155048ac5383295f4fef9bd597b678535 100644
|
||||
index 50c72e5db369a180f425eaaa0411cb8871bc3463..dbd502761ff6e6efb252bb41376a7ff028c73895 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
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 13:31:43 +0900
|
||||
Subject: [PATCH] Bump-Dependencies
|
||||
Date: Thu, 19 Oct 2023 22:20:17 +0900
|
||||
Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7..9211713c5b09e2d715aec5b2187ef0f27a56a9fe 100644
|
||||
index 3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736..55024a308f7a9125c6739efff4f7742ce530c750 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -20,7 +20,7 @@ dependencies {
|
||||
@@ -17,39 +17,35 @@ index d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7..9211713c5b09e2d715aec5b2187ef0f2
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.14.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
|
||||
@@ -30,48 +30,48 @@ dependencies {
|
||||
@@ -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
|
||||
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.20.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
|
||||
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol // Plazma - Bump Dependencies
|
||||
// Paper end
|
||||
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
- implementation("org.ow2.asm:asm:9.4")
|
||||
- implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0") // Paper - remove exclusion
|
||||
+ implementation("org.ow2.asm:asm:9.5")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
|
||||
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
|
||||
- runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
- runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
||||
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
+ runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
+ 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") {
|
||||
+ implementation("com.velocitypowered:velocity-native:3.2.0-SNAPSHOT") { // Plazma - Bump Dependencies
|
||||
isTransitive = false
|
||||
}
|
||||
// Paper end
|
||||
@@ -57,37 +53,24 @@ index d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7..9211713c5b09e2d715aec5b2187ef0f2
|
||||
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.4")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15")
|
||||
+ 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
|
||||
implementation("dev.omega24:upnp4j:1.0") // Purpur
|
||||
|
||||
// Pufferfish start
|
||||
- implementation("org.yaml:snakeyaml:1.32")
|
||||
+ implementation("org.yaml:snakeyaml:2.2")
|
||||
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
||||
exclude(group="org.yaml", module="snakeyaml")
|
||||
@@ -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
|
||||
+ 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")
|
||||
+ 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
|
||||
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty // Plazma - Bump Dependencies
|
||||
}
|
||||
|
||||
val craftbukkitPackageVersion = "1_20_R1" // Paper
|
||||
@@ -225,3 +225,6 @@ tasks.registerRunTask("runDev") {
|
||||
description = "Spin up a non-relocated Mojang-mapped test server"
|
||||
classpath(sourceSets.main.map { it.runtimeClasspath })
|
||||
}
|
||||
+repositories {
|
||||
+ mavenCentral()
|
||||
+}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 139e2b17b899da6f0147bb8b4412e2e54e817be4..d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7 100644
|
||||
index 55024a308f7a9125c6739efff4f7742ce530c750..58f10fa32a163ed263c5d1effb6d247bc999bb0b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
||||
@@ -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 dae36c6452ccd57a436dd918547b64d59957ab0a..903da36aeec8e8c7d1f3101d1e93f87412a7eed5 100644
|
||||
index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..6f8b44bdf4d419b2bf0982dc209def53e4b4763c 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -112,6 +112,18 @@ public class Main {
|
||||
@@ -111,6 +111,19 @@ public class Main {
|
||||
*/ // CraftBukkit end
|
||||
|
||||
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,12 +169,13 @@ index dae36c6452ccd57a436dd918547b64d59957ab0a..903da36aeec8e8c7d1f3101d1e93f874
|
||||
+ \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!");
|
||||
+ if (org.plazmamc.plazma.Options.iKnowWhatIAmDoing)
|
||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
|
||||
+ // Plazma end
|
||||
+
|
||||
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
|
||||
|
||||
if (path != null) {
|
||||
// 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 e6ddf69ade7ae51640569150f7db10d1afa63691..77b40f3d7162befe4da29a60b3de2b93b261412c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -220,10 +221,10 @@ index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326
|
||||
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 bdb32964524cb2a4398b8d3bedfb03b0cb805b6d..9fb140b3b6a0c621466b85a6ec7df765a4e823b0 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
|
||||
@@ -1035,7 +1035,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) {
|
||||
@@ -246,7 +247,7 @@ index 81554c321a78258ff78da3801f00d0fb90b9e113..ba2eab8a835c2396fca25d7993443d5d
|
||||
|
||||
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 b08d4a2a74392b1d59b1eeeab3108103d83ad96c..8833a66f43e9a4ac486fa67db9e8147007917e15 100644
|
||||
index b21bc96232d0fd52e5dae7fa1c413714f8ddd7ee..875cc2357d17d37d8df921a84cf8af7b99d860f2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -259,10 +260,10 @@ index b08d4a2a74392b1d59b1eeeab3108103d83ad96c..8833a66f43e9a4ac486fa67db9e81470
|
||||
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 99dd93c066d4acc177de7f03ae45e491b535f4d1..9d7965a33db1ce4c294fb06e77d16054d580fd54 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
|
||||
@@ -907,7 +907,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return EntityCategory.WATER;
|
||||
}
|
||||
|
||||
@@ -321,6 +322,19 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
|
||||
}
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a858b7ddef7f6877c0b92f4150e0dd37bea121aa
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -0,0 +1,7 @@
|
||||
+package org.plazmamc.plazma;
|
||||
+
|
||||
+public interface Options {
|
||||
+
|
||||
+ boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -335,7 +349,7 @@ index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa453
|
||||
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 0801dea155048ac5383295f4fef9bd597b678535..efd83400279df0beafd3b8f0e82d0f3af209554a 100644
|
||||
index dbd502761ff6e6efb252bb41376a7ff028c73895..c765cb5dd8c3c1b668b7031e6c784ed9cf2d58e1 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -104,7 +104,7 @@ 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 e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abdd74a489f 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
|
||||
@@ -135,7 +135,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -116,7 +116,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
||||
|
||||
|
||||
public PaperConfigurations(final Path globalFolder) {
|
||||
@@ -300,7 +300,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -303,7 +303,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
||||
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig);
|
||||
}
|
||||
|
||||
@@ -399,18 +399,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -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);
|
||||
@@ -145,7 +145,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..928cb4827768667a975036da73b25abd
|
||||
|
||||
@Deprecated
|
||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||
@@ -434,9 +423,15 @@ 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
|
||||
@@ -263,7 +263,7 @@ index 221d1d0e1b4b46de6ebca5faac09bbda875fae17..e009dba395779e2c89a36fe4524e5d40
|
||||
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 9fb140b3b6a0c621466b85a6ec7df765a4e823b0..08f9af1d7aebba943096b59b6452818a1aafc94c 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
|
||||
@@ -174,7 +174,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -293,10 +293,10 @@ index 9fb140b3b6a0c621466b85a6ec7df765a4e823b0..08f9af1d7aebba943096b59b6452818a
|
||||
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 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e179452bf4f6c 100644
|
||||
index 875cc2357d17d37d8df921a84cf8af7b99d860f2..c43023fecf0882101248f625a28975586da05071 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1071,6 +1071,7 @@ public final class CraftServer implements Server {
|
||||
@@ -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);
|
||||
@@ -304,7 +304,7 @@ index 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e1794
|
||||
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
|
||||
@@ -3004,6 +3005,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);
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ index 8833a66f43e9a4ac486fa67db9e8147007917e15..153fcfc55589691a570080aa4f4e1794
|
||||
@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 9a3374a1236164194ef0df43ed639296cbe1c731..affd4c6267f60cbae75b6e6a09990144a1f1e1f0 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 {
|
||||
@@ -642,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 @@
|
||||
@@ -699,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 = """
|
||||
@@ -968,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 d1fd4cf65c31bc00d0bffa3123fc2223f1498a34..0aebabc83eea721e4f373fb00f4ee80b659efe83 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 bff1b41501c040487583a5a279fc7800fc6aedca..2d7e1ffa117fa2581ab2a42cd04d062f25559b11 100644
|
||||
index 3e36958365bc136516bafbaad0c168f7956406f1..78bd9082366ea678c1ee4107b69845062eeede86 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 bff1b41501c040487583a5a279fc7800fc6aedca..2d7e1ffa117fa2581ab2a42cd04d062f
|
||||
"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 019d3bbd78fb0b06861979d223915fedb6c99442..553127c9a38612005530cffdb25544585e6c8234 100644
|
||||
index 3bc7230ca62ebe3426da293e436a962bb0134f85..af7dd492435f66877078a69310c20c42757525f2 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -142,7 +142,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -143,7 +143,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Watchdog extends ConfigurationPart {
|
||||
public int earlyWarningEvery = 5000;
|
||||
@@ -55,8 +76,43 @@ index 019d3bbd78fb0b06861979d223915fedb6c99442..553127c9a38612005530cffdb2554458
|
||||
}
|
||||
|
||||
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 da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec6520ed09 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
|
||||
@@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -80,6 +136,17 @@ index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
@@ -89,7 +156,7 @@ index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
|
||||
@ConfigSerializable
|
||||
public record DespawnRange(@Required int soft, @Required int hard) {
|
||||
@@ -371,7 +371,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 da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -451,9 +451,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 da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -461,18 +461,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 da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -487,9 +509,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 da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec
|
||||
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));
|
||||
}
|
||||
@@ -513,9 +535,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 903da36aeec8e8c7d1f3101d1e93f87412a7eed5..79593800173ad2b837b081e6091e98adfa41fb99 100644
|
||||
index 6f8b44bdf4d419b2bf0982dc209def53e4b4763c..c1ea9101bfc4c101c98ea14d1db71dcb95cb7ceb 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -155,7 +155,7 @@ public class Main {
|
||||
@@ -167,7 +167,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 903da36aeec8e8c7d1f3101d1e93f87412a7eed5..79593800173ad2b837b081e6091e98ad
|
||||
|
||||
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..9683794c187dcafc1fbbde4c074cb86402467cb1 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 153fcfc55589691a570080aa4f4e179452bf4f6c..45dabf7fc7531392b4140416f2f0931090f14235 100644
|
||||
index c43023fecf0882101248f625a28975586da05071..6b092fec6e8c468f3ecd2fc150f5463447ce2c58 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -427,7 +427,7 @@ public final class CraftServer implements Server {
|
||||
@@ -429,7 +429,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
@@ -401,7 +469,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
||||
}
|
||||
diff --git a/src/main/resources/configurations/bukkit_optimized.yml b/src/main/resources/configurations/bukkit_optimized.yml
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b2581293d
|
||||
index 0000000000000000000000000000000000000000..93589d95cea41b7f4cf89be600b004ec42e8bd26
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/configurations/bukkit_optimized.yml
|
||||
@@ -0,0 +1,45 @@
|
||||
@@ -409,10 +477,10 @@ index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b
|
||||
+# As you can see, there's actually not that much to configure without any plugins.
|
||||
+# For a reference for any variable inside this file, check out the Bukkit Wiki at
|
||||
+# https://www.spigotmc.org/go/bukkit-yml
|
||||
+#
|
||||
+#
|
||||
+# If you need help on this file, feel free to join us on Discord or leave a message
|
||||
+# on the forums asking for advice.
|
||||
+#
|
||||
+#
|
||||
+# Discord: https://www.spigotmc.org/go/discord
|
||||
+# Forums: https://www.spigotmc.org/
|
||||
+# Bug tracker: https://www.spigotmc.org/go/bugs
|
||||
|
||||
@@ -7,10 +7,10 @@ Original: someaddons/chunksending
|
||||
Copyright (C) 2023 someaddons
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index e2202389a2c4133a183cca59c4e909fc419379ab..ccb7ff8832d3673a46d0a285f09d57d12bc0203a 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
|
||||
@@ -398,9 +398,11 @@ public class ChunkHolder {
|
||||
@@ -398,9 +398,12 @@ public class ChunkHolder {
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
private void broadcast(List<ServerPlayer> players, Packet<?> packet) {
|
||||
@@ -18,9 +18,10 @@ index e2202389a2c4133a183cca59c4e909fc419379ab..ccb7ff8832d3673a46d0a285f09d57d1
|
||||
- entityplayer.connection.send(packet);
|
||||
- });
|
||||
+ // Plazma start
|
||||
+ for (ServerPlayer player : players)
|
||||
+ if (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && !player.attachToPending(pos, packet))
|
||||
+ player.connection.send(packet);
|
||||
+ for (ServerPlayer player : players) {
|
||||
+ if (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet)) continue;
|
||||
+ player.connection.send(packet);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ index 4932374ab9a3d8582fb0ef024d817ad896dd23c4..fd9be520b838346555dee2dc13f54dcf
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 08f9af1d7aebba943096b59b6452818a1aafc94c..1d2c3147abfa09233976f4cc1cc417a9dab9ed44 100644
|
||||
index 6d513c903e06fe79dffdffd02871d00cb958b715..589c58c6057ba5fa9d44796f807b8378ee50d2ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -124,7 +124,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0bd757eec..09183dbac0e8ca2cc2c8da57b105b80eab42d459 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
|
||||
@@ -1566,7 +1566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@@ -79,7 +79,7 @@ index 191bebab12c94756e9f98cfacbf06eb9a7c2f2f9..2d47c13f768ac482422e118921d186d3
|
||||
|
||||
protected boolean convertOldUsers() {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 09183dbac0e8ca2cc2c8da57b105b80eab42d459..e4c92730b63204126609a52d286da46ef6495080 100644
|
||||
index 6b6e7b8fbc0bb8a177affff0d7c7029d571faea2..93666cc703b349cbd7752c8c59c980da11e5d34c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2293,10 +2293,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@@ -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,7 +7,7 @@ Original: Bloom-host/Petal
|
||||
Copyright (C) 2023 peaches94
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 4cd04661b39a7055f5767a3dff88f9a3e197d810..ea7e40d91c314f4a58b80c978f6d7f290825856d 100644
|
||||
index 49906b4dc8392eee592215d0b4cba85267a875fc..a0759a2f1191cc44a0c441db180ad8bd300ff4a4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1037,20 +1037,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@@ -7,7 +7,7 @@ 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 19d9d3a9f634631e2ec5a6fa7f2cd9dd18f62f89..ba20f60588b980f49423307ff20fc24c95f3e7b5 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
|
||||
@@ -935,10 +935,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
@@ -400,7 +400,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..50d620fc893ca010b7ecb43b7a4617d6
|
||||
protected CipherBase(Cipher cipher) {
|
||||
this.cipher = cipher;
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 89c1b69ddeb420c2fbda5f588e7c9a467a76089d..ef566dc65a979db5aa67a21fa760d046a7508ac1 100644
|
||||
index 13144ea01bc27db95a13b267d39529b012a4c9c4..9a6d6f947f33481e8a7aa09469955218d31e194a 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -325,7 +325,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -501,10 +501,10 @@ index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..b80dff95660314e4dd27e2ada94aa315
|
||||
return map;
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 319c469c20f3cb4f6d61425bfa6d98b55b55c4d6..d62adc228724ed5576619da70a41a6aaf9966308 100644
|
||||
index 3a7c694ff0e248df3f4d168a5e2e883c0e3cb167..e139d15eda25c47292da549e2d4603a5056788bd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1451,6 +1451,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1454,6 +1454,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
private final int range;
|
||||
SectionPos lastSectionPos;
|
||||
public final Set<ServerPlayerConnection> seenBy = new ReferenceOpenHashSet<>(); // Paper - optimise map impl
|
||||
@@ -512,7 +512,7 @@ index 319c469c20f3cb4f6d61425bfa6d98b55b55c4d6..d62adc228724ed5576619da70a41a6aa
|
||||
|
||||
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
||||
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
||||
@@ -1487,7 +1488,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1490,7 +1491,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// stuff could have been removed, so we need to check the trackedPlayers set
|
||||
// for players that were removed
|
||||
|
||||
@@ -535,7 +535,7 @@ index e009dba395779e2c89a36fe4524e5d40474a29e6..c4cafcc1fb0f3b6bc17b7907ee7c6c03
|
||||
return ret;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index e4c92730b63204126609a52d286da46ef6495080..864783f856e5f7cfcbccb88a07f77a95c402e90d 100644
|
||||
index 93666cc703b349cbd7752c8c59c980da11e5d34c..2314b39ad62c6d8332ddec6c902dba5aacebfa76 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -436,7 +436,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -563,7 +563,7 @@ index e4c92730b63204126609a52d286da46ef6495080..864783f856e5f7cfcbccb88a07f77a95
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@@ -3455,7 +3455,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3434,7 +3434,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
// Paper start
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
@@ -741,7 +741,7 @@ index 64bceae4d06b35fcbecb0daca2496ba30e39d995..805d2027fcb6c06537b3357fe104742a
|
||||
// this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
|
||||
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 4952a7daa1aad68e3ba53123093cd879e0d544b5..597bebe5d5586d767332512fb1b2450acf6a95af 100644
|
||||
index c94a1b75593ad01e7f79fdc84818ea8ec269e124..b45c1d611ccd80c3b1405aaef153c37bd046f083 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -254,7 +254,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -754,7 +754,7 @@ index 4952a7daa1aad68e3ba53123093cd879e0d544b5..597bebe5d5586d767332512fb1b2450a
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index dd84433a988712da9d799cbda2487a902315fb92..42b13e2ebf21bfd4228483a7f349e874a9cac382 100644
|
||||
index 917648c2cc52790f40123b27b1cafa3fc3ba4b3f..c765ee642c4b77bfb3f21163c9e7a24b366e0a70 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@@ -1273,7 +1273,7 @@ index 16d2aa4556bc9f32a2def7f9ca282aa3fa23fb87..4886624aea43c1af7ed02da336cc0d25
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 668d825a2469706e4de11629a0b41877de700ca6..01659302dce138ed00ef4c55b712572840d2f10e 100644
|
||||
index 720a81da72a8002ff02cc39e5fca42354519c742..e10e07c89c1c79c22d82af6b76b948a4a5955a87 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -455,7 +455,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 16:23:56 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-RecipeManager
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
RecipeManager optimization.
|
||||
Optimized by taking out streams & doing extra early checks to quickly remove unrelated recipes
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
index 9ffb6999171f602f0b113dac40e0130410cad870..49b5fece692cd5da99ed21d7fd0864cea1609495 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
@@ -103,13 +103,38 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> Optional<T> getRecipeFor(RecipeType<T> type, C inventory, Level world) {
|
||||
- // CraftBukkit start
|
||||
- Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
|
||||
- return irecipe.matches(inventory, world);
|
||||
- }).findFirst();
|
||||
- inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
- // CraftBukkit end
|
||||
- return recipe;
|
||||
+ // Plazma start - CarpetFixes - Optimized RecipeManager
|
||||
+ if (world.plazmaLevelConfiguration().carpetFixes.optimizedRecipeManager() && type == RecipeType.CRAFTING) {
|
||||
+ int slots = 0;
|
||||
+ int count;
|
||||
+ //compare size to quickly remove recipes that are not even close. Plus remove streams
|
||||
+ for (int slot = 0; slot < inventory.getContainerSize(); slot++)
|
||||
+ if (!inventory.getItem(slot).isEmpty()) slots++;
|
||||
+ for (Recipe<C> recipe : this.byType(type).values()) {
|
||||
+ count = 0;
|
||||
+ if (recipe instanceof CustomRecipe) {
|
||||
+ if (recipe.matches(inventory, world)) {
|
||||
+ return (Optional<T>) Optional.of(recipe);
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (Ingredient ingredient : recipe.getIngredients())
|
||||
+ if (ingredient != Ingredient.EMPTY) count++;
|
||||
+ if (count == slots && recipe.matches(inventory, world)) {
|
||||
+ return (Optional<T>) Optional.of(recipe);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return Optional.empty();
|
||||
+ } else {
|
||||
+ // CraftBukkit start
|
||||
+ Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
|
||||
+ return irecipe.matches(inventory, world);
|
||||
+ }).findFirst();
|
||||
+ inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
+ // CraftBukkit end
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> Optional<Pair<ResourceLocation, T>> getRecipeFor(RecipeType<T> type, C inventory, Level world, @Nullable ResourceLocation id) {
|
||||
@@ -134,7 +159,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> List<T> getAllRecipesFor(RecipeType<T> type) {
|
||||
- return List.copyOf(this.byType(type).values());
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedRecipeManager() ? (List<T>) new java.util.ArrayList<>(this.byType(type).values()) : List.copyOf(this.byType(type).values()); // Plazma start - CarpetFixes - Optimized RecipeManager
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> List<T> getRecipesFor(RecipeType<T> type, C inventory, Level world) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d329f77ab19ac781506c26909591fa4ae9dabb1e..36511f71fcf3a8a5da746dd087003861a4f0a8f4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -83,10 +83,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
boolean optimizedBiomeAccess = true;
|
||||
+ boolean optimizedRecipeManager = true;
|
||||
|
||||
public boolean optimizedBiomeAccess() {
|
||||
return enabled && optimizedBiomeAccess;
|
||||
}
|
||||
|
||||
+ public boolean optimizedRecipeManager() {
|
||||
+ return enabled && optimizedRecipeManager;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..e089a881600b61060bae1135b89703f6c0b5c7e8 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 optimizedRecipeManager = true;
|
||||
+
|
||||
+ public boolean optimizedRecipeManager() {
|
||||
+ return enabled && optimizedRecipeManager;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ we used a prebaked list of all the possible colors and combinations, however thi
|
||||
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..3a7b1d85f06f9abdac427aa736b6d4c79fdbbd14 100644
|
||||
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 {
|
||||
@@ -56,23 +56,19 @@ index 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3a7b1d85f06f9abdac427aa736b6d4c7
|
||||
|
||||
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 e089a881600b61060bae1135b89703f6c0b5c7e8..29d451f55dabc15478e9c32d2c37bd0ea2d9bebc 100644
|
||||
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..de1fa9ccb088597d059e8dc7fbb0c8788e3815fc 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -138,10 +138,15 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
@@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public class CarpetFixes extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
boolean optimizedRecipeManager = true;
|
||||
+ boolean optimizedSheepChildColor = false;
|
||||
|
||||
public boolean optimizedRecipeManager() {
|
||||
return enabled && optimizedRecipeManager;
|
||||
}
|
||||
|
||||
+
|
||||
+ 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
|
||||
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: Fri, 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 7bc60901297d27d88efb401d02b4bc06d8b28874..f1b936bbef9a29d929646360df484fe24ade9780 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 699b166b6438cbe0cd197547df4d8dc4359e0b34..0d3ab6d59087da828698ae847929a31585f6796c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -644,7 +644,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 6b070ad6aa1b62a66fb85d54042af9d64cdcea7f..306e30541aeed280c23ddfc8ca87a2fc4ea10a55 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -542,7 +542,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