Compare commits
108 Commits
release-71
...
old/1.20.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39728823f0 | ||
|
|
a479b3e02f | ||
|
|
e4ca876d98 | ||
|
|
38c2cfa282 | ||
|
|
3852ef88c4 | ||
|
|
03821dffe9 | ||
|
|
02143d8487 | ||
|
|
83e396bde6 | ||
|
|
bdc88bc21f | ||
|
|
2a7f161519 | ||
|
|
1338975cb7 | ||
|
|
07d5d1a905 | ||
|
|
1c4ffc2a14 | ||
|
|
e20a613029 | ||
|
|
fca7f237b6 | ||
|
|
1a296539b9 | ||
|
|
8170f1f246 | ||
|
|
e12e3db7ef | ||
|
|
04203941c1 | ||
|
|
33db373ae2 | ||
|
|
67b1959f31 | ||
|
|
f16785b526 | ||
|
|
d9b45e9b07 | ||
|
|
9d97d0d9bd | ||
|
|
71c863456f | ||
|
|
c33c06589f | ||
|
|
ec6ce69526 | ||
|
|
9686a72d0d | ||
|
|
90de54692c | ||
|
|
9a288453bc | ||
|
|
db8e9122cb | ||
|
|
63bd308315 | ||
|
|
707c138318 | ||
|
|
bcb9a051af | ||
|
|
2e182c5aaa | ||
|
|
62fab39558 | ||
|
|
0309438d9f | ||
|
|
e071249ed1 | ||
|
|
d4cbc57b49 | ||
|
|
dc0856ca65 | ||
|
|
b009259293 | ||
|
|
2008ba2d54 | ||
|
|
fad453c120 | ||
|
|
7b62b795ae | ||
|
|
e5292079fb | ||
|
|
e9b2902304 | ||
|
|
1b3cb0dc53 | ||
|
|
d1572993db | ||
|
|
1474b31ba5 | ||
|
|
11c340c828 | ||
|
|
9502ebf684 | ||
|
|
96ef8b9e4d | ||
|
|
9889ed9b5b | ||
|
|
db9b36463c | ||
|
|
1764af50d7 | ||
|
|
922c33171c | ||
|
|
3c625b1141 | ||
|
|
fa6429f5b6 | ||
|
|
ddc4aeedc0 | ||
|
|
63c63f844e | ||
|
|
0f0f925cb8 | ||
|
|
c0273a9343 | ||
|
|
326a88dca5 | ||
|
|
cb3099170e | ||
|
|
a2120f0c82 | ||
|
|
1c33d683c8 | ||
|
|
ff30483d2c | ||
|
|
3884819fff | ||
|
|
41df279b8b | ||
|
|
8730a4d0a5 | ||
|
|
c357668334 | ||
|
|
9cde439cce | ||
|
|
0290b04ffd | ||
|
|
d63b408e89 | ||
|
|
5efc27e381 | ||
|
|
4042f69c8d | ||
|
|
617172ab6c | ||
|
|
7737cd805a | ||
|
|
4c26d69762 | ||
|
|
078fbd108c | ||
|
|
318376a16f | ||
|
|
74c593fa04 | ||
|
|
c6c048c34f | ||
|
|
017f695244 | ||
|
|
ecbebeb403 | ||
|
|
5bf8a8124e | ||
|
|
3e35bff9a0 | ||
|
|
cb7a348e89 | ||
|
|
eea08a3ecd | ||
|
|
b49ad3f336 | ||
|
|
3ba3fe9814 | ||
|
|
2adeb25bff | ||
|
|
c93e0ff16a | ||
|
|
5c5d10ae4e | ||
|
|
057b293ed5 | ||
|
|
9c54aed53d | ||
|
|
a637a72412 | ||
|
|
8f116cc067 | ||
|
|
8b317976a9 | ||
|
|
986a3f4598 | ||
|
|
5671b24941 | ||
|
|
59b163d8fa | ||
|
|
67c03ea3ec | ||
|
|
d8856b5127 | ||
|
|
a76facf92e | ||
|
|
34162ce62e | ||
|
|
eea18dca7c | ||
|
|
f427c79af9 |
40
.editorconfig
Normal file
40
.editorconfig
Normal file
@@ -0,0 +1,40 @@
|
||||
[*]
|
||||
charset=utf-8
|
||||
end_of_line=lf
|
||||
insert_final_newline=true
|
||||
indent_style=space
|
||||
indent_size=4
|
||||
ij_any_block_comment_add_space = false
|
||||
ij_any_block_comment_at_first_column = false
|
||||
ij_any_line_comment_at_first_column = false
|
||||
ij_any_line_comment_add_space = true
|
||||
|
||||
[*.tiny]
|
||||
indent_style=tab
|
||||
|
||||
[*.bat]
|
||||
end_of_line=crlf
|
||||
|
||||
[*.yml]
|
||||
indent_size=2
|
||||
|
||||
[*.patch]
|
||||
trim_trailing_whitespace=false
|
||||
|
||||
[*.java]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_java_class_count_to_use_import_on_demand = 999999
|
||||
ij_java_insert_inner_class_imports = false
|
||||
ij_java_names_count_to_use_import_on_demand = 999999
|
||||
ij_java_imports_layout = *,|,$*
|
||||
ij_java_generate_final_locals = true
|
||||
ij_java_generate_final_parameters = true
|
||||
|
||||
[test-plugin/**/*.java]
|
||||
ij_java_use_fq_class_names = false
|
||||
|
||||
[Paper-Server/src/main/resources/data/**/*.json]
|
||||
indent_size = 2
|
||||
|
||||
[paper-api-generator/generated/**/*.java]
|
||||
ij_java_imports_layout = $*,|,*
|
||||
BIN
.github/assets/logo.png
vendored
BIN
.github/assets/logo.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 176 KiB |
BIN
.github/assets/title.png
vendored
BIN
.github/assets/title.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 107 KiB |
107
.github/workflows/build.yml
vendored
107
.github/workflows/build.yml
vendored
@@ -1,107 +0,0 @@
|
||||
name: Build Plazma
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
ORG_NAME: PlazmaMC
|
||||
MC_VERSION: 1.20.1
|
||||
MAIN_BRANCH: ver/1.20.1
|
||||
DEBUG: 'false'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
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 pages
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: javadoc
|
||||
ref: gh-pages
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Set up GraalVM ${{ matrix.base_jdk }}
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GH_PAT }}
|
||||
java-version: ${{ matrix.base_jdk }}
|
||||
version: ${{ matrix.graal }}
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Configure Git
|
||||
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
|
||||
|
||||
- name: Apply Patches
|
||||
run: ./gradlew applyPatches --stacktrace
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew build --stacktrace
|
||||
|
||||
- name: Create Reobf Jar
|
||||
run: ./gradlew createReobfPaperclipJar --stacktrace
|
||||
|
||||
- name: Create Mojmap Jar
|
||||
run: ./gradlew createMojmapPaperclipJar --stacktrace
|
||||
|
||||
- name: Update Javadoc
|
||||
continue-on-error: true
|
||||
if: github.ref_name == env.MAIN_BRANCH
|
||||
run: |
|
||||
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -)
|
||||
cd javadoc
|
||||
git add . && git commit -m "Update Javadocs"
|
||||
git push
|
||||
|
||||
- name: Publish Packages
|
||||
if: github.ref_name == env.MAIN_BRANCH
|
||||
run: |
|
||||
export GITHUB_USERNAME=${{ env.ORG_NAME }}
|
||||
export GITHUB_TOKEN=${{ secrets.GH_PAT }}
|
||||
./gradlew publish --stacktrace
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/')
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Artifacts
|
||||
path: |
|
||||
build/libs
|
||||
Plazma-API/build/docs/javadoc
|
||||
|
||||
- name: Get Release Number
|
||||
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
|
||||
|
||||
- name: Release Artifacts
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: marvinpinto/action-automatic-releases@latest
|
||||
with:
|
||||
title: "Release #${{ env.RELEASE }}"
|
||||
automatic_release_tag: release-${{ env.RELEASE }}
|
||||
repo_token: "${{ secrets.GH_PAT }}"
|
||||
files: build/libs/*.jar
|
||||
prerelease: false
|
||||
|
||||
- name: Release Artifacts (Latest)
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: marvinpinto/action-automatic-releases@latest
|
||||
with:
|
||||
title: "Release #${{ env.RELEASE }}"
|
||||
automatic_release_tag: latest-${{ env.MC_VERSION }}
|
||||
repo_token: "${{ secrets.GH_PAT }}"
|
||||
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."
|
||||
14
.github/workflows/gradle.yml
vendored
14
.github/workflows/gradle.yml
vendored
@@ -2,15 +2,21 @@ name: Test Gradle build script
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
|
||||
branches: [ "ver/*", "dev/*", "feat/**/*" ]
|
||||
paths:
|
||||
- "*.kt"
|
||||
- "*.kts"
|
||||
- "*.toml"
|
||||
- "gradle-wrapper.*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
check:
|
||||
name: Test Gradle build script
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [19.0.2+7]
|
||||
java: ['temurin']
|
||||
jdk: [21]
|
||||
java: ['zulu']
|
||||
os: [ubuntu-22.04]
|
||||
|
||||
if: "!contains(github.event.commits[0].message, '[CheckSkip]')"
|
||||
|
||||
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
|
||||
141
.github/workflows/release.yml
vendored
Normal file
141
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
name: Release Plazma (1.20.4)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "dev/*", "feat/**/*" ]
|
||||
paths:
|
||||
- "**.patch"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
ORG_NAME: PlazmaMC
|
||||
MC_VERSION: 1.20.4
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release Plazma
|
||||
strategy:
|
||||
matrix:
|
||||
base_jdk: [17]
|
||||
os: [ubuntu-22.04]
|
||||
|
||||
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Setup Variables
|
||||
id: setup
|
||||
env:
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
run: echo "branch=${BRANCH##*/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout javadocs
|
||||
uses: actions/checkout@v4
|
||||
continue-on-error: true
|
||||
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
|
||||
with:
|
||||
repository: PlazmaMC/Javadocs
|
||||
path: javadoc
|
||||
ref: ${{ steps.setup.outputs.branch }}
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
|
||||
- name: Checkout javadocs
|
||||
uses: actions/checkout@v4
|
||||
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
|
||||
with:
|
||||
repository: PlazmaMC/Javadocs
|
||||
path: jdmain
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Set up GraalVM ${{ matrix.base_jdk }}
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
java-version: ${{ matrix.base_jdk }}
|
||||
version: latest
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Configure Git
|
||||
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
|
||||
|
||||
- name: Apply Patches
|
||||
run: ./gradlew applyPatches --stacktrace
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew build --stacktrace
|
||||
|
||||
- name: Create Reobf Jar
|
||||
run: ./gradlew createReobfPaperclipJar --stacktrace
|
||||
|
||||
- name: Create Mojmap Jar
|
||||
run: ./gradlew createMojmapPaperclipJar --stacktrace
|
||||
|
||||
- name: Update Javadoc
|
||||
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ ! -d "javadoc" ]; then
|
||||
mkdir javadoc
|
||||
cd javadoc
|
||||
git init && git branch -m ${{ steps.setup.outputs.branch }}
|
||||
git remote add origin https://github.com/PlazmaMC/Javadocs
|
||||
fi
|
||||
|
||||
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -)
|
||||
cd javadoc
|
||||
git add . && git commit -m "Update Javadocs"
|
||||
git push -f
|
||||
|
||||
cd ../jdmain
|
||||
git submodule update
|
||||
git add . && git commit -m "Update Javadocs"
|
||||
git push
|
||||
|
||||
- name: Publish Packages
|
||||
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
|
||||
run: |
|
||||
export GITHUB_USERNAME=${{ env.ORG_NAME }}
|
||||
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||
./gradlew publish --stacktrace
|
||||
|
||||
- name: Get Release Number
|
||||
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: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
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
|
||||
|
||||
- name: Release Artifacts (Latest/Stable)
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
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
|
||||
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
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -23,6 +23,8 @@ nbactions.xml
|
||||
.gradle/
|
||||
build/
|
||||
*/build/
|
||||
run/
|
||||
javadoc/
|
||||
|
||||
# we use maven!
|
||||
build.xml
|
||||
@@ -33,7 +35,6 @@ target/
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
# various other potential build files
|
||||
build/
|
||||
bin/
|
||||
dist/
|
||||
manifest.mf
|
||||
@@ -48,12 +49,12 @@ manifest.mf
|
||||
# Linux temp files
|
||||
*~
|
||||
|
||||
# other stuff
|
||||
run/
|
||||
javadoc/
|
||||
|
||||
# Paperweight
|
||||
build-data/
|
||||
*-API
|
||||
*-MojangAPI
|
||||
*-Server
|
||||
*.jar
|
||||
paper-api-generator
|
||||
compare.txt
|
||||
*.patch
|
||||
!patches/**/*
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
purpurCommit = 423c2af60ca5e9d18ac0bd955d0313efc693d2a3
|
||||
pufferfishCommit = a3c0a4d2f177d80283d03de52617732a7b493665
|
||||
52
README.md
52
README.md
@@ -1,48 +1,38 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||
[](https://github.com/PlazmaMC/Plazma)
|
||||
|
||||
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
||||
|
||||
[](README.md)
|
||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
|
||||
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.4)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/build/1.20.4/latest)
|
||||
|
||||
[](LICENSE)
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
|
||||
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
|
||||
[](LICENSE)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases)
|
||||
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
||||
[](https://github.com/PPlazmaMC/Plazma/network/members)
|
||||
[](https://github.com/PlazmaMC/Plazma/watchers)
|
||||
|
||||
</div>
|
||||
|
||||
## ⚠️ Warning
|
||||
- Plazma may cause **<u>unexpected problems</u>**, so **don't use** it in production server!
|
||||
[main]: https://github.com/PlazmaMC/Plazma
|
||||
|
||||
## 💬 About Plazma...
|
||||
- **Plazma** is created from the merger of **[Andromeda](https://github.com/TeamEarendel/Andromeda)** and **[Fusion](https://github.com/RuinedTechnologyUnify/Fusion)**
|
||||
- Compatible and effective patches from other bukkits and mods
|
||||
- We're always trying to keep it compatible and performance high.
|
||||
|
||||
## ⚙️ Features
|
||||
- **Based on [Paper](https://github.com/PaperMC/Paper)** - Most plugins of Bukkit, Craft Bukkit, Spigot, and Paper are available
|
||||
- **Including [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) and [Purpur](https://github.com/PurpurMC/Purpur)** - Provides multiple optimizations and customizations
|
||||
> [!IMPORTANT]
|
||||
This is the branch for Plazma 1.20.4. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
|
||||
이곳은 플라즈마의 1.20.4용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[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.
|
||||
<!--- LINKS --->
|
||||
[paperReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar
|
||||
[paperMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-paperclip-1.20.4-R0.1-SNAPSHOT-mojmap.jar
|
||||
[bundlerReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar
|
||||
[bundlerMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-bundler-1.20.4-R0.1-SNAPSHOT-mojmap.jar
|
||||
|
||||
## 🌀 Sponsorship - Minecraft Development Dictionary (KOREAN)
|
||||
[](https://discord.gg/AZwXTA9Pgx)
|
||||
- 한글로 번역&정리된 Minecraft와 서드파티 버킷들의 소식들을 빠르게 만나볼 수 있습니다.
|
||||
- Skript와 Plugin등 서버 개발과 관련된 질문에 대한 답변을 받으실 수 있습니다.
|
||||
|
||||
## 📈 bStats
|
||||
[](https://bstats.org/plugin/server-implementation/Plazma/18047)
|
||||
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|
||||
|:-----------------------------:|:-----------------------:|:------------------------:|:-------------------------:|
|
||||
| [Download][paperReobf] | [Download][paperMojmap] | [Download][bundlerReobf] | [Download][bundlerMojmap] |
|
||||
|
||||
14
build-data/dev-imports.txt
Normal file
14
build-data/dev-imports.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
# You can use this file to import files from minecraft libraries into the project
|
||||
# format:
|
||||
# <artifactId> <fileName>
|
||||
# both fully qualified and a file based syntax are accepted for <fileName>:
|
||||
# authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
# datafixerupper com.mojang.datafixers.DataFixerBuilder
|
||||
# datafixerupper com/mojang/datafixers/util/Either.java
|
||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
|
||||
# mc_data chat_type/chat.json
|
||||
# mc_data dimension_type/overworld.json
|
||||
#
|
||||
167
build.gradle.kts
167
build.gradle.kts
@@ -1,76 +1,96 @@
|
||||
import io.papermc.paperweight.util.*
|
||||
import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.5.5"
|
||||
`kotlin-dsl`
|
||||
`always-up-to-date`
|
||||
alias(libs.plugins.shadow) apply false
|
||||
alias(libs.plugins.paperweight)
|
||||
}
|
||||
|
||||
kotlin.jvmToolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||
content {
|
||||
onlyForConfigurations(PAPERCLIP_CONFIG)
|
||||
onlyForConfigurations(configurations.paperclip.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
remapper(libs.remapper)
|
||||
decompiler(libs.decompiler)
|
||||
paperclip(libs.paperclip)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
minHeapSize = "2g"
|
||||
maxHeapSize = "2g"
|
||||
tasks {
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = 17
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType<Test> {
|
||||
testLogging {
|
||||
showStackTraces = true
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
events(TestLogEvent.STANDARD_OUT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://oss.sonatype.org/content/groups/public/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://ci.emc.gs/nexus/content/groups/aikar/")
|
||||
maven("https://repo.aikar.co/content/groups/aikar")
|
||||
maven("https://repo.md-5.net/content/repositories/releases/")
|
||||
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
paperweight {
|
||||
serverProject.set(project(":plazma-server"))
|
||||
serverProject = project(":plazma-server")
|
||||
|
||||
remapRepo.set("https://maven.fabricmc.net/")
|
||||
decompileRepo.set("https://files.minecraftforge.net/maven/")
|
||||
remapRepo = "https://repo.papermc.io/repository/maven-public/"
|
||||
decompileRepo = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
usePaperUpstream(providers.gradleProperty("paperCommit")) {
|
||||
withPaperPatcher {
|
||||
@@ -80,31 +100,56 @@ paperweight {
|
||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||
serverOutputDir.set(layout.projectDirectory.dir("Plazma-Server"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val upstreamTask = tasks.register("updateUpstream") {
|
||||
val tempDir = layout.cacheDir("updateUpstream");
|
||||
val file = "gradle.properties";
|
||||
|
||||
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")
|
||||
}
|
||||
patchTasks.register("generatedApi") {
|
||||
isBareDirectory = true
|
||||
upstreamDirPath = "paper-api-generator/generated"
|
||||
patchDir = layout.projectDirectory.dir("patches/generated-api")
|
||||
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
|
||||
}
|
||||
}
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(tempDir.file("gradle.properties"))
|
||||
into(project.file(file).parent)
|
||||
patchTasks.register("mojangApi") {
|
||||
isBareDirectory = true
|
||||
upstreamDirPath = "Paper-MojangAPI"
|
||||
patchDir = layout.projectDirectory.dir("patches/mojang-api")
|
||||
outputDir = layout.projectDirectory.dir("Plazma-MojangAPI")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
alwaysUpToDate {
|
||||
paperRepository.set("https://github.com/PaperMC/Paper")
|
||||
paperBranch.set("master")
|
||||
purpurRepository.set("https://github.com/PurpurMC/Purpur")
|
||||
purpurBranch.set("ver/1.20.4")
|
||||
pufferfishRepository.set("https://github.com/pufferfish-gg/Pufferfish")
|
||||
pufferfishBranch.set("ver/1.20")
|
||||
}
|
||||
|
||||
tasks {
|
||||
applyPatches {
|
||||
dependsOn("applyGeneratedApiPatches")
|
||||
}
|
||||
|
||||
rebuildPatches {
|
||||
dependsOn("rebuildGeneratedApiPatches")
|
||||
}
|
||||
|
||||
generateDevelopmentBundle {
|
||||
apiCoordinates.set("org.plazmamc.plazma:plazma-api")
|
||||
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
|
||||
libraryRepositories.addAll(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
"https://maven.pkg.github.com/PlazmaMC/Plazma",
|
||||
"https://papermc.io/repo/repository/maven-public/"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications.create<MavenPublication>("devBundle") {
|
||||
artifact(tasks.generateDevelopmentBundle) {
|
||||
artifactId = "dev-bundle"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
buildSrc/build.gradle.kts
Normal file
33
buildSrc/build.gradle.kts
Normal file
@@ -0,0 +1,33 @@
|
||||
plugins {
|
||||
java
|
||||
`kotlin-dsl`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
|
||||
kotlin.jvmToolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
shadow("io.papermc.paperweight:paperweight-patcher:1.5.11-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks {
|
||||
jar {
|
||||
finalizedBy(shadowJar)
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveFileName.set("buildSrc.jar")
|
||||
configurations = listOf(project.configurations["shadow"])
|
||||
|
||||
exclude("META-INF/gradle-plugins/io.papermc.paperweight.patcher.properties")
|
||||
relocate("io.papermc.paperweight", "org.plazmamc.alwaysuptodate.internal.paperweight")
|
||||
minimize()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.plazmamc.alwaysuptodate
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.plazmamc.alwaysuptodate.tasks.CheckPaperCommitTask
|
||||
import org.plazmamc.alwaysuptodate.tasks.CheckPurpurCommitTask
|
||||
import org.plazmamc.alwaysuptodate.tasks.PaperUpdateTask
|
||||
import org.plazmamc.alwaysuptodate.tasks.PurpurUpdateTask
|
||||
|
||||
class AlwaysUpToDate : Plugin<Project> {
|
||||
|
||||
override fun apply(target: Project) {
|
||||
target.extensions.create("alwaysUpToDate", AlwaysUpToDateExtension::class.java)
|
||||
target.tasks.register("updatePaper", PaperUpdateTask::class.java)
|
||||
target.tasks.register("updatePurpur", PurpurUpdateTask::class.java)
|
||||
target.tasks.register("checkPaperCommit", CheckPaperCommitTask::class.java)
|
||||
target.tasks.register("checkPurpurCommit", CheckPurpurCommitTask::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.plazmamc.alwaysuptodate
|
||||
|
||||
class AlwaysUpToDateException : Exception {
|
||||
constructor(message: String) : super(message)
|
||||
constructor(message: String, cause: Throwable?) : super(message, cause)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.plazmamc.alwaysuptodate
|
||||
|
||||
import org.gradle.api.provider.Property
|
||||
|
||||
interface AlwaysUpToDateExtension {
|
||||
|
||||
val paperRepository: Property<String>
|
||||
val paperBranch: Property<String>
|
||||
|
||||
val pufferfishRepository: Property<String>
|
||||
val pufferfishBranch: Property<String>
|
||||
|
||||
val purpurRepository: Property<String>
|
||||
val purpurBranch: Property<String>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.fromJson
|
||||
import io.papermc.paperweight.util.gson
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
|
||||
import org.plazmamc.alwaysuptodate.utils.pathIO
|
||||
import paper.libs.com.google.gson.JsonObject
|
||||
import java.net.URI
|
||||
|
||||
abstract class CheckPaperCommitTask : Task() {
|
||||
|
||||
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
|
||||
|
||||
@TaskAction
|
||||
fun check() {
|
||||
println(project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "paperCommit"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract class CheckPurpurCommitTask : Task() {
|
||||
|
||||
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
|
||||
|
||||
@TaskAction
|
||||
fun check() {
|
||||
println(project.checkCommit(property.purpurRepository.get(), property.purpurBranch.get(), "purpurCommit"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun Project.getLatest(repository: String, branch: String) : String {
|
||||
val regex = "[a-z0-9]{40}\trefs/heads/$branch".toRegex()
|
||||
|
||||
return Git(project.pathIO)("ls-remote", repository).readText()?.lines()
|
||||
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
|
||||
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
|
||||
}
|
||||
|
||||
fun Project.checkCommit(repository: String, branch: String, propertyName: String) : Boolean {
|
||||
val latestCommit = project.getLatest(repository, branch)
|
||||
val currentCommit = project.properties[propertyName] as String
|
||||
|
||||
return currentCommit == latestCommit
|
||||
}
|
||||
|
||||
fun Project.createCompareComment(repository: String, branch: String, before: String, clear: Boolean = false) {
|
||||
val builder = StringBuilder()
|
||||
val rawRepo = URI.create(repository).path.substring(1)
|
||||
|
||||
if (!clear) builder.append(project.file("compare.txt").readText())
|
||||
builder.append("\n\n[${rawRepo.split("/").last()} Changes]")
|
||||
|
||||
gson.fromJson<JsonObject>(URI.create("https://api.github.com/repos/$rawRepo/compare/$before...$branch").toURL().readText())["commits"].asJsonArray.forEach {
|
||||
val commit = it.asJsonObject
|
||||
builder.append("$rawRepo@${commit["sha"].asString.subSequence(0, 7)}: ${commit["commit"].asJsonObject["message"].asString.split("\n")[0]}\n")
|
||||
}
|
||||
project.file("compare.txt").writeText(builder.toString())
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
|
||||
import java.io.File
|
||||
|
||||
abstract class PaperUpdateTask : Task() {
|
||||
|
||||
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
|
||||
|
||||
override fun init() {
|
||||
outputs.upToDateWhen {
|
||||
project.checkCommit(
|
||||
property.paperRepository.get(),
|
||||
property.paperBranch.get(),
|
||||
"purpurCommit"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun update() {
|
||||
if (project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "purpurCommit")) return
|
||||
project.createCompareComment(
|
||||
property.paperRepository.get(),
|
||||
property.paperBranch.get(),
|
||||
project.properties["paperCommit"] as String,
|
||||
true
|
||||
)
|
||||
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun updatePaperCommit(repo: String, branch: String, properties: File, regexRule: String = "paperCommit = ") {
|
||||
val latestCommit = Git(properties.parentFile.toPath())("ls-remote", repo).readText()?.lines()
|
||||
?.filterNot { "[a-z0-9]{40}\trefs/heads/$branch".toRegex().matches(it) }?.first()?.split("\t")?.first()
|
||||
?: throw AlwaysUpToDateException("Failed to get latest Paper commit")
|
||||
|
||||
properties.writeText(properties.readText().replace("$regexRule.*".toRegex(), "$regexRule$latestCommit"))
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.cache
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
|
||||
import org.plazmamc.alwaysuptodate.utils.Gradle
|
||||
import org.plazmamc.alwaysuptodate.utils.addCommit
|
||||
import org.plazmamc.alwaysuptodate.utils.clone
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.createDirectories
|
||||
import kotlin.io.path.exists
|
||||
|
||||
abstract class PurpurUpdateTask : Task() {
|
||||
|
||||
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
|
||||
private val pufferfishCommit = """
|
||||
Pufferfish
|
||||
Copyright (C) 2024 Pufferfish Studios LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
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/>.
|
||||
""".trimIndent()
|
||||
private val purpurCommit = """
|
||||
PurpurMC
|
||||
Copyright (C) 2024 PurpurMC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
""".trimIndent()
|
||||
|
||||
override fun init() {
|
||||
outputs.upToDateWhen {
|
||||
project.checkCommit(
|
||||
property.purpurRepository.get(),
|
||||
property.purpurBranch.get(),
|
||||
"purpurCommit"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun update() {
|
||||
if (project.checkCommit(property.purpurRepository.get(), property.purpurBranch.get(), "purpurCommit")) return
|
||||
Git.checkForGit()
|
||||
|
||||
project.createCompareComment(
|
||||
property.purpurRepository.get(),
|
||||
property.purpurBranch.get(),
|
||||
project.properties["purpurCommit"] as String,
|
||||
true
|
||||
)
|
||||
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
|
||||
if (dir.exists()) dir.toFile().deleteRecursively()
|
||||
|
||||
dir.createDirectories()
|
||||
|
||||
val git = Git(dir)
|
||||
val pufferfish = git.clone("Pufferfish", property.pufferfishRepository.get(), property.pufferfishBranch.get(), dir)
|
||||
val purpur = git.clone("Purpur", property.purpurRepository.get(), property.purpurBranch.get(), dir)
|
||||
|
||||
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), pufferfish.resolve("gradle.properties").toFile(), "paperRef=")
|
||||
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), purpur.resolve("gradle.properties").toFile())
|
||||
|
||||
if (!project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "paperCommit")) {
|
||||
project.createCompareComment(
|
||||
property.paperRepository.get(),
|
||||
property.paperBranch.get(),
|
||||
project.properties["paperCommit"] as String
|
||||
)
|
||||
updatePaperCommit(
|
||||
property.paperRepository.get(),
|
||||
property.paperBranch.get(),
|
||||
project.file("gradle.properties")
|
||||
)
|
||||
}
|
||||
|
||||
val latestCommit = git("ls-remote", property.purpurRepository.get()).readText()?.lines()
|
||||
?.filterNot { "[a-z0-9]{40}\trefs/heads/${property.purpurBranch.get()}".toRegex().matches(it) }?.first()?.split("\t")?.first()
|
||||
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
|
||||
|
||||
val purpurGradle = Gradle(purpur)
|
||||
val purpurPatches = purpur.resolve("patches").also {
|
||||
val puffefishPatches = pufferfish.resolve("patches").also { that -> that.toFile().deleteRecursively() }
|
||||
copyPatch(it.resolve("server"), puffefishPatches.resolve("server"), "0001-Pufferfish-Server-Changes.patch")
|
||||
copyPatch(it.resolve("api"), puffefishPatches.resolve("api"), "0001-Pufferfish-API-Changes.patch")
|
||||
}
|
||||
|
||||
Gradle(pufferfish)("applyPatches").executeOut()
|
||||
purpurGradle("applyPatches").executeOut()
|
||||
|
||||
pufferfish.resolve("pufferfish-server").also {
|
||||
val dotGit = it.resolve(".git").toFile()
|
||||
dotGit.deleteRecursively()
|
||||
copySource(it)
|
||||
|
||||
val paper = pufferfish.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
|
||||
copySource(paper)
|
||||
Git(paper)("add", ".").executeOut()
|
||||
Git(paper)("commit", "-m", "Vanilla Sources", "--author=Vanilla <auto@mated.null>").executeOut()
|
||||
Thread.sleep(1_000)
|
||||
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
|
||||
|
||||
Git(it).addCommit("Pufferfish Server Changes\n\n$pufferfishCommit", "--author=Kevin Raneri <kevin.raneri@gmail.com>")
|
||||
|
||||
val server = purpur.resolve("Purpur-Server")
|
||||
copySource(server)
|
||||
dotGit.copyRecursively(server.resolve(".git").toFile().also { that -> that.deleteRecursively() }, overwrite = true)
|
||||
Git(server).addCommit("Purpur Server Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
|
||||
}
|
||||
|
||||
with(purpur.resolve("Purpur-API")) {
|
||||
pufferfish.resolve("pufferfish-api/.git").toFile()
|
||||
.copyRecursively(resolve(".git").toFile().also { it.deleteRecursively() }, overwrite = true)
|
||||
Git(this).addCommit("Purpur API Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
|
||||
}
|
||||
|
||||
purpurGradle("rebuildPatches").executeOut()
|
||||
project.layout.projectDirectory.path.resolve("patches").also {
|
||||
with(purpurPatches.resolve("server")) {
|
||||
val target = it.resolve("server")
|
||||
copyPatch(this, target, "0001-Pufferfish-Server-Changes.patch")
|
||||
copyPatch(this, target, "0002-Purpur-Server-Changes.patch")
|
||||
}
|
||||
|
||||
with(purpurPatches.resolve("api")) {
|
||||
val target = it.resolve("api")
|
||||
copyPatch(this, target, "0001-Pufferfish-API-Changes.patch")
|
||||
copyPatch(this, target, "0002-Purpur-API-Changes.patch")
|
||||
}
|
||||
}
|
||||
|
||||
project.file("gradle.properties").writeText(project.file("gradle.properties").readText().replace("purpurCommit = .*".toRegex(), "purpurCommit = $latestCommit"))
|
||||
}
|
||||
|
||||
private fun copySource(dir: Path) {
|
||||
with(dir.resolve(".gradle/caches/paperweight/mc-dev-sources")) {
|
||||
val target = dir.resolve("src/main")
|
||||
resolve("net").toFile().copyRecursively(target.resolve("java/net").toFile(), overwrite = true)
|
||||
resolve("data").toFile().copyRecursively(target.resolve("resources/data").toFile(), overwrite = true)
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyPatch(from: Path, to: Path, name: String) {
|
||||
with(from.resolve(name)) {
|
||||
if (exists()) toFile().copyTo(to.resolve(name).toFile(), overwrite = true)
|
||||
else from.toFile().walk().filter { it.name.endsWith(name.substring(4)) }.first().copyTo(to.resolve(name).toFile(), overwrite = true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
|
||||
abstract class Task : DefaultTask() {
|
||||
|
||||
protected open fun init() {
|
||||
}
|
||||
|
||||
init {
|
||||
this.init()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.notExists
|
||||
|
||||
fun Git.clone(name: String, uri: String, branch: String, dir: Path): Path {
|
||||
val target = dir.resolve(name)
|
||||
this("clone", "--depth", "1", "--branch", branch, uri, target.toString()).executeSilently(silenceErr = true)
|
||||
if (target.notExists()) throw AlwaysUpToDateException("Failed to clone repository")
|
||||
return target
|
||||
}
|
||||
|
||||
fun Git.addCommit(vararg args: String) {
|
||||
this("add", ".").executeSilently(silenceErr = true)
|
||||
this("commit", "-m", *args).executeSilently(silenceErr = true)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
import io.papermc.paperweight.util.Command
|
||||
import io.papermc.paperweight.util.directory
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.notExists
|
||||
|
||||
class Gradle(private val repo: Path) {
|
||||
|
||||
init {
|
||||
if (repo.resolve("gradle").notExists())
|
||||
throw AlwaysUpToDateException("Git repository does not exist: $repo")
|
||||
}
|
||||
|
||||
operator fun invoke(vararg args: String): Command {
|
||||
val builder = ProcessBuilder("java", "-cp", "gradle/wrapper/gradle-wrapper.jar", "org.gradle.wrapper.GradleWrapperMain", *args, "--no-daemon", "--stacktrace").directory(repo)
|
||||
val command = builder.command().joinToString(" ") { if (it.codePoints().anyMatch(Character::isWhitespace)) "\"$it\"" else it }
|
||||
|
||||
return try {
|
||||
Command(builder, command)
|
||||
} catch (e: Exception) {
|
||||
throw AlwaysUpToDateException("Failed to execute command: $command", e)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.Project
|
||||
import java.nio.file.Path
|
||||
|
||||
val Project.pathIO: Path get() = layout.projectDirectory.path
|
||||
@@ -0,0 +1 @@
|
||||
implementation-class=org.plazmamc.alwaysuptodate.AlwaysUpToDate
|
||||
3
FixupAPI.sh → fxapi
Normal file → Executable file
3
FixupAPI.sh → fxapi
Normal file → Executable file
@@ -9,5 +9,6 @@ cd Plazma-API
|
||||
git add .
|
||||
git commit -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
|
||||
cd ../
|
||||
cd ../
|
||||
3
FixupServer.sh → fxsrv
Normal file → Executable file
3
FixupServer.sh → fxsrv
Normal file → Executable file
@@ -9,5 +9,6 @@ cd Plazma-Server
|
||||
git add .
|
||||
git commit -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
|
||||
cd ../
|
||||
cd ../
|
||||
@@ -1,9 +1,12 @@
|
||||
group = org.plazmamc.plazma
|
||||
version = 1.20.1-R0.1-SNAPSHOT
|
||||
|
||||
paperCommit = b4e3b3d1dd447bac4cbf478595c1ec320bc6dd4b
|
||||
|
||||
org.gradle.deamon = true
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
org.gradle.vfs.watch = false
|
||||
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true
|
||||
|
||||
version = 1.20.4-R0.1-SNAPSHOT
|
||||
mcVersion = 1.20.4
|
||||
|
||||
paperCommit = f4c7d373e4a1aff23539fe099745bf29a28559b9
|
||||
purpurCommit = 6b1ee98f813ee19f8046b3c528feeee61840a35b
|
||||
|
||||
15
gradle/libs.versions.toml
Normal file
15
gradle/libs.versions.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[versions]
|
||||
shadow = "8.1.1"
|
||||
paperweight = "1.5.15"
|
||||
paperclip = "3.0.3"
|
||||
decompiler = "1.10.1"
|
||||
remapper = "0.10.1"
|
||||
|
||||
[libraries]
|
||||
remapper = { group = "net.fabricmc", name = "tiny-remapper", version.ref="remapper" }
|
||||
decompiler = { group = "org.vineflower", name = "vineflower", version.ref = "decompiler" }
|
||||
paperclip = { group = "io.papermc", name = "paperclip", version.ref = "paperclip" }
|
||||
|
||||
[plugins]
|
||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
|
||||
paperweight = { id = "io.papermc.paperweight.patcher", version.ref = "paperweight" }
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
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.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
22
gradlew
vendored
22
gradlew
vendored
@@ -83,7 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -130,10 +131,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,11 +202,11 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
29
libs/api.versions.toml
Normal file
29
libs/api.versions.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
[versions]
|
||||
gson = "2.10.1"
|
||||
joml = "1.10.5"
|
||||
guava = "32.1.2-jre"
|
||||
sentry = "5.4.0"
|
||||
fastutil = "8.5.6"
|
||||
findbugs = "1.3.9"
|
||||
slf4j-api = "2.0.9"
|
||||
bungeechat = "1.20-R0.2"
|
||||
json-simple = "1.1.1"
|
||||
annotations = "24.0.1"
|
||||
checkerqual = "3.21.0"
|
||||
|
||||
[libraries]
|
||||
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
|
||||
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
|
||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
|
||||
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
|
||||
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
|
||||
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
|
||||
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
|
||||
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
|
||||
|
||||
[bundles]
|
||||
api = [ "guava", "gson", "bungeechat", "joml", "fastutil", "slf4j-api", "sentry" ]
|
||||
annotations = [ "annotations", "checkerqual" ]
|
||||
45
libs/common.versions.toml
Normal file
45
libs/common.versions.toml
Normal file
@@ -0,0 +1,45 @@
|
||||
[versions]
|
||||
asm = "9.6"
|
||||
log4j = "2.19.0"
|
||||
mockito = "5.5.0"
|
||||
jupiter = "5.10.0"
|
||||
hamcrest = "2.2"
|
||||
snakeyaml = "2.2"
|
||||
adventure = "4.16.0"
|
||||
commons-lang2 = "2.6"
|
||||
commons-lang3 = "3.12.0"
|
||||
maven-provider = "3.9.6"
|
||||
maven-resolver = "1.9.18"
|
||||
|
||||
[libraries]
|
||||
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "jupiter" }
|
||||
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
|
||||
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
|
||||
|
||||
asm-head = { group = "org.ow2.asm", name = "asm", version.ref = "asm" }
|
||||
asm-tree = { group = "org.ow2.asm", name = "asm-tree", version.ref = "asm" }
|
||||
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
|
||||
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
|
||||
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
|
||||
log4j-iostreams = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
|
||||
maven-provider = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "maven-provider" }
|
||||
maven-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "maven-resolver" }
|
||||
maven-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "maven-resolver" }
|
||||
commons-lang2 = { group = "commons-lang", name = "commons-lang", version.ref = "commons-lang2" }
|
||||
commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" }
|
||||
|
||||
adventure-bom = { group = "net.kyori", name = "adventure-bom", version.ref = "adventure" }
|
||||
adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
|
||||
adventure-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
|
||||
adventure-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
|
||||
adventure-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventure" }
|
||||
adventure-serializer-ansi = { group = "net.kyori", name = "adventure-text-serializer-ansi", version.ref = "adventure" }
|
||||
adventure-serializer-plain = { group = "net.kyori", name = "adventure-text-serializer-plain", version.ref = "adventure" }
|
||||
adventure-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" }
|
||||
|
||||
[bundles]
|
||||
asm = [ "asm-head", "asm-commons" ]
|
||||
test = [ "jupiter", "hamcrest", "mockito", "asm-tree" ]
|
||||
maven = [ "maven-connector", "maven-transport" ]
|
||||
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]
|
||||
40
libs/server.versions.toml
Normal file
40
libs/server.versions.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
[versions]
|
||||
upnp = "1.0"
|
||||
ansi = "1.0.3"
|
||||
jansi = "3.21.0"
|
||||
rhino = "1.7.14"
|
||||
mysql = "8.2.0"
|
||||
sqlite = "3.42.0.1"
|
||||
pioneer = "2.2.0"
|
||||
haproxy = "4.1.97.Final"
|
||||
velocity = "3.1.2-SNAPSHOT"
|
||||
disruptor = "3.4.4"
|
||||
simpleyaml = "1.8.4"
|
||||
classgraph = "4.8.47"
|
||||
mapping-io = "0.5.0"
|
||||
configurate = "4.2.0-SNAPSHOT"
|
||||
terminal-appender = "1.3.0"
|
||||
|
||||
[libraries]
|
||||
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
|
||||
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
|
||||
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
|
||||
jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jansi" }
|
||||
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
|
||||
pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "pioneer" }
|
||||
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
|
||||
velocity = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
|
||||
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
|
||||
mappingio = { group = "net.fabricmc", name = "mapping-io", version.ref = "mapping-io" }
|
||||
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
|
||||
simpleyaml = { group = "com.github.carleslc.Simple-YAML", name = "Simple-Yaml", version.ref = "simpleyaml" }
|
||||
configurate = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
|
||||
|
||||
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
|
||||
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
|
||||
terminal-appender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="terminal-appender" }
|
||||
|
||||
[bundles]
|
||||
runtime = [ "sqlite", "mysql", "disruptor" ]
|
||||
implementation = [ "jansi", "terminal-appender", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime" ]
|
||||
test = [ "classgraph", "pioneer" ]
|
||||
0
PatchAPI.sh → mkapi
Normal file → Executable file
0
PatchAPI.sh → mkapi
Normal file → Executable file
0
PatchServer.sh → mksrv
Normal file → Executable file
0
PatchServer.sh → mksrv
Normal file → Executable file
@@ -3,8 +3,8 @@ From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Tue, 9 Nov 2021 14:01:56 -0500
|
||||
Subject: [PATCH] Pufferfish API Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Copyright (C) 2023 Pufferfish Studios LLC
|
||||
Pufferfish
|
||||
Copyright (C) 2024 Pufferfish Studios LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -20,18 +20,18 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 8045f92ffdfb4164bcbef99c41359590c45f9006..3676035ba011fb874ad6bb8995940d9bb2a0f0ae 100644
|
||||
index 04853c43b99951bf0d4c96ef73724625bdaf018f..9164120d299d062c62529a7ef74eac0ded367993 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
@@ -51,6 +51,7 @@ dependencies {
|
||||
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
+ api("io.sentry:sentry:5.4.0") // Pufferfish
|
||||
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4")
|
||||
@@ -89,6 +90,13 @@ val generateApiVersioningFile by tasks.registering {
|
||||
implementation("org.ow2.asm:asm:9.7")
|
||||
implementation("org.ow2.asm:asm-commons:9.7")
|
||||
@@ -109,6 +110,13 @@ val generateApiVersioningFile by tasks.registering {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9584e245144b561b4f6745b2f26a4f69a6f92891 100644
|
||||
index c80faa079eca1564847070f0338fc98024639829..e632d51d3487eb4807243b6705999ad124466bf5 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -480,10 +480,10 @@ index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bac
|
||||
|
||||
if (cloader instanceof PluginClassLoader) {
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee1b8df621 100644
|
||||
index 7e4f7cb2afbc145e532285c793573ad107bc3033..12449e18180d604e9cbbc744da74a8b222a18e1f 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
@@ -48,6 +48,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -50,6 +50,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
private io.papermc.paper.plugin.provider.classloader.PluginClassLoaderGroup classLoaderGroup; // Paper
|
||||
public io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext; // Paper
|
||||
|
||||
@@ -492,7 +492,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
|
||||
static {
|
||||
ClassLoader.registerAsParallelCapable();
|
||||
}
|
||||
@@ -183,6 +185,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -197,6 +199,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
|
||||
@Override
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
|
||||
@@ -190,7 +193,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -204,7 +207,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
}
|
||||
Class<?> result = classes.get(name);
|
||||
|
||||
@@ -509,7 +509,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
|
||||
String path = name.replace('.', '/').concat(".class");
|
||||
JarEntry entry = jar.getJarEntry(path);
|
||||
|
||||
@@ -237,6 +240,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -251,6 +254,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
this.setClass(name, result); // Paper
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -251,6 +255,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -265,6 +269,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
// Paper end
|
||||
super.close();
|
||||
} finally {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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: granny <contact@granny.dev>
|
||||
Date: Fri, 26 Apr 2024 18:07:21 +0900
|
||||
Subject: [PATCH] Purpur API Changes
|
||||
|
||||
Original: PurpurMC
|
||||
Copyright (C) 2023 PurpurMC
|
||||
PurpurMC
|
||||
Copyright (C) 2024 PurpurMC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3676035ba011fb874ad6bb8995940d9bb2a0f0ae..0c557f34ed438980c6fd9d6a8bce7c1152468735 100644
|
||||
index 9164120d299d062c62529a7ef74eac0ded367993..09e541dcbbb43699b4402036b8a3cc86a0ac9aad 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -109,6 +109,8 @@ tasks.jar {
|
||||
@@ -129,6 +129,8 @@ tasks.jar {
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
@@ -168,29 +168,6 @@ index e801e79fa57c44b2e5d359647c920f88064826f1..1abfcee0f6d632f4cd8d74b4994a90c9
|
||||
return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS,
|
||||
new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
||||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..b1f35c68373edfe666ca05b50f0ec022a1859ce9 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -201,6 +201,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
|
||||
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));
|
||||
|
||||
+ // Purpur start
|
||||
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
|
||||
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
|
||||
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
|
||||
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* @deprecated removed in 1.16
|
||||
*/
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
@@ -208,11 +185,24 @@ index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48c
|
||||
class DummyVersionFetcher implements VersionFetcher {
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
index ab5fea0b03224bf249352ce340e94704ff713345..3441cdad70da1bd523c5933b1a914688718c2657 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
@@ -15,7 +15,7 @@ public class SIMDChecker {
|
||||
@Deprecated
|
||||
public static boolean canEnable(Logger logger) {
|
||||
try {
|
||||
- if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
|
||||
+ if (SIMDDetection.getJavaVersion() < 17 || SIMDDetection.getJavaVersion() > 21) {
|
||||
return false;
|
||||
} else {
|
||||
SIMDDetection.testRun = true;
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index f78b5fd3c3347d28da58777bff88903d2eb140f6..584e3b08935f43beb27f478cc72229b6a5f40689 100644
|
||||
index 9a428153f34291bdc026a71f7e60e285b7794b0c..53ce0fb2dac9c22680ab934f535b5a2037139445 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2756,4 +2756,127 @@ public final class Bukkit {
|
||||
@@ -2884,4 +2884,127 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
@@ -431,10 +421,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da3026ed0f8e 100644
|
||||
index ec117c47401ea1a04beb0e5ee9d4d394db7c5c4e..5b058d709751a5b720e209931774e09fcc9c960c 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -11047,4 +11047,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
@@ -11559,4 +11559,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||
}
|
||||
@@ -476,13 +466,13 @@ index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da30
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a322acadecc 100644
|
||||
index 30298a629b39bd43ce14b414fc697b2dfcbea89c..ce00af9121de7a910aaea4e0685a06d4cf31b4e3 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -522,4 +522,114 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -557,4 +557,106 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
*/
|
||||
@Nullable
|
||||
public Location getLastDeathLocation();
|
||||
public Location getLocation();
|
||||
+
|
||||
+ // Purpur start - OfflinePlayer API
|
||||
+ /**
|
||||
@@ -550,14 +540,6 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a32
|
||||
+ public float getWalkSpeed();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity's current position
|
||||
+ *
|
||||
+ * @return a new copy of Location containing the position of this offline player
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
@@ -595,10 +577,10 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a32
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd3fbddddd 100644
|
||||
index 4ff1b38eb65f97344257204cf018f176f247ed36..c15b0b05870a469ea5d314c9fac6a57a045f463c 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2121,6 +2121,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2235,6 +2235,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -617,7 +599,7 @@ index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -2404,4 +2416,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2518,4 +2530,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
@@ -724,10 +706,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 e6f66d70d024cf4f0536a5bf8e51bf7b306335df..07e75978b4fc0e446e8aa46a40be5e371dc1c11b 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
|
||||
@@ -4233,6 +4233,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
@@ -977,10 +959,10 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
|
||||
// Paper start
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..98de85d1382fe84cdc2e2c9db04bf1b4f157291c 100644
|
||||
index 23def071492ccd715693d534cc506936e18f0f46..706096924ffd3b578866693e2937de4182fad554 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1049,4 +1049,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1144,4 +1144,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull String getScoreboardEntryName();
|
||||
// Paper end - entity scoreboard name
|
||||
@@ -1062,7 +1044,7 @@ index 655e37cb3a09610a3f3df805d6dcad17d722da62..09fd716c8fc9ea34a1cbf87bcbe22df0
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a710da952 100644
|
||||
index bcc6ba95bd21c7972865838c636a03f50b6c1f1a..c3fcd8dd7dbb1e1a18e17c014c1e641149ea5960 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -153,4 +153,62 @@ public interface Item extends Entity, io.papermc.paper.entity.Frictional { // Pa
|
||||
@@ -1129,13 +1111,13 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 19e58e62ae442ef9be02ca7fa2f55e370a54afa4..994e026d68fcda9a4c34a8b161a06623f4437dff 100644
|
||||
index 65112eae8b92344796850b1e4c89e75443eab2fe..5369d802d37863a1efc0c031520147ceedcadc78 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1192,4 +1192,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1445,4 +1445,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
void setBodyYaw(float bodyYaw);
|
||||
// Paper end
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -1200,10 +1182,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 d048ae07cc33fd77d128cc1ebf88b0804969fa3c..8bbbdad40bc6a1932d8f79ec95c0a92037b3dac5 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
|
||||
@@ -3752,4 +3752,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
@@ -1232,31 +1214,11 @@ index f9dd00210c1762a40259f823aeb8d8a5ddc78e3e..9193288438671409cc3cf92033ef7cb6
|
||||
+
|
||||
+ /**
|
||||
+ * Reset the idle timer back to 0
|
||||
+ * @deprecated Use {@link #resetIdleDuration()} instead
|
||||
+ */
|
||||
+ void resetIdleTimer();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
|
||||
+ *
|
||||
+ * @return True if invulnerable
|
||||
+ */
|
||||
+ boolean isSpawnInvulnerable();
|
||||
+
|
||||
+ /**
|
||||
+ * Get invulnerable ticks remaining
|
||||
+ *
|
||||
+ * @return Invulnerable ticks
|
||||
+ */
|
||||
+ int getSpawnInvulnerableTicks();
|
||||
+
|
||||
+ /**
|
||||
+ * Set invulnerable ticks remaining
|
||||
+ *
|
||||
+ * @param invulnerableTicks Invulnerable ticks remaining
|
||||
+ */
|
||||
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
@@ -1441,6 +1403,20 @@ index 84db38388bf7a58e66d6cd29620b4fe64b0a897e..82ebd99549ce9f9e6427a50cef424e90
|
||||
+ public void setRabid(boolean rabid);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
index 446b3ffd5caca5344be1c250475679834cd0d4a2..3da8d3d8925cd7a111c0c357bceecfd3a801c8eb 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
@@ -303,7 +303,8 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
WORLD_BORDER,
|
||||
/**
|
||||
* Damage caused when an entity contacts a block such as a Cactus,
|
||||
- * Dripstone (Stalagmite) or Berry Bush.
|
||||
+ * Dripstone (Stalagmite) or Berry Bush. (Stonecutters too if you
|
||||
+ * have the Stonecutter damage Purpur feature enabled)
|
||||
* <p>
|
||||
* Damage: variable
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||
index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d94108275629 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||
@@ -1459,10 +1435,10 @@ index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d941
|
||||
* When a player gets bad omen after killing a patrol captain.
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
index cbce826add9dc2b3187c7bea00c27b785d7517df..3a98de6407d9a6307f89c207be1f09e639385ebe 100644
|
||||
index daa1306a7324d946d66ad5a674bbc84371d8d4d6..f3b2d7b6fda051211add2b3215f120fb6911aeed 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
@@ -151,7 +151,7 @@ public enum InventoryType {
|
||||
@@ -165,7 +165,7 @@ public enum InventoryType {
|
||||
SMITHING_NEW(4, "Upgrade Gear"),
|
||||
;
|
||||
|
||||
@@ -1488,10 +1464,29 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
|
||||
+ boolean canDoUnsafeEnchants();
|
||||
+
|
||||
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index f680545b6b59bf8d2ad154b0472dda4cba42a162..58a62ba0635f9158bf18043da89aba7521e0e2e1 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -353,4 +353,14 @@ public interface ItemFactory {
|
||||
*/
|
||||
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
|
||||
// Paper end - enchantWithLevels API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Returns the lines of text shown when hovering over an item
|
||||
+ * @param itemStack The ItemStack
|
||||
+ * @param advanced Whether advanced tooltips are shown
|
||||
+ * @return the list of Components
|
||||
+ */
|
||||
+ @NotNull java.util.List<net.kyori.adventure.text.@NotNull Component> getHoverLines(@NotNull ItemStack itemStack, boolean advanced);
|
||||
+ // 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 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af9185c3c2 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,10 +1508,10 @@ index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -986,4 +998,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return livingEntity.damageItemStack(this, amount);
|
||||
@@ -1061,4 +1073,635 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - expose itemstack tooltip lines
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -2138,10 +2133,19 @@ index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79
|
||||
+ }
|
||||
+ return random.nextInt(unbreaking + 1) > 0;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the lines of text shown when hovering over the item
|
||||
+ * @param advanced Whether advanced tooltips are shown
|
||||
+ * @return the list of Components
|
||||
+ */
|
||||
+ public @NotNull List<net.kyori.adventure.text.@NotNull Component> getHoverLines(boolean advanced) {
|
||||
+ return Bukkit.getItemFactory().getHoverLines(this, advanced);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
index 523818cbb0d6c90481ec97123e7fe0e2ff4eea14..bfeb8171a723d84b94bfaacd8aaf7d4d48ecd051 100644
|
||||
index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199899bd364 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
|
||||
@@ -2238,10 +2242,10 @@ index 301e82369603f3dd6e6c1bd380da4bacacd7ef6c..0c6ca7588fb3d6b6497ddf032fe75e5c
|
||||
/**
|
||||
* This class was not meant to be constructed explicitly
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a0a9ec796 100644
|
||||
index 653135352c104a6ddeb74a1b6d4916c6952d6271..46b0d02aa759b3735e6ac811523d459cf263aa8b 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
@@ -65,6 +65,7 @@ public class LibraryLoader
|
||||
@@ -66,6 +66,7 @@ public class LibraryLoader
|
||||
@Override
|
||||
public void transferStarted(@NotNull TransferEvent event) throws TransferCancelledException
|
||||
{
|
||||
@@ -2249,7 +2253,7 @@ index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a
|
||||
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
|
||||
}
|
||||
} );
|
||||
@@ -80,6 +81,7 @@ public class LibraryLoader
|
||||
@@ -81,6 +82,7 @@ public class LibraryLoader
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -2257,7 +2261,7 @@ index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a
|
||||
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
|
||||
@@ -118,6 +120,7 @@ public class LibraryLoader
|
||||
@@ -119,6 +121,7 @@ public class LibraryLoader
|
||||
}
|
||||
|
||||
jarFiles.add( url );
|
||||
@@ -2266,18 +2270,10 @@ index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f026703cb80 100644
|
||||
index c8ab330ef171795d08fa201cf8320703c7f1c66b..93e2ea220dc03c122f82af65d5e9fda5b582290c 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import org.bukkit.Color;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.configuration.serialization.SerializableAs;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -31,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -33,6 +33,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
private static final String AMBIENT = "ambient";
|
||||
private static final String PARTICLES = "has-particles";
|
||||
private static final String ICON = "has-icon";
|
||||
@@ -2285,34 +2281,46 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
private final int amplifier;
|
||||
private final int duration;
|
||||
private final PotionEffectType type;
|
||||
private final boolean ambient;
|
||||
@@ -40,6 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
private final boolean particles;
|
||||
private final boolean icon;
|
||||
private final PotionEffect hiddenEffect; // Paper
|
||||
+ @Nullable private final NamespacedKey key; // Purpur
|
||||
|
||||
/**
|
||||
* Creates a potion effect.
|
||||
@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -50,11 +52,12 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
|
||||
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
|
||||
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
* @param hiddenEffect the hidden PotionEffect
|
||||
* @hidden Internal-- hidden effects are only shown internally
|
||||
*/
|
||||
@org.jetbrains.annotations.ApiStatus.Internal // Paper
|
||||
- public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect) { // Paper
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect, @Nullable NamespacedKey key) { // Paper // Purpur
|
||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this.ambient = ambient;
|
||||
this.particles = particles;
|
||||
this.icon = icon;
|
||||
+ this.key = key; // Purpur
|
||||
// Paper start
|
||||
this.hiddenEffect = hiddenEffect;
|
||||
}
|
||||
@@ -77,10 +81,27 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
||||
*/
|
||||
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
|
||||
+ // Purpur start
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create a potion effect.
|
||||
+ * @param duration measured in ticks, see {@link
|
||||
+ * PotionEffect#getDuration()}
|
||||
+ * @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
|
||||
+ * @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
|
||||
+ * @param particles the particle status, see {@link PotionEffect#hasParticles()}
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
+ */
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, @Nullable NamespacedKey key) {
|
||||
+ this(type, duration, amplifier, ambient, particles, particles, key);
|
||||
+ }
|
||||
+
|
||||
- this(type, duration, amplifier, ambient, particles, icon, null);
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null, null); // Purpur
|
||||
// Paper end
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Creates a potion effect.
|
||||
+ * @param type effect type
|
||||
@@ -2325,24 +2333,19 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
+ */
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable NamespacedKey key) {
|
||||
+ // Purpur end
|
||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this.ambient = ambient;
|
||||
this.particles = particles;
|
||||
this.icon = icon;
|
||||
+ this.key = key; // Purpur - add key
|
||||
}
|
||||
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null, key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* Creates a potion effect with no defined color.
|
||||
*
|
||||
@@ -126,33 +147,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param map the map to deserialize from
|
||||
*/
|
||||
public PotionEffect(@NotNull Map<String, Object> map) {
|
||||
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)));
|
||||
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), getKey(map)); // Purpur - getKey
|
||||
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT)); // Paper
|
||||
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT), getKey(map)); // Paper // Purpur - getKey
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -2376,6 +2379,10 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
|
||||
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,6 +190,13 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
@@ -2387,8 +2394,8 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
+
|
||||
@NotNull
|
||||
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
|
||||
int type = getInt(map, TYPE);
|
||||
@@ -159,17 +200,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
PotionEffectType effect;
|
||||
@@ -201,6 +229,17 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return def;
|
||||
}
|
||||
|
||||
@@ -2406,40 +2413,28 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@Override
|
||||
@NotNull
|
||||
public Map<String, Object> serialize() {
|
||||
- return ImmutableMap.<String, Object>builder()
|
||||
- .put(TYPE, type.getId())
|
||||
- .put(DURATION, duration)
|
||||
- .put(AMPLIFIER, amplifier)
|
||||
- .put(AMBIENT, ambient)
|
||||
- .put(PARTICLES, particles)
|
||||
- .put(ICON, icon)
|
||||
- .build();
|
||||
+ // Purpur start - add key, don't serialize if null.
|
||||
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
|
||||
+ .put(TYPE, type.getId())
|
||||
+ .put(DURATION, duration)
|
||||
+ .put(AMPLIFIER, amplifier)
|
||||
+ .put(AMBIENT, ambient)
|
||||
+ .put(PARTICLES, particles)
|
||||
+ .put(ICON, icon);
|
||||
+ if(key != null) {
|
||||
@@ -215,6 +254,11 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
if (this.hiddenEffect != null) {
|
||||
builder.put(HIDDEN_EFFECT, this.hiddenEffect);
|
||||
}
|
||||
+ // Purpur start
|
||||
+ if (key != null) {
|
||||
+ builder.put(KEY, key.toString());
|
||||
+ }
|
||||
+ return builder.build();
|
||||
+ // Purpur end
|
||||
return builder.build();
|
||||
// Paper end
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -243,7 +287,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return false;
|
||||
}
|
||||
PotionEffect that = (PotionEffect) obj;
|
||||
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon;
|
||||
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && this.key == that.key; // Purpur - add key
|
||||
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect); // Paper
|
||||
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect) && this.key == that.key; // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -339,6 +383,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -2464,12 +2459,12 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 1;
|
||||
@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -354,6 +416,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
- return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "");
|
||||
+ return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "") + (hasKey() ? "(" + key + ")" : ""); // Purpur - add key if not null
|
||||
- return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + '}'; // Paper
|
||||
+ return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + ", key=" + key + '}'; // Paper // Purpur - add key
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
|
||||
@@ -4129,7 +4124,7 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6ce
|
||||
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
index 06e96e5c98f1a7a68c8b4b5e527314c1aa774e38..49bba9a7a02b9cf3a552583315eff2b7dbe060c0 100644
|
||||
index 88f1ca89fa640a686231b8eec87e70419b2d73ef..d6b91c49a267c89d7df2ddee7ccfe64675d117be 100644
|
||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
@@ -47,6 +47,10 @@ public class AnnotationTest {
|
||||
|
||||
115
patches/api/0003-Use-Gradle-Version-Catalogs.patch
Normal file
115
patches/api/0003-Use-Gradle-Version-Catalogs.patch
Normal file
@@ -0,0 +1,115 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 14 Jan 2024 19:50:29 +0900
|
||||
Subject: [PATCH] Use Gradle Version Catalogs
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 09e541dcbbb43699b4402036b8a3cc86a0ac9aad..085cdd8ccdc27f94b22baab7ea4ac0d02769378f 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,11 +9,13 @@ java {
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
+/* // Plazma - Use Gradle Version Catalogs
|
||||
val annotationsVersion = "24.0.1"
|
||||
val bungeeCordChatVersion = "1.20-R0.2"
|
||||
val adventureVersion = "4.16.0"
|
||||
val slf4jVersion = "2.0.9"
|
||||
val log4jVersion = "2.17.1"
|
||||
+ */ // Plazma - Use Gradle Version Catalogs
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -27,6 +29,7 @@ configurations.api {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
+ /* // Plazma - Use Gradle Version Catalogs
|
||||
// api dependencies are listed transitively to API consumers
|
||||
api("com.google.guava:guava:32.1.2-jre")
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
@@ -39,6 +42,34 @@ dependencies {
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
+ // Plazma start - Use Gradle Version Catalogs
|
||||
+ */
|
||||
+ implementation(common.bundles.asm)
|
||||
+
|
||||
+ api(api.bundles.api)
|
||||
+ api(common.snakeyaml)
|
||||
+ api(common.log4j.api)
|
||||
+ api(common.maven.provider)
|
||||
+ api(api.jsonsimple) {
|
||||
+ isTransitive = false // includes junit
|
||||
+ }
|
||||
+
|
||||
+ apiAndDocs(common.bundles.adventure)
|
||||
+ apiAndDocs(platform(common.adventure.bom))
|
||||
+
|
||||
+ compileOnly(api.findbugs)
|
||||
+ compileOnly(api.annotations)
|
||||
+ compileOnly(common.bundles.maven)
|
||||
+
|
||||
+ compileOnlyApi(api.checkerqual)
|
||||
+
|
||||
+ testImplementation(common.asm.tree)
|
||||
+ testImplementation(common.bundles.test)
|
||||
+ testImplementation(common.commons.lang3)
|
||||
+
|
||||
+ testCompileOnly(api.bundles.annotations)
|
||||
+ /*
|
||||
+ // Plazma end - Use Gradle Version Catalogs
|
||||
isTransitive = false // includes junit
|
||||
}
|
||||
api("it.unimi.dsi:fastutil:8.5.6")
|
||||
@@ -76,6 +107,7 @@ dependencies {
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
+ */ // Plazma - Use Gradle Version Catalogs
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -136,25 +168,25 @@ tasks.withType<Javadoc> {
|
||||
options.use()
|
||||
options.isDocFilesSubDirs = true
|
||||
options.links(
|
||||
- "https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||
- "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
||||
- "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
|
||||
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
|
||||
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/", // Paper - we don't want Java 5 annotations
|
||||
// "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
|
||||
// Paper start - add missing javadoc links
|
||||
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
|
||||
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
||||
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
|
||||
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
|
||||
// Paper end
|
||||
// Paper start
|
||||
- "https://jd.advntr.dev/api/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-minimessage/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
||||
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
|
||||
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
|
||||
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-minimessage/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-serializer-gson/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-serializer-legacy/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-serializer-plain/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
|
||||
// Paper end
|
||||
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
|
||||
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}", // Paper
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 12:43:06 +0900
|
||||
Subject: [PATCH] Bump-Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 0c557f34ed438980c6fd9d6a8bce7c1152468735..8f1fbec343461c83a6df141f7aa939e26e6e139e 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -11,8 +11,8 @@ java {
|
||||
val annotationsVersion = "24.0.1"
|
||||
val bungeeCordChatVersion = "1.20-R0.1"
|
||||
val adventureVersion = "4.14.0"
|
||||
-val slf4jVersion = "1.8.0-beta4"
|
||||
-val log4jVersion = "2.17.1"
|
||||
+val slf4jVersion = "2.0.9" // Plazma - Bump Dependencies
|
||||
+val log4jVersion = "2.20.0" // Plazma - Bump Dependencies
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -27,16 +27,16 @@ configurations.api {
|
||||
|
||||
dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
- api("com.google.guava:guava:31.1-jre")
|
||||
- api("com.google.code.gson:gson:2.10")
|
||||
+ api("com.google.guava:guava:32.1.2-jre") // Plazma - Bump Dependencies
|
||||
+ api("com.google.code.gson:gson:2.10.1") // Plazma - Bump Dependencies
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
|
||||
- api("org.yaml:snakeyaml:2.0")
|
||||
+ api("org.yaml:snakeyaml:2.2") // Plazma - Bump Dependencies
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
isTransitive = false // includes junit
|
||||
}
|
||||
- api("it.unimi.dsi:fastutil:8.5.6")
|
||||
+ api("it.unimi.dsi:fastutil:8.5.12") // Plazma - Bump Dependencies
|
||||
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
|
||||
apiAndDocs("net.kyori:adventure-api")
|
||||
apiAndDocs("net.kyori:adventure-text-minimessage")
|
||||
@@ -46,31 +46,31 @@ dependencies {
|
||||
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
- api("io.sentry:sentry:5.4.0") // Pufferfish
|
||||
+ api("io.sentry:sentry:6.28.0") // Pufferfish // Plazma - Bump Dependencies
|
||||
|
||||
- implementation("org.ow2.asm:asm:9.4")
|
||||
- implementation("org.ow2.asm:asm-commons:9.4")
|
||||
+ implementation("org.ow2.asm:asm:9.5") // Plazma - Bump Dependencies
|
||||
+ implementation("org.ow2.asm:asm-commons:9.5") // Plazma - Bump Dependencies
|
||||
// Paper end
|
||||
|
||||
- api("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
- compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
|
||||
+ api("org.apache.maven:maven-resolver-provider:3.9.4") // Plazma - Bump Dependencies
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
|
||||
+ compileOnly("com.google.code.findbugs:jsr305:3.0.2") // Paper // Plazma - Bump Dependencies
|
||||
|
||||
val annotations = "org.jetbrains:annotations:$annotationsVersion" // Paper - we don't want Java 5 annotations...
|
||||
compileOnly(annotations)
|
||||
testCompileOnly(annotations)
|
||||
|
||||
// Paper start - add checker
|
||||
- val checkerQual = "org.checkerframework:checker-qual:3.21.0"
|
||||
+ val checkerQual = "org.checkerframework:checker-qual:3.38.0" // Plazma - Bump Dependencies
|
||||
compileOnlyApi(checkerQual)
|
||||
testCompileOnly(checkerQual)
|
||||
// Paper end
|
||||
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - add mockito
|
||||
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - add mockito // Plazma - Bump Dependencies
|
||||
|
||||
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
- testImplementation("junit:junit:4.13.2")
|
||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
|
||||
+ testImplementation("junit:junit:4.13.2") // Plazma - Bump Dependencies
|
||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
|
||||
testImplementation("org.ow2.asm:asm-tree:9.5")
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@ Subject: [PATCH] Plazma Configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index aaef58468a3c31f35e5067ed4263e9dd3fbddddd..0852f1a18106a81a60726756aae1d9c2ba30b111 100644
|
||||
index c15b0b05870a469ea5d314c9fac6a57a045f463c..b55834f2477d18290b2985685eeeb249114dca67 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2247,6 +2247,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Plazma Configuration API
|
||||
+ @NotNull
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getPlazmaConfiguration() {
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getPlazmaConfig() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// Purpur start
|
||||
@NotNull
|
||||
public org.bukkit.configuration.file.YamlConfiguration getPurpurConfig() {
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:04:25 +0900
|
||||
Subject: [PATCH] Optimize-spigot-event-bus
|
||||
Subject: [PATCH] Optimize Spigot event bus
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
|
||||
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c01cb205e 100644
|
||||
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..f1b3559bf9d2023ca59330c65e6e34714759dd9d 100644
|
||||
--- a/src/main/java/org/bukkit/event/Event.java
|
||||
+++ b/src/main/java/org/bukkit/event/Event.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -48,7 +48,7 @@ index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c
|
||||
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
|
||||
+ return this.async;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Optimize Spigot event bus
|
||||
+
|
||||
// Paper start
|
||||
/**
|
||||
@@ -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
|
||||
19
patches/api/0006-Implement-No-Chat-Reports.patch
Normal file
19
patches/api/0006-Implement-No-Chat-Reports.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 28 Sep 2023 12:21:36 +0900
|
||||
Subject: [PATCH] Implement No Chat Reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
index f7f864a2b46129e4d61bc87f3e23c343417aa094..eb3cc41388a210f000bf637bfae135081bee51e9 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
@@ -216,6 +216,8 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
||||
* Fallback cause
|
||||
*/
|
||||
UNKNOWN,
|
||||
+
|
||||
+ NCR_NOT_INSTALLED, // Plazma - Implement No Chat Reports
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <contact@granny.dev>
|
||||
Date: Thu, 18 Jan 2024 21:01:12 +0900
|
||||
Subject: [PATCH] Purpur Generated API Changes
|
||||
|
||||
PurpurMC
|
||||
Copyright (C) 2024 PurpurMC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 069f2668f5229b0368b796e65eef1648fba0a097..9b991201a2f6cc9feccccf7f4e7bcded64117764 100644
|
||||
--- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -442,6 +442,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
|
||||
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
|
||||
|
||||
+ // Purpur start
|
||||
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
|
||||
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
|
||||
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
|
||||
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Removed in 1.20.2
|
||||
*/
|
||||
19
patches/mojang-api/0001-Rebrand.patch
Normal file
19
patches/mojang-api/0001-Rebrand.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alpha <dev@alpha93.kr>
|
||||
Date: Tue, 27 Feb 2024 18:36:43 +0900
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index a278ee93d7001e8dc7fd2f5409c2f528c637cb2f..a00cf1659f1fd9dff3ff34561d78732645b51dfb 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,7 +9,7 @@ java {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":paper-api"))
|
||||
+ implementation(project(":plazma-api")) // Plazma - Rebrand
|
||||
api("com.mojang:brigadier:1.0.18")
|
||||
|
||||
compileOnly("it.unimi.dsi:fastutil:8.5.6")
|
||||
19
patches/placeholder/server/0007-Development-Build.patch
Normal file
19
patches/placeholder/server/0007-Development-Build.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 26 Jan 2024 15:34:53 +0900
|
||||
Subject: [PATCH] Development Build
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index b04d3eea789f77b2435cb0192635f1be1bab597d..a58ce2c893d8c755ab3027207d512542d2d57c36 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -24,7 +24,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static int distance = -2; public int distance() { return distance; }
|
||||
// Purpur end
|
||||
private static @Nullable String mcVer;
|
||||
- private static final boolean DEVELOPMENT = false; // Plazma
|
||||
+ private static final boolean DEVELOPMENT = true; // Plazma
|
||||
|
||||
@Override
|
||||
public long getCacheTime() {
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,75 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Tue, 30 May 2023 12:12:29 +0900
|
||||
Subject: [PATCH] MC Dev fixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||
index 11ae164cce84081843518953bbeaf29904334fa9..131a0bb93c0711cc657c5571f3d8313b4bf154a8 100644
|
||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||
@@ -71,14 +71,14 @@ public class LeavesFix extends DataFix {
|
||||
return this.fixTypeEverywhereTyped("Leaves fix", type, (typed) -> {
|
||||
return typed.updateTyped(opticFinder, (typedx) -> {
|
||||
int[] is = new int[]{0};
|
||||
- Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed) -> {
|
||||
- Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed.getAllTyped(opticFinder3).stream().map((typedx) -> {
|
||||
- return new LeavesFix.LeavesSection(typedx, this.getInputSchema());
|
||||
+ Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed2x) -> {
|
||||
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> {
|
||||
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema());
|
||||
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
|
||||
return leavesSection;
|
||||
})));
|
||||
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
|
||||
- return typed;
|
||||
+ return typed2x;
|
||||
} else {
|
||||
List<IntSet> list = Lists.newArrayList();
|
||||
|
||||
@@ -134,8 +134,8 @@ public class LeavesFix extends DataFix {
|
||||
}
|
||||
}
|
||||
|
||||
- return typed.updateTyped(opticFinder3, (typedx) -> {
|
||||
- return int2ObjectMap.get(typedx.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx);
|
||||
+ return typed.updateTyped(opticFinder3, (typedx2) -> {
|
||||
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -298,8 +298,8 @@ public class LeavesFix extends DataFix {
|
||||
throw new IllegalStateException("Block state type is not what was expected.");
|
||||
} else {
|
||||
Optional<List<Pair<String, Dynamic<?>>>> optional = typed.getOptional(this.paletteFinder);
|
||||
- this.palette = optional.map((list) -> {
|
||||
- return list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
||||
+ this.palette = (java.util.List)optional.map((list) -> {
|
||||
+ return (java.util.List)list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
||||
}).orElse(ImmutableList.of());
|
||||
Dynamic<?> dynamic = typed.get(DSL.remainderFinder());
|
||||
this.index = dynamic.get("Y").asInt(0);
|
||||
@@ -321,7 +321,7 @@ public class LeavesFix extends DataFix {
|
||||
public Typed<?> write(Typed<?> typed) {
|
||||
return this.isSkippable() ? typed : typed.update(DSL.remainderFinder(), (dynamic) -> {
|
||||
return dynamic.set("BlockStates", dynamic.createLongList(Arrays.stream(this.storage.getRaw())));
|
||||
- }).set(this.paletteFinder, this.palette.stream().map((dynamic) -> {
|
||||
+ }).set(this.paletteFinder, (java.util.List)this.palette.stream().map((dynamic) -> {
|
||||
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java b/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
||||
index 6e971a9891e43b971d439c3ca11eff8965f3dae9..da1b5c6b68f14969b85472826d3d36ca673a0e5a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/entries/EntryGroup.java
|
||||
@@ -31,8 +31,8 @@ public class EntryGroup extends CompositeEntryBase {
|
||||
};
|
||||
default:
|
||||
return (context, lootChoiceExpander) -> {
|
||||
- for(ComposableEntryContainer composableEntryContainer : children) {
|
||||
- composableEntryContainer.expand(context, lootChoiceExpander);
|
||||
+ for(ComposableEntryContainer composableEntryContainer3 : children) { // Plazma - decompile fix
|
||||
+ composableEntryContainer3.expand(context, lootChoiceExpander);
|
||||
}
|
||||
|
||||
return true;
|
||||
87
patches/server/0003-Use-Gradle-Version-Catalogs.patch
Normal file
87
patches/server/0003-Use-Gradle-Version-Catalogs.patch
Normal file
@@ -0,0 +1,87 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 14 Jan 2024 19:51:19 +0900
|
||||
Subject: [PATCH] Use Gradle Version Catalogs
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 1cad0728d..b97182b80 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -19,21 +19,38 @@ dependencies {
|
||||
exclude("io.papermc.paper", "paper-api")
|
||||
}
|
||||
// Purpur end
|
||||
+ // Plazma start - Use Gradle version catalogs
|
||||
+ /*
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
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
|
||||
- /*
|
||||
- Required to add the missing Log4j2Plugins.dat file from log4j-core
|
||||
- which has been removed by Mojang. Without it, log4j has to classload
|
||||
- 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
|
||||
+ */
|
||||
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
|
||||
+
|
||||
+ implementation(common.log4j.core)
|
||||
+ implementation(common.log4j.iostreams)
|
||||
+ implementation(common.snakeyaml)
|
||||
+ implementation(common.bundles.asm)
|
||||
+ implementation(common.commons.lang2)
|
||||
+ implementation(common.adventure.serializer.ansi)
|
||||
+ implementation(server.ansi)
|
||||
+ implementation(server.bundles.implementation)
|
||||
+
|
||||
+ runtimeOnly(common.bundles.maven)
|
||||
+ runtimeOnly(common.maven.provider)
|
||||
+ runtimeOnly(server.bundles.runtime)
|
||||
runtimeOnly(log4jPlugins.output)
|
||||
+
|
||||
alsoShade(log4jPlugins.output)
|
||||
+
|
||||
+ testImplementation(common.bundles.test)
|
||||
+ testImplementation(server.bundles.test)
|
||||
+
|
||||
+ /*
|
||||
implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
@@ -46,8 +63,11 @@ dependencies {
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
// Paper start - Use Velocity cipher
|
||||
implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
|
||||
+ */
|
||||
+ implementation(server.velocity) {
|
||||
isTransitive = false
|
||||
}
|
||||
+ /*
|
||||
// Paper end - Use Velocity cipher
|
||||
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
@@ -57,8 +77,11 @@ dependencies {
|
||||
// Pufferfish start
|
||||
implementation("org.yaml:snakeyaml:1.32")
|
||||
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
||||
+ */
|
||||
+ implementation(server.simpleyaml) {
|
||||
exclude(group="org.yaml", module="snakeyaml")
|
||||
}
|
||||
+ /*
|
||||
// Pufferfish end
|
||||
|
||||
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
||||
@@ -71,6 +94,7 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||
testImplementation("org.ow2.asm:asm-tree:9.7")
|
||||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
+ */
|
||||
}
|
||||
|
||||
val craftbukkitPackageVersion = "1_20_R3" // Paper
|
||||
@@ -1,33 +1,41 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@outlook.com>
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 21 Dec 2022 19:31:24 +0900
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 139e2b17b899da6f0147bb8b4412e2e54e817be4..d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7 100644
|
||||
index b97182b806fddf53ddcdbe57a43500d36e97e2a4..055627fc478a3e64b0e0644cbd9ef4cf5438c696 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
||||
@@ -13,12 +13,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
// Purpur start
|
||||
- // Purpur start
|
||||
- implementation(project(":purpur-api"))
|
||||
- implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||
- exclude("io.papermc.paper", "paper-api")
|
||||
- }
|
||||
- // Purpur end
|
||||
+ // Plazma start - Branding
|
||||
+ implementation(project(":plazma-api"))
|
||||
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||
exclude("io.papermc.paper", "paper-api")
|
||||
}
|
||||
@@ -95,7 +95,7 @@ tasks.jar {
|
||||
+ implementation(project(":plazma-mojangapi"))
|
||||
+ // Plazma end - Branding
|
||||
// Plazma start - Use Gradle version catalogs
|
||||
/*
|
||||
// Paper start
|
||||
@@ -118,7 +116,7 @@ tasks.jar {
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
|
||||
+ "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur
|
||||
+ "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur // Plazma - Setup Gradle Project
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..7d80d2cf5d607d6051e99e4b08bc1b76098a79da 100644
|
||||
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..0b3d87d2d43148e6370e7a03e0bb6074891ac800 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
@@ -35,7 +43,7 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..7d80d2cf5d607d6051e99e4b08bc1b76
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
|
||||
+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma
|
||||
+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Branding
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -44,44 +52,48 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..7d80d2cf5d607d6051e99e4b08bc1b76
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("plazma_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("plazma_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma // Plazma - Branding
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199f27babbd 100644
|
||||
index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be1bab597d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -20,7 +20,7 @@ import java.util.stream.StreamSupport;
|
||||
@@ -20,10 +20,11 @@ import java.util.stream.StreamSupport;
|
||||
public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
|
||||
// Purpur start
|
||||
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
|
||||
+ private static final String DOWNLOAD_PAGE = "https://github.com/PlazmaMC/Plazma/releases"; // Plazma
|
||||
+ private static final String DOWNLOAD_PAGE = "https://github.com/PlazmaMC/Plazma/releases"; // Plazma // Plazma - Branding
|
||||
private static int distance = -2; public int distance() { return distance; }
|
||||
// Purpur end
|
||||
private static @Nullable String mcVer;
|
||||
@@ -33,8 +33,8 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
+ private static final boolean DEVELOPMENT = false; // Plazma
|
||||
|
||||
@Override
|
||||
public long getCacheTime() {
|
||||
@@ -33,8 +34,8 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Component getVersionMessage(@Nonnull String serverVersion) {
|
||||
- String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur
|
||||
- final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur
|
||||
+ String[] parts = serverVersion.substring("git-Plazma-".length()).split("[-\\s]"); // Purpur // Plazma
|
||||
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", "ver/" + getMinecraftVersion(), parts[0]); // Purpur // Plazma
|
||||
+ String[] parts = serverVersion.substring("git-Plazma-".length()).split("[-\\s]"); // Purpur // Plazma // Plazma - Branding
|
||||
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/PlazmaBukkit", (DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma // Plazma - Branding
|
||||
final Component history = getHistory();
|
||||
|
||||
return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
|
||||
@@ -47,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -47,7 +48,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
String result = matcher.group();
|
||||
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
|
||||
} else {
|
||||
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur
|
||||
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Plazma!"); // Purpur // Plazma
|
||||
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Plazma!"); // Purpur // Plazma // Plazma - Branding
|
||||
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
||||
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
||||
}
|
||||
@@ -57,6 +57,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -57,6 +58,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
|
||||
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
||||
@@ -89,7 +101,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199
|
||||
//int distance; // Purpur - use field
|
||||
try {
|
||||
int jenkinsBuild = Integer.parseInt(versionInfo);
|
||||
@@ -65,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -65,6 +67,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
versionInfo = versionInfo.replace("\"", "");
|
||||
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
||||
}
|
||||
@@ -97,11 +109,11 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199
|
||||
+ */
|
||||
+ versionInfo = versionInfo.replace("\"", ""); // Plazma
|
||||
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo); // Plazma
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Disable CI Checking
|
||||
|
||||
switch (distance) {
|
||||
case -1:
|
||||
@@ -83,6 +89,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -83,6 +90,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +121,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199
|
||||
private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) {
|
||||
if (siteApiVersion == null) { return -1; }
|
||||
try {
|
||||
@@ -102,6 +109,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -102,6 +110,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +130,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199
|
||||
// Contributed by Techcable <Techcable@outlook.com> in GH-65
|
||||
private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) {
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index 3cb56595822799926a8141e60a42f5d1edfc6de5..19d1d136fc28d6c114f6bc44c6450d2df51c3cb9 100644
|
||||
index 3cb56595822799926a8141e60a42f5d1edfc6de5..3e32c28e1d4c157a2f00dbc6d6e9d71cb3b8f6b7 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@@ -126,40 +138,40 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..19d1d136fc28d6c114f6bc44c6450d2d
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Purpur") // Purpur
|
||||
+ .appName("Plazma") // Purpur // Plazma
|
||||
+ .appName("Plazma") // Purpur // Plazma - Branding
|
||||
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
||||
index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52658f0689 100644
|
||||
index f91ea723a1c85f6cf8c4f6dd7f182b948c2f2e81..c5a3f9c2daf3da135cccecb757353534e1688821 100644
|
||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
||||
@@ -35,7 +35,7 @@ public class CrashReport {
|
||||
@@ -37,7 +37,7 @@ public class CrashReport {
|
||||
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(cause); // Paper
|
||||
this.title = message;
|
||||
this.exception = cause;
|
||||
- this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
|
||||
+ this.systemReport.setDetail("Plazma Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma
|
||||
+ this.systemReport.setDetail("Plazma Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Branding
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
@@ -125,7 +125,7 @@ public class CrashReport {
|
||||
@@ -127,7 +127,7 @@ public class CrashReport {
|
||||
stringbuilder.append("---- Minecraft Crash Report ----\n");
|
||||
// Purpur start
|
||||
stringbuilder.append("// ");
|
||||
- stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!");
|
||||
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma
|
||||
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma - Branding
|
||||
// Purpur end
|
||||
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..a8bf67cf0c579c407befe17d735440f1128d98c4 100644
|
||||
index 4ef8eaad4485a2ee920f80556f9dda04e59d2b2a..b91c3b8ca8f840335ba6470658d82c5d71bb75e1 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 {
|
||||
@@ -105,6 +105,18 @@ 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
|
||||
@@ -167,29 +179,42 @@ index dae36c6452ccd57a436dd918547b64d59957ab0a..a8bf67cf0c579c407befe17d735440f1
|
||||
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m┗\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┛\033[38;2;239;63;187m┏\033[38;2;239;63;193m┛\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┗\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┛\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m \033[38;2;184;70;247m┏\033[38;2;179;70;247m┛\033[38;2;173;71;247m \033[38;2;168;71;248m┏\033[38;2;163;72;248m┛\033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┏\033[38;2;136;74;250m┓\033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m┏\033[38;2;109;76;252m┓\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┗\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┛\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
||||
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┏\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┛\033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m┏\033[38;2;184;70;247m┛\033[38;2;179;70;247m \033[38;2;173;71;247m┏\033[38;2;168;71;248m┛\033[38;2;163;72;248m \033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
||||
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
|
||||
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛
|
||||
+ \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[0m
|
||||
+ """);
|
||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public 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) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e6ddf69ade7ae51640569150f7db10d1afa63691..77b40f3d7162befe4da29a60b3de2b93b261412c 100644
|
||||
index 60b5e0643d933393b5473681ac9261db29fe2416..ac12ccf60b45b150982e79f32d3cdd21c4017cc8 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -925,7 +925,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -956,7 +956,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
if (!isSameThread()) {
|
||||
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PURPUR)"); // Purpur
|
||||
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PLAZMA)"); // Purpur // Plazma
|
||||
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PLAZMA)"); // Purpur // Plazma - Branding
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index ae75edfaa9e4c72f11fbb7ffc66294be47c206cc..a66dcea06424518290576c7647ae0717040586f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -57,7 +57,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
public final boolean onlineMode = this.get("online-mode", true);
|
||||
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
||||
public final String serverIp = this.get("server-ip", "");
|
||||
- public final String serverName = this.get("server-name", "Unknown Server"); // Purpur
|
||||
+ public final String serverName = this.get("server-name", "A Plazma Server"); // Purpur // Plazma - Branding
|
||||
public final boolean spawnAnimals = this.get("spawn-animals", true);
|
||||
public final boolean spawnNpcs = this.get("spawn-npcs", true);
|
||||
public final boolean pvp = this.get("pvp", true);
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326fc57c32c 100644
|
||||
index 0dec2f3762aa55cfaa7af5b357f0fe243a3b2cc6..22d32ee08ee9419685a3e17d6e443396cff895e0 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
@@ -197,7 +222,7 @@ index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326
|
||||
}
|
||||
|
||||
- final JFrame jframe = new JFrame("Purpur Minecraft server"); // Purpur
|
||||
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma
|
||||
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma - Branding
|
||||
final MinecraftServerGui servergui = new MinecraftServerGui(server);
|
||||
|
||||
jframe.setDefaultCloseOperation(2);
|
||||
@@ -205,87 +230,96 @@ index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326
|
||||
jframe.pack();
|
||||
jframe.setLocationRelativeTo((Component) null);
|
||||
jframe.setVisible(true);
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper // Purpur
|
||||
+ jframe.setName("Plazma Minecraft server"); // Paper // Purpur // Plazma
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper - Improve ServerGUI // Purpur
|
||||
+ jframe.setName("Plazma Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Branding
|
||||
|
||||
// Paper start - Add logo as frame image
|
||||
// Paper start - Improve ServerGUI
|
||||
try {
|
||||
@@ -76,7 +76,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
jframe.addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent windowevent) {
|
||||
if (!servergui.isClosing.getAndSet(true)) {
|
||||
- jframe.setTitle("Purpur Minecraft server - shutting down!"); // Purpur
|
||||
+ jframe.setTitle("Plazma Minecraft server - shutting down!"); // Purpur // Plazma
|
||||
+ jframe.setTitle("Plazma Minecraft server - shutting down!"); // Purpur // Plazma - Branding
|
||||
server.halt(true);
|
||||
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
|
||||
--- 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 {
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
|
||||
// Spigot start
|
||||
if (tickingblockentity == null) {
|
||||
- this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
||||
+ this.getCraftServer().getLogger().severe("Plazma has detected a null entity and has removed it, preventing a crash"); // Plazma
|
||||
tilesThisCycle--;
|
||||
continue;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index 81554c321a78258ff78da3801f00d0fb90b9e113..ba2eab8a835c2396fca25d7993443d5db26c9c16 100644
|
||||
index fe312b1aef579cb4bf81bdd967cf72ff880d7505..97628761958289612ada0374f56e7d8f6af21512 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -156,7 +156,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -153,7 +153,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma
|
||||
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma - Branding
|
||||
}
|
||||
|
||||
private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
|
||||
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
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 dabaf0cff6dafe8ca411996e67ead9a2cf84dfb8..b2470f03eecb1b81d3f0acbd9bc3c38f321ef3d9 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
|
||||
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
|
||||
+ private final String serverName = "Plazma"; // Paper // Pufferfish // Purpur // Plazma
|
||||
+ private final String serverName = "Plazma"; // Paper // Pufferfish // Purpur // Plazma - Branding
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 409c0e81571e23c9d535b541c61538424259d60a..d36c880012153058803b595429084adb36458741 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -141,7 +141,7 @@ public class Main {
|
||||
|
||||
this.acceptsAll(Main.asList("noconsole"), "Disables the console");
|
||||
|
||||
- this.acceptsAll(Main.asList("v", "version"), "Show the CraftBukkit Version");
|
||||
+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Branding
|
||||
|
||||
this.acceptsAll(Main.asList("demo"), "Demo mode");
|
||||
|
||||
@@ -192,7 +192,7 @@ public class Main {
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
.ofType(String.class)
|
||||
- .defaultsTo("Unknown Server")
|
||||
+ .defaultsTo("Plazma Server") // Plazma - Branding
|
||||
.describedAs("Name");
|
||||
// Paper end
|
||||
}
|
||||
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 64c73cc7370c23c9ce68b68476fd0ddb3ca6beca..cd0e9020e28ff97063bd335dcdbb32ac3225ffb3 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 {
|
||||
@@ -969,7 +969,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return EntityCategory.WATER;
|
||||
}
|
||||
|
||||
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Purpur."); // Purpur
|
||||
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Plazma."); // Purpur // Plazma
|
||||
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Plazma."); // Purpur // Plazma - Branding
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index a4567188e2fe3f922bb6aeb71a2845d1a1be536f..267555c309c44067ac0e011784870bad802bc292 100644
|
||||
index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..6bab5f9e40987d1a8ca9c17118d2a14135df5dff 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -503,7 +503,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.parsePending();
|
||||
} else {
|
||||
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma - Branding
|
||||
// We don't need to parse pending
|
||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616d4e857c6 100644
|
||||
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..73b4818998098b08abcbee4d29915492aa09b5ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -8,22 +8,25 @@ import java.util.logging.Logger;
|
||||
@@ -296,7 +330,7 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
|
||||
- String result = "Unknown-Version";
|
||||
-
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Branding & Improve Versioning
|
||||
+ public static String version = "Unknown-Version";
|
||||
+ static {
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties");
|
||||
@@ -319,10 +353,23 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
|
||||
+ public static String getBukkitVersion() {
|
||||
+ return version;
|
||||
}
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Branding & Improve Versioning
|
||||
}
|
||||
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
|
||||
index efe25d3894f3ad000257c72d9a5e06ef22446d41..a937993f318ef5703420f57fe65c5d990ce2c4dd 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -231,7 +231,7 @@ public class PurpurConfig {
|
||||
@@ -330,12 +377,12 @@ index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa453
|
||||
}
|
||||
|
||||
- public static String serverModName = "Purpur";
|
||||
+ public static String serverModName = "Plazma"; // Plazma
|
||||
+ public static String serverModName = "Plazma"; // Plazma - Branding
|
||||
private static void serverModName() {
|
||||
serverModName = getString("settings.server-mod-name", serverModName);
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 0801dea155048ac5383295f4fef9bd597b678535..efd83400279df0beafd3b8f0e82d0f3af209554a 100644
|
||||
index f7296691cb4af7814de1520347b307ff209082e4..090eb94fe8088d0ae98bfbe8bbd32a3cac2015d0 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
|
||||
@@ -343,40 +390,40 @@ index 0801dea155048ac5383295f4fef9bd597b678535..efd83400279df0beafd3b8f0e82d0f3a
|
||||
// Paper end
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur
|
||||
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Plazma bug." ); // Paper // Purpur // Plazma
|
||||
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Plazma bug." ); // Paper // Purpur // Plazma - Branding
|
||||
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
|
||||
log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
|
||||
log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
|
||||
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
|
||||
- log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/Plazma/issues" ); // Purpur // Plazma
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/Plazma/issues" ); // Purpur // Plazma - Branding
|
||||
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
||||
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
|
||||
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma
|
||||
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma - Branding
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -185,12 +185,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -184,12 +184,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
// Paper end
|
||||
} else
|
||||
{
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Branding
|
||||
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
|
||||
}
|
||||
// Paper end - Different message for short timeout
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Plazma!):" ); // Paper // Purpur // Plazma
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Plazma!):" ); // Paper // Purpur // Plazma - Branding
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -205,7 +205,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
WatchdogThread.dumpThread( thread, log );
|
||||
}
|
||||
} else {
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Branding
|
||||
}
|
||||
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@gmail.com>
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 10 Mar 2023 22:08:56 +0900
|
||||
Subject: [PATCH] Rebrand Logo
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 13:31:43 +0900
|
||||
Subject: [PATCH] Bump-Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d8b27e3f2fa1ede41125ec27e129b1e1ad42caa7..2c59ed16ea909b6535df3d1d40d83b065c03d041 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -20,7 +20,7 @@ dependencies {
|
||||
}
|
||||
// Purpur end
|
||||
// Paper start
|
||||
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
+ implementation("org.jline:jline-terminal-jansi:3.23.0") // Plazma - Bump Dependencies
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.14.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
|
||||
@@ -30,48 +30,48 @@ dependencies {
|
||||
all its classes to check if they are plugins.
|
||||
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||
*/
|
||||
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
|
||||
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
|
||||
+ implementation("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - implementation
|
||||
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - Needed to generate meta for our Log4j plugins
|
||||
runtimeOnly(log4jPlugins.output)
|
||||
alsoShade(log4jPlugins.output)
|
||||
- implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol
|
||||
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
|
||||
// Paper end
|
||||
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
- implementation("org.ow2.asm:asm:9.4")
|
||||
- implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0") // Paper - remove exclusion
|
||||
+ implementation("org.ow2.asm:asm:9.5")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
|
||||
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - switch to mockito
|
||||
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
- implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
- runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
// Paper start - Use Velocity cipher
|
||||
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
|
||||
+ implementation("com.velocitypowered:velocity-native:3.2.0-SNAPSHOT") {
|
||||
isTransitive = false
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.4")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15")
|
||||
|
||||
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
||||
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
||||
implementation("dev.omega24:upnp4j:1.0") // Purpur
|
||||
|
||||
// Pufferfish start
|
||||
- implementation("org.yaml:snakeyaml:1.32")
|
||||
+ implementation("org.yaml:snakeyaml:2.2")
|
||||
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
||||
exclude(group="org.yaml", module="snakeyaml")
|
||||
}
|
||||
// Pufferfish end
|
||||
|
||||
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||
+ testImplementation("io.github.classgraph:classgraph:4.8.162") // Paper - mob goal test
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
- testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.hamcrest:hamcrest-library:2.2")
|
||||
|
||||
- implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty
|
||||
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty
|
||||
}
|
||||
|
||||
val craftbukkitPackageVersion = "1_20_R1" // Paper
|
||||
@@ -225,3 +225,6 @@ tasks.registerRunTask("runDev") {
|
||||
description = "Spin up a non-relocated Mojang-mapped test server"
|
||||
classpath(sourceSets.main.map { it.runtimeClasspath })
|
||||
}
|
||||
+repositories {
|
||||
+ mavenCentral()
|
||||
+}
|
||||
1109
patches/server/0006-Reduce-allocations.patch
Normal file
1109
patches/server/0006-Reduce-allocations.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,75 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 24 Mar 2023 23:54:51 +0900
|
||||
Subject: [PATCH] Add more metrics
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..067bcbcb81802a3a52ecff737ddf2c033696ecfb 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -636,12 +636,63 @@ public class Metrics {
|
||||
return map;
|
||||
}));
|
||||
|
||||
+ // Plazma start
|
||||
+ metrics.addCustomChart(new Metrics.DrilldownPie("datapacks", () -> {
|
||||
+ Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
+ int datapacks = Bukkit.getServer().getDatapackManager().getEnabledPacks().size();
|
||||
+ Map<String, Integer> entry = new HashMap<>();
|
||||
+ entry.put(String.valueOf(datapacks), 1);
|
||||
+
|
||||
+ if (datapacks == 0)
|
||||
+ map.put("0", entry);
|
||||
+ else if (datapacks <= 5)
|
||||
+ map.put("1-5", entry);
|
||||
+ else if (datapacks <= 10)
|
||||
+ map.put("6-10", entry);
|
||||
+ else if (datapacks <= 25)
|
||||
+ map.put("11-25", entry);
|
||||
+ else
|
||||
+ map.put("26+", entry);
|
||||
+
|
||||
+ return map;
|
||||
+ }));
|
||||
+
|
||||
+ List<Plugin> plugins = new ArrayList<>();
|
||||
+ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||
+ if (plugin.isEnabled()) {
|
||||
+ plugins.add(plugin);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ metrics.addCustomChart(new Metrics.DrilldownPie("plugins", () -> {
|
||||
+ Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
+ int plugins1 = plugins.size();
|
||||
+ Map<String, Integer> entry = new HashMap<>();
|
||||
+ entry.put(String.valueOf(plugins1), 1);
|
||||
+
|
||||
+ if (plugins1 == 0)
|
||||
+ map.put("0", entry);
|
||||
+ else if (plugins1 <= 5)
|
||||
+ map.put("1-5", entry);
|
||||
+ else if (plugins1 <= 10)
|
||||
+ map.put("6-10", entry);
|
||||
+ else if (plugins1 <= 25)
|
||||
+ map.put("11-25", entry);
|
||||
+ else if (plugins1 <= 50)
|
||||
+ map.put("26-50", entry);
|
||||
+ else
|
||||
+ map.put("51+", entry);
|
||||
+
|
||||
+ return map;
|
||||
+ }));
|
||||
+ // Plazma end
|
||||
+
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
|
||||
// count legacy plugins
|
||||
int legacy = 0;
|
||||
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||
+ for (Plugin plugin : plugins) { // Plazma
|
||||
if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
||||
legacy++;
|
||||
}
|
||||
99
patches/server/0008-Setup-basic-configuration-sections.patch
Normal file
99
patches/server/0008-Setup-basic-configuration-sections.patch
Normal file
@@ -0,0 +1,99 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 10:47:05 +0900
|
||||
Subject: [PATCH] Setup basic configuration sections
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d8006ae086c18a4ef43906d516eba0d5fd397f5f..57d29f8f3bc89529db9ee8f6dc3fffdbd4a03ceb 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -3,6 +3,7 @@ package org.plazmamc.plazma.configurations;
|
||||
import io.papermc.paper.configuration.Configuration;
|
||||
import io.papermc.paper.configuration.ConfigurationPart;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+import org.spongepowered.configurate.objectmapping.meta.PostProcess;
|
||||
import org.spongepowered.configurate.objectmapping.meta.Setting;
|
||||
|
||||
@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"})
|
||||
@@ -23,4 +24,43 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@Setting(Configuration.VERSION_FIELD)
|
||||
int version = VERSION;
|
||||
|
||||
+ public Player player;
|
||||
+ public class Player extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ @Setting("world-generation")
|
||||
+ public WorldGeneration worldgen;
|
||||
+ public class WorldGeneration extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Entity entity;
|
||||
+ public class Entity extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ @PostProcess
|
||||
+ public void post() {
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public World world;
|
||||
+ public class World extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ @PostProcess
|
||||
+ public void post() {
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Miscellaneous misc;
|
||||
+ public class Miscellaneous extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..42d639688b6f0b9ff53debf49a920f5c8e232a19 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -19,4 +19,32 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@Setting(Configuration.VERSION_FIELD)
|
||||
int version = VERSION;
|
||||
|
||||
+ public Miscellaneous misc;
|
||||
+ public class Miscellaneous extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Entity entity;
|
||||
+ public class Entity extends ConfigurationPart {
|
||||
+
|
||||
+ public Phantom phantom;
|
||||
+ public class Phantom extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Structure structure;
|
||||
+ public class Structure extends ConfigurationPart {
|
||||
+
|
||||
+ public NetherPortal netherPortal;
|
||||
+ public class NetherPortal extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -1,452 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
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
|
||||
--- 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 {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int maxProjectileLoadsPerProjectile;
|
||||
private static void projectileLoading() {
|
||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
- maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma
|
||||
+ maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
|
||||
setComment("projectile", "Optimizes projectile settings");
|
||||
}
|
||||
@@ -225,16 +225,16 @@ public class PufferfishConfig {
|
||||
public static int activationDistanceMod;
|
||||
|
||||
private static void dynamicActivationOfBrains() throws IOException {
|
||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||
- startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Purpur // Plazma
|
||||
+ startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
"This value determines how far away an entity has to be",
|
||||
"from the player to start being effected by DEAR.");
|
||||
startDistanceSquared = startDistance * startDistance;
|
||||
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
||||
"This value defines how often in ticks, the furthest entity",
|
||||
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
||||
- "This value defines how much distance modifies an entity's",
|
||||
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 7, // Plazma
|
||||
+ "This value defines how much distance modifies an entity's",
|
||||
"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.");
|
||||
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
|
||||
--- 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 {
|
||||
|
||||
public class Watchdog extends ConfigurationPart {
|
||||
public int earlyWarningEvery = 5000;
|
||||
- public int earlyWarningDelay = 10000;
|
||||
+ public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations
|
||||
}
|
||||
|
||||
public SpamLimiter spamLimiter;
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index da7c899fbab162ee197a0593f455ebd9c5286d3c..f2f20730ac4602dea996948e525a40ec6520ed09 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 {
|
||||
|
||||
public class AntiXray extends ConfigurationPart {
|
||||
public boolean enabled = false;
|
||||
- public EngineMode engineMode = EngineMode.HIDE;
|
||||
+ public EngineMode engineMode = Boolean.getBoolean("Plazma.disableConfigOptimization") ? EngineMode.HIDE : EngineMode.OBFUSCATE_LAYER; // Plazma - Optimize Default Configurations
|
||||
public int maxBlockHeight = 64;
|
||||
public int updateRadius = 2;
|
||||
public boolean lavaObscures = false;
|
||||
public boolean usePermission = false;
|
||||
- public List<String> hiddenBlocks = List.of("copper_ore", "deepslate_copper_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore",
|
||||
- "coal_ore", "deepslate_coal_ore", "lapis_ore", "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "deepslate_diamond_ore",
|
||||
- "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore", "deepslate_emerald_ore", "ender_chest"); // TODO update type to List<Block>
|
||||
- public List<String> replacementBlocks = List.of("stone", "oak_planks", "deepslate"); // TODO update type to List<Block>
|
||||
+ // Plazma start - Optimize Default Configurations
|
||||
+ public List<String> hiddenBlocks = List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "diamond_ore", "deepslate_diamond_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", "raw_iron_block", "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore"); // TODO update type to List<Block>
|
||||
+ public List<String> replacementBlocks = List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore", "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "deepslate_emerald_ore", "granite", "gravel", "oak_planks", "smooth_basalt", "stone", "tuff"); // TODO update type to List<Block>
|
||||
+ // Plazma end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@MergeMap
|
||||
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
||||
@MergeMap
|
||||
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
|
||||
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations
|
||||
|
||||
@ConfigSerializable
|
||||
public record DespawnRange(@Required int soft, @Required int hard) {
|
||||
@@ -371,7 +371,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Environment extends ConfigurationPart {
|
||||
public boolean disableThunder = false;
|
||||
public boolean disableIceAndSnow = false;
|
||||
- public boolean optimizeExplosions = false;
|
||||
+ public boolean optimizeExplosions = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -451,9 +451,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Collisions extends ConfigurationPart {
|
||||
public boolean onlyPlayersCollide = false;
|
||||
public boolean allowVehicleCollisions = true;
|
||||
- public boolean fixClimbingBypassingCrammingRule = false;
|
||||
+ public boolean fixClimbingBypassingCrammingRule = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
|
||||
- public int maxEntityCollisions = 8;
|
||||
+ public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -461,18 +461,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Chunks extends ConfigurationPart {
|
||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||
- public int maxAutoSaveChunksPerTick = 24;
|
||||
+ public int maxAutoSaveChunksPerTick = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 24 : 8; // Plazma - Optimize Default Configurations
|
||||
public int fixedChunkInhabitedTime = -1;
|
||||
- public boolean preventMovingIntoUnloadedChunks = false;
|
||||
+ public boolean preventMovingIntoUnloadedChunks = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
public Duration delayChunkUnloadsBy = Duration.of("10s");
|
||||
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
|
||||
- map.defaultReturnValue(-1);
|
||||
- map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
- map.put(EntityType.SNOWBALL, -1);
|
||||
- map.put(EntityType.ENDER_PEARL, -1);
|
||||
- map.put(EntityType.ARROW, -1);
|
||||
- map.put(EntityType.FIREBALL, -1);
|
||||
- map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ // Plazma start - Optimize Default Configurations
|
||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
|
||||
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
|
||||
+ map.put(EntityType.ARROW, 16);
|
||||
+ map.put(EntityType.DRAGON_FIREBALL, 3);
|
||||
+ map.put(EntityType.EGG, 8);
|
||||
+ map.put(EntityType.ENDER_PEARL, 8);
|
||||
+ map.put(EntityType.EXPERIENCE_BOTTLE, 3);
|
||||
+ map.put(EntityType.EXPERIENCE_ORB, 16);
|
||||
+ map.put(EntityType.EYE_OF_ENDER, 8);
|
||||
+ map.put(EntityType.FIREBALL, 8);
|
||||
+ map.put(EntityType.FIREWORK_ROCKET, 8);
|
||||
+ map.put(EntityType.LLAMA_SPIT, 3);
|
||||
+ map.put(EntityType.POTION, 8);
|
||||
+ map.put(EntityType.SHULKER_BULLET, 8);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, 8);
|
||||
+ map.put(EntityType.SNOWBALL, 8);
|
||||
+ map.put(EntityType.SPECTRAL_ARROW, 16);
|
||||
+ map.put(EntityType.TRIDENT, 16);
|
||||
+ map.put(EntityType.WITHER_SKULL, 4);
|
||||
+ } else {
|
||||
+ map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
+ map.put(EntityType.SNOWBALL, -1);
|
||||
+ map.put(EntityType.ENDER_PEARL, -1);
|
||||
+ map.put(EntityType.ARROW, -1);
|
||||
+ map.put(EntityType.FIREBALL, -1);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -487,9 +509,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public TickRates tickRates;
|
||||
|
||||
public class TickRates extends ConfigurationPart {
|
||||
- public int grassSpread = 1;
|
||||
+ public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations
|
||||
public int containerUpdate = 1;
|
||||
- public int mobSpawner = 1;
|
||||
+ public int mobSpawner = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 2; // Plazma - Optimize Default Configurations
|
||||
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
||||
public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
|
||||
}
|
||||
@@ -513,9 +535,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
public int lightQueueSize = 20;
|
||||
- public boolean updatePathfindingOnBlockUpdate = true;
|
||||
+ public boolean updatePathfindingOnBlockUpdate = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
||||
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
||||
+ public RedstoneImplementation redstoneImplementation = Boolean.getBoolean("Plazma.disableConfigOptimization") ? RedstoneImplementation.VANILLA : RedstoneImplementation.ALTERNATE_CURRENT; // Plazma - Optimize Default Configurations
|
||||
public boolean disableEndCredits = false;
|
||||
public float maxLeashDistance = 10f;
|
||||
public boolean disableSprintInterruptionOnAttack = false;
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c1a2bfdec 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
@@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int {
|
||||
|
||||
@Override
|
||||
protected int fallback() {
|
||||
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations
|
||||
return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 903da36aeec8e8c7d1f3101d1e93f87412a7eed5..79593800173ad2b837b081e6091e98adfa41fb99 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 {
|
||||
File configFile = (File) optionset.valueOf("bukkit-settings");
|
||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
|
||||
configuration.options().copyDefaults(true);
|
||||
- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||
+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations
|
||||
configuration.save(configFile);
|
||||
|
||||
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
|
||||
--- 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
|
||||
this.levelName = this.get("level-name", "world");
|
||||
this.serverPort = this.get("server-port", 25565);
|
||||
this.announcePlayerAchievements = this.getLegacyBoolean("announce-player-achievements");
|
||||
- this.enableQuery = this.get("enable-query", false);
|
||||
+ this.enableQuery = this.get("enable-query", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Plazma - Optimize Default Configurations
|
||||
this.queryPort = this.get("query.port", 25565);
|
||||
this.enableRcon = this.get("enable-rcon", false);
|
||||
this.rconPort = this.get("rcon.port", 25575);
|
||||
@@ -129,15 +129,15 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.allowNether = this.get("allow-nether", true);
|
||||
this.spawnMonsters = this.get("spawn-monsters", true);
|
||||
this.useNativeTransport = this.get("use-native-transport", true);
|
||||
- this.enableCommandBlock = this.get("enable-command-block", false);
|
||||
- this.spawnProtection = this.get("spawn-protection", 16);
|
||||
+ this.enableCommandBlock = this.get("enable-command-block", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Plazma - Optimize Default Configurations
|
||||
+ this.spawnProtection = this.get("spawn-protection", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 0); // Plazma - Optimize Default Configurations
|
||||
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.rateLimitPacketsPerSecond = this.get("rate-limit", 0);
|
||||
- this.viewDistance = this.get("view-distance", 10);
|
||||
- this.simulationDistance = this.get("simulation-distance", 10);
|
||||
+ this.viewDistance = this.get("view-distance", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 7); // Plazma - Optimize Default Configurations
|
||||
+ this.simulationDistance = this.get("simulation-distance", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 4); // Plazma - Optimize Default Configurations
|
||||
this.maxPlayers = this.get("max-players", 20);
|
||||
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
|
||||
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
|
||||
@@ -145,7 +145,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.maxWorldSize = this.get("max-world-size", (integer) -> {
|
||||
return Mth.clamp(integer, 1, 29999984);
|
||||
}, 29999984);
|
||||
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag
|
||||
+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag // Plazma - Optimize Default Configurations
|
||||
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
||||
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
|
||||
--- 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 {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations
|
||||
ConfigurationSection legacyAlias = null;
|
||||
if (!this.configuration.isString("aliases")) {
|
||||
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index d0d31002562e728fa1a6c9bc81baa4534f11d365..d0968eeb0f9edeee43394da8a32d3ee8d491737b 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -49,7 +49,10 @@ public class PurpurConfig {
|
||||
+ "join us in our Discord guild.\n"
|
||||
+ "\n"
|
||||
+ "Website: https://purpurmc.org \n"
|
||||
- + "Docs: https://purpurmc.org/docs \n";
|
||||
+ // Plazma start
|
||||
+ + "Docs: https://purpurmc.org/docs \n"
|
||||
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n";
|
||||
+ // Plazma end
|
||||
private static File CONFIG_FILE;
|
||||
public static YamlConfiguration config;
|
||||
|
||||
@@ -241,7 +244,7 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
- public static boolean useAlternateKeepAlive = false;
|
||||
+ public static boolean useAlternateKeepAlive = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
private static void useAlternateKeepAlive() {
|
||||
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 078102e636803f38facc049952813ff2f8b63594..16c3a06df8575a4fecd1967cf18854cb6267a4f7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
|
||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
- public boolean teleportIfOutsideBorder = false;
|
||||
+ public boolean teleportIfOutsideBorder = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
public boolean teleportOnNetherCeilingDamage = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
@@ -3070,7 +3070,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieJockeyOnlyBaby = true;
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
- public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
|
||||
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
|
||||
public boolean zombieBypassMobGriefing = false;
|
||||
public boolean zombieTakeDamageFromWater = false;
|
||||
public boolean zombieAlwaysDropExp = false;
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8f6f528e6 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -150,14 +150,14 @@ public class SpigotWorldConfig
|
||||
public double itemMerge;
|
||||
private void itemMerge()
|
||||
{
|
||||
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
||||
+ this.itemMerge = this.getDouble("merge-radius.item", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations
|
||||
this.log( "Item Merge Radius: " + this.itemMerge );
|
||||
}
|
||||
|
||||
public double expMerge;
|
||||
private void expMerge()
|
||||
{
|
||||
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
||||
+ this.expMerge = this.getDouble("merge-radius.exp", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class SpigotWorldConfig
|
||||
public byte mobSpawnRange;
|
||||
private void mobSpawnRange()
|
||||
{
|
||||
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
|
||||
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations
|
||||
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
||||
}
|
||||
|
||||
@@ -207,26 +207,26 @@ public class SpigotWorldConfig
|
||||
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
|
||||
}
|
||||
|
||||
- public int animalActivationRange = 32;
|
||||
- public int monsterActivationRange = 32;
|
||||
+ public int animalActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations
|
||||
+ public int monsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 24; // Plazma - Optimize Default Configurations
|
||||
public int raiderActivationRange = 48;
|
||||
- public int miscActivationRange = 16;
|
||||
+ public int miscActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations
|
||||
// Paper start
|
||||
- public int flyingMonsterActivationRange = 32;
|
||||
- public int waterActivationRange = 16;
|
||||
- public int villagerActivationRange = 32;
|
||||
+ public int flyingMonsterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 48; // Plazma - Optimize Default Configurations
|
||||
+ public int waterActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 16 : 8; // Plazma - Optimize Default Configurations
|
||||
+ public int villagerActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations
|
||||
public int wakeUpInactiveAnimals = 4;
|
||||
public int wakeUpInactiveAnimalsEvery = 60*20;
|
||||
- public int wakeUpInactiveAnimalsFor = 5*20;
|
||||
- public int wakeUpInactiveMonsters = 8;
|
||||
+ public int wakeUpInactiveAnimalsFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 40; // Plazma - Optimize Default Configurations
|
||||
+ public int wakeUpInactiveMonsters = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 4; // Plazma - Optimize Default Configurations
|
||||
public int wakeUpInactiveMonstersEvery = 20*20;
|
||||
- public int wakeUpInactiveMonstersFor = 5*20;
|
||||
- public int wakeUpInactiveVillagers = 4;
|
||||
+ public int wakeUpInactiveMonstersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations
|
||||
+ public int wakeUpInactiveVillagers = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 4 : 1; // Plazma - Optimize Default Configurations
|
||||
public int wakeUpInactiveVillagersEvery = 30*20;
|
||||
- public int wakeUpInactiveVillagersFor = 5*20;
|
||||
- public int wakeUpInactiveFlying = 8;
|
||||
+ public int wakeUpInactiveVillagersFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 20; // Plazma - Optimize Default Configurations
|
||||
+ public int wakeUpInactiveFlying = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 1; // Plazma - Optimize Default Configurations
|
||||
public int wakeUpInactiveFlyingEvery = 10*20;
|
||||
- public int wakeUpInactiveFlyingFor = 5*20;
|
||||
+ public int wakeUpInactiveFlyingFor = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 5*20 : 60; // Plazma - Optimize Default Configurations
|
||||
public int villagersWorkImmunityAfter = 5*20;
|
||||
public int villagersWorkImmunityFor = 20;
|
||||
public boolean villagersActiveForPanic = true;
|
||||
@@ -299,7 +299,7 @@ public class SpigotWorldConfig
|
||||
{
|
||||
this.set( "ticks-per.hopper-check", 1 );
|
||||
}
|
||||
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
|
||||
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 8 ); // Plazma - Optimize Default Configurations
|
||||
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
||||
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
|
||||
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
|
||||
@@ -309,7 +309,7 @@ public class SpigotWorldConfig
|
||||
public int tridentDespawnRate;
|
||||
private void arrowDespawnRate()
|
||||
{
|
||||
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
|
||||
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1200 : 300 ); // Plazma - Optimize Default Configurations
|
||||
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
|
||||
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
|
||||
}
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/configurations/bukkit_optimized.yml
|
||||
@@ -0,0 +1,45 @@
|
||||
+# This is the main configuration file for Bukkit.
|
||||
+# 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
|
||||
+
|
||||
+
|
||||
+settings:
|
||||
+ allow-end: true
|
||||
+ warn-on-overload: true
|
||||
+ permissions-file: permissions.yml
|
||||
+ update-folder: update
|
||||
+ plugin-profiling: false
|
||||
+ connection-throttle: 4000
|
||||
+ query-plugins: true
|
||||
+ deprecated-verbose: default
|
||||
+ shutdown-message: Server closed
|
||||
+ minimum-api: none
|
||||
+ use-map-color-cache: true
|
||||
+spawn-limits:
|
||||
+ monsters: 20
|
||||
+ animals: 5
|
||||
+ water-animals: 2
|
||||
+ water-ambient: 2
|
||||
+ water-underground-creature: 3
|
||||
+ axolotls: 3
|
||||
+ ambient: 1
|
||||
+chunk-gc:
|
||||
+ period-in-ticks: 400
|
||||
+ticks-per:
|
||||
+ animal-spawns: 400
|
||||
+ monster-spawns: 10
|
||||
+ water-spawns: 400
|
||||
+ water-ambient-spawns: 400
|
||||
+ water-underground-creature-spawns: 400
|
||||
+ axolotl-spawns: 400
|
||||
+ ambient-spawns: 400
|
||||
+ autosave: 6000
|
||||
+aliases: now-in-commands.yml
|
||||
118
patches/server/0009-Port-SparklyPaper-patches.patch
Normal file
118
patches/server/0009-Port-SparklyPaper-patches.patch
Normal file
@@ -0,0 +1,118 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 25 Jan 2024 17:13:09 +0900
|
||||
Subject: [PATCH] Port SparklyPaper patches
|
||||
|
||||
SparklyPower
|
||||
Copyright (C) 2024 SparklyPower
|
||||
|
||||
Based on commit: 29212936a832106c4d68e2a2017acbea2fdd3cc4
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 04b98e23eed926d8473cc2464e04a5b9f18f1140..cf098d4a3111771c13766285c5ec5f1fc1f539a4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -74,6 +74,7 @@ public class ServerEntity {
|
||||
private List<SynchedEntityData.DataValue<?>> trackedDataValues;
|
||||
// CraftBukkit start
|
||||
public final Set<ServerPlayerConnection> trackedPlayers; // Purpur - private -> public
|
||||
+ public static boolean skipSqrWhenNoDeltaChanges = false; // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
|
||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||
this.trackedPlayers = trackedPlayers;
|
||||
@@ -210,12 +211,14 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) { // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
double d0 = vec3d1.distanceToSqr(this.ap);
|
||||
|
||||
if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
this.ap = vec3d1;
|
||||
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
|
||||
}
|
||||
+ } // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
}
|
||||
|
||||
if (packet1 != null) {
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..52e72277c661b67a54bc5ce584efb04134599dd3 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -243,7 +243,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
|
||||
public void sendStats(ServerPlayer player) {
|
||||
Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap();
|
||||
- Iterator iterator = this.getDirty().iterator();
|
||||
+ Iterator<Stat<?>> iterator = this.dirty.iterator(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Stat<?> statistic = (Stat) iterator.next();
|
||||
@@ -251,6 +251,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
object2intmap.put(statistic, this.getValue(statistic));
|
||||
}
|
||||
|
||||
+ this.dirty.clear(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
|
||||
player.connection.send(new ClientboundAwardStatsPacket(object2intmap));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
index 8d3c1897044f9a2bbe1911e1a72dc9a00fb246df..a68112a1d1904edfc84acb6c209e13f0836d97e0 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
@@ -313,12 +313,14 @@ public class MapItem extends ComplexItem {
|
||||
}
|
||||
}
|
||||
|
||||
+ public static boolean skipTickWhenCraftNotPresent = false; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
|
||||
if (!world.isClientSide) {
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(stack, world);
|
||||
|
||||
if (worldmap != null) {
|
||||
+ if (skipTickWhenCraftNotPresent && worldmap.mapView.getRenderers().stream().noneMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) return; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
|
||||
if (entity instanceof Player) {
|
||||
Player entityhuman = (Player) entity;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..b9a303f6280a2f6ad3616da152922a4f4a504281 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
@@ -145,7 +145,7 @@ public class CraftMapColorCache implements MapPalette.MapColorCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public boolean isCached() {
|
||||
+ public synchronized boolean isCached() { // Plazma - Fix concurrency issues when using "imageToBytes" in multiple threads
|
||||
return this.cached || (!this.running.get() && this.initCache().isDone());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 57d29f8f3bc89529db9ee8f6dc3fffdbd4a03ceb..9c830ec9129ac94aa08e914a82792210c13fc1a3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,9 +40,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ boolean skipSqrWhenNoDeltaChanges = OPTIMIZE;
|
||||
|
||||
@PostProcess
|
||||
public void post() {
|
||||
+ net.minecraft.server.level.ServerEntity.skipSqrWhenNoDeltaChanges = this.skipSqrWhenNoDeltaChanges;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,9 +52,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public World world;
|
||||
public class World extends ConfigurationPart {
|
||||
|
||||
+ boolean skipTickWhenCraftNotPresent = OPTIMIZE;
|
||||
|
||||
@PostProcess
|
||||
public void post() {
|
||||
+ net.minecraft.world.item.MapItem.skipTickWhenCraftNotPresent = this.skipTickWhenCraftNotPresent;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 10:13:14 +0900
|
||||
Subject: [PATCH] Always agree EULA on development mode
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index b91c3b8ca8f840335ba6470658d82c5d71bb75e1..23f0302f2d90b7229828890eb364bc2c9abc11d2 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -168,6 +168,7 @@ public class Main {
|
||||
|
||||
// Spigot Start
|
||||
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
|
||||
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev"); // Plazma - Always agree EULA on development mode
|
||||
if ( eulaAgreed )
|
||||
{
|
||||
System.err.println( "You have used the Spigot command line EULA agreement flag." );
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 23 Mar 2023 14:25:09 +0900
|
||||
Subject: [PATCH] ChunkSending Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 857ddc62dd9affbbebcd7cde8a6d675dbb5f68ae..7df971a1bd47862918f4c7342eae19226c4c9fbe 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -22,4 +22,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
|
||||
@Setting(Configuration.VERSION_FIELD)
|
||||
public int version = CURRENT_VERSION;
|
||||
+
|
||||
+ public ChunkSending chunkSending;
|
||||
+ public class ChunkSending extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+ public int maxChunksPerTick = 5;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
98
patches/server/0011-Add-more-metrics.patch
Normal file
98
patches/server/0011-Add-more-metrics.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 10:26:26 +0900
|
||||
Subject: [PATCH] Add more metrics
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 0b3d87d2d43148e6370e7a03e0bb6074891ac800..8783c81af1d09e6682256dee0dd546de0be418cd 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -636,38 +636,59 @@ public class Metrics {
|
||||
return map;
|
||||
}));
|
||||
|
||||
- metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||
- Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
+ // Plazma start - Add more metrics information
|
||||
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
|
||||
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
|
||||
+
|
||||
+ if (datapacks == 0) return Collections.singletonMap("0", entry);
|
||||
+ else if (datapacks <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (datapacks <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (datapacks <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (datapacks <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ else if (datapacks <= 100) return Collections.singletonMap("51+", entry);
|
||||
+ else return Collections.singletonMap("101+ \uD83D\uDE2E", entry);
|
||||
+ }));
|
||||
|
||||
- // count legacy plugins
|
||||
- int legacy = 0;
|
||||
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||
- if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
||||
- legacy++;
|
||||
- }
|
||||
- }
|
||||
+ metrics.addCustomChart(new DrilldownPie("plugins", () -> {
|
||||
+ int pluginCount = Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(Plugin::isEnabled).toList().size();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(pluginCount), 1);
|
||||
+
|
||||
+ if (pluginCount == 0) return Collections.singletonMap("0", entry);
|
||||
+ else if (pluginCount <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (pluginCount <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (pluginCount <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (pluginCount <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ else if (pluginCount <= 100) return Collections.singletonMap("51-100", entry);
|
||||
+ else return Collections.singletonMap("101+ \uD83D\uDE2E", entry);
|
||||
+ }));
|
||||
|
||||
- // insert real value as lower dimension
|
||||
- Map<String, Integer> entry = new HashMap<>();
|
||||
- entry.put(String.valueOf(legacy), 1);
|
||||
-
|
||||
- // create buckets as higher dimension
|
||||
- if (legacy == 0) {
|
||||
- map.put("0 \uD83D\uDE0E", entry); // :sunglasses:
|
||||
- } else if (legacy <= 5) {
|
||||
- map.put("1-5", entry);
|
||||
- } else if (legacy <= 10) {
|
||||
- map.put("6-10", entry);
|
||||
- } else if (legacy <= 25) {
|
||||
- map.put("11-25", entry);
|
||||
- } else if (legacy <= 50) {
|
||||
- map.put("26-50", entry);
|
||||
- } else {
|
||||
- map.put("50+ \uD83D\uDE2D", entry); // :cry:
|
||||
- }
|
||||
+ metrics.addCustomChart(new DrilldownPie("disabled_plugins", () -> {
|
||||
+ int disabled = Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(it -> !it.isEnabled()).toList().size();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(disabled), 1);
|
||||
+
|
||||
+ if (disabled == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry); // :sunglasses:
|
||||
+ else if (disabled <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (disabled <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (disabled <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (disabled <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ else if (disabled <= 100) return Collections.singletonMap("51-100 \uD83D\uDE2D", entry); // :cry:
|
||||
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
|
||||
+ }));
|
||||
|
||||
- return map;
|
||||
+ metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||
+ int legacy = (int) Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(p -> CraftMagicNumbers.isLegacy(p.getDescription())).count(); // Plazma
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(legacy), 1);
|
||||
+
|
||||
+ if (legacy == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry); // :sunglasses:
|
||||
+ else if (legacy <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (legacy <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (legacy <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (legacy <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ else if (legacy <= 100) return Collections.singletonMap("51-100 \uD83D\uDE2D", entry); // :cry:
|
||||
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
|
||||
}));
|
||||
+ // Plazma end - Add more metrics information
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Thu, 23 Mar 2023 14:32:26 +0900
|
||||
Subject: [PATCH] Implement ChunkSending
|
||||
|
||||
Original: someaddons/chunksending
|
||||
Copyright (C) 2023 someaddons
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index e2202389a2c4133a183cca59c4e909fc419379ab..b3e731c122b315d28ae51d32b798f818e270c7ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -398,9 +398,12 @@ public class ChunkHolder {
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
private void broadcast(List<ServerPlayer> players, Packet<?> packet) {
|
||||
- players.forEach((entityplayer) -> {
|
||||
- entityplayer.connection.send(packet);
|
||||
- });
|
||||
+ // Plazma start
|
||||
+ for (ServerPlayer player : players) {
|
||||
+ if (this.chunkMap.level.plazmaLevelConfiguration().chunkSending.enabled && player.attachToPending(pos, packet)) continue;
|
||||
+ player.connection.send(packet);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
// Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0249eeb3937cf48cea13846a7e39b248947e21a4..f39b3f1b5b37d1939766952a985684279cb2bf2d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -772,7 +772,35 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
// Purpur end
|
||||
+ // Plazma start - Implement ChunkSending
|
||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
||||
+ if (chunksToSend.isEmpty()) return;
|
||||
+
|
||||
+ if (disconnected) {
|
||||
+ chunksToSend.clear();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ final List<java.util.Map.Entry<ChunkPos, List<Packet<?>>>> packets = new java.util.ArrayList<>(chunksToSend.entrySet());
|
||||
+ packets.sort(java.util.Comparator.comparingDouble(e -> e.getKey().getMiddleBlockPosition(getBlockY()).distSqr(blockPosition())));
|
||||
+
|
||||
+ for (int i = 0; i < packets.size() && i < this.level().plazmaLevelConfiguration().chunkSending.maxChunksPerTick + packets.size() / 100; i++) {
|
||||
+ final java.util.Map.Entry<ChunkPos, List<Packet<?>>> entry = packets.get(i);
|
||||
+ for (final Packet<?> packet : entry.getValue()) {
|
||||
+ connection.send(packet);
|
||||
+ }
|
||||
+ chunksToSend.remove(entry.getKey());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public boolean attachToPending(final ChunkPos pos, final Packet<?> packet) {
|
||||
+ final List<Packet<?>> packetList = chunksToSend.get(pos);
|
||||
+ if (packetList == null) return false;
|
||||
+ packetList.add(packet);
|
||||
+ return true;
|
||||
}
|
||||
+ // Plazma end
|
||||
|
||||
public void doTick() {
|
||||
try {
|
||||
@@ -2437,7 +2465,14 @@ public class ServerPlayer extends Player {
|
||||
return true; // Paper
|
||||
}
|
||||
|
||||
+ // Plazma start - Implement ChunkSending
|
||||
+ private final java.util.Map<ChunkPos, List<Packet<?>>> chunksToSend = java.util.Collections.synchronizedMap(new java.util.HashMap<>());
|
||||
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
|
||||
+ if (this.level().plazmaLevelConfiguration().chunkSending.enabled) {
|
||||
+ List<Packet<?>> packetList = chunksToSend.computeIfAbsent(chunkPos, k -> new java.util.ArrayList<>());
|
||||
+ packetList.add(chunkDataPacket);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
this.connection.send(chunkDataPacket);
|
||||
// Paper start
|
||||
if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){
|
||||
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@gmail.com>
|
||||
Date: Fri, 10 Mar 2023 20:35:27 +0900
|
||||
Subject: [PATCH] Console Log Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 6714947455c1e4c887a5f13ba1a3aeb57324ee0a..3c70653b720d3d55be199e000e89c627b90e65da 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -20,4 +20,10 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
@Setting(Configuration.VERSION_FIELD)
|
||||
public int version = CURRENT_VERSION;
|
||||
+
|
||||
+ public ConsoleLogs consoleLogs;
|
||||
+ public class ConsoleLogs extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
}
|
||||
599
patches/server/0012-Optimize-default-configurations.patch
Normal file
599
patches/server/0012-Optimize-default-configurations.patch
Normal file
@@ -0,0 +1,599 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 16:42:17 +0900
|
||||
Subject: [PATCH] Optimize default configurations
|
||||
|
||||
[REFERENCE]
|
||||
- YouHaveTrouble/minecraft-optimization
|
||||
- AkiraDevelopment/SimplyMC
|
||||
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
|
||||
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 8afc58f35deb49084a20b803e91ce4692ce6e4d6..1febd6d0743aadb4002b447c07ec43098ca96c18 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -64,7 +64,7 @@ public class PufferfishConfig {
|
||||
getString("info.version", "1.0");
|
||||
setComment("info",
|
||||
"Pufferfish Configuration",
|
||||
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
|
||||
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
|
||||
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
|
||||
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
|
||||
|
||||
@@ -219,7 +219,7 @@ public class PufferfishConfig {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int maxProjectileLoadsPerProjectile;
|
||||
private static void projectileLoading() {
|
||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
|
||||
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
|
||||
setComment("projectile", "Optimizes projectile settings");
|
||||
@@ -233,7 +233,7 @@ public class PufferfishConfig {
|
||||
public static int activationDistanceMod;
|
||||
|
||||
private static void dynamicActivationOfBrains() throws IOException {
|
||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
|
||||
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
"This value determines how far away an entity has to be",
|
||||
"from the player to start being effected by DEAR.");
|
||||
@@ -241,7 +241,7 @@ public class PufferfishConfig {
|
||||
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
||||
"This value defines how often in ticks, the furthest entity",
|
||||
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
||||
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
|
||||
"This value defines how much distance modifies an entity's",
|
||||
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
|
||||
"If you want further away entities to tick less often, use 7.",
|
||||
@@ -261,8 +261,18 @@ public class PufferfishConfig {
|
||||
public static Map<String, Integer> projectileTimeouts;
|
||||
private static void projectileTimeouts() {
|
||||
// Set some defaults
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
|
||||
+ 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 - Optimize default configurations
|
||||
getInt("entity_timeouts.SNOWBALL", -1);
|
||||
getInt("entity_timeouts.LLAMA_SPIT", -1);
|
||||
+ } // Plazma - Optimize default configurations
|
||||
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 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222bc5f90ed 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -156,7 +156,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Watchdog extends ConfigurationPart {
|
||||
public int earlyWarningEvery = 5000;
|
||||
- public int earlyWarningDelay = 10000;
|
||||
+ public int earlyWarningDelay = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 180000 : 10000; // Plazma - Optimize default configurations
|
||||
}
|
||||
|
||||
public SpamLimiter spamLimiter;
|
||||
@@ -198,7 +198,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Commands commands;
|
||||
|
||||
public class Commands extends ConfigurationPart {
|
||||
- public boolean suggestPlayerNamesWhenNullTabCompletions = true;
|
||||
+ public boolean suggestPlayerNamesWhenNullTabCompletions = !org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean fixTargetSelectorTagCompletion = true;
|
||||
public boolean timeCommandAffectsAllWorlds = false;
|
||||
}
|
||||
@@ -247,7 +247,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 = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 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;
|
||||
@@ -258,7 +258,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 (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
|
||||
+ 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) {
|
||||
@@ -326,7 +334,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
executor.setMaximumPoolSize(_chatExecutorMaxSize);
|
||||
}
|
||||
}
|
||||
- public int maxJoinsPerTick = 5;
|
||||
+ public int maxJoinsPerTick = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 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 d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d897ab34ac8 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -96,12 +96,32 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class AntiXray extends ConfigurationPart {
|
||||
public boolean enabled = false;
|
||||
- public EngineMode engineMode = EngineMode.HIDE;
|
||||
+ public EngineMode engineMode = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? EngineMode.OBFUSCATE_LAYER : EngineMode.HIDE; // Plazma - Optimize default configurations
|
||||
public int maxBlockHeight = 64;
|
||||
public int updateRadius = 2;
|
||||
- public boolean lavaObscures = false;
|
||||
+ public boolean lavaObscures = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean usePermission = false;
|
||||
- public List<Block> hiddenBlocks = List.of(
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ public List<Block> hiddenBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? List.of(
|
||||
+ //<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
|
||||
+ Blocks.AIR,
|
||||
+ Blocks.COPPER_ORE,
|
||||
+ Blocks.DEEPSLATE_COPPER_ORE,
|
||||
+ Blocks.RAW_COPPER_BLOCK,
|
||||
+ Blocks.IRON_ORE,
|
||||
+ Blocks.DEEPSLATE_IRON_ORE,
|
||||
+ Blocks.RAW_IRON_BLOCK,
|
||||
+ Blocks.GOLD_ORE,
|
||||
+ Blocks.DEEPSLATE_GOLD_ORE,
|
||||
+ Blocks.RAW_GOLD_BLOCK,
|
||||
+ Blocks.REDSTONE_ORE,
|
||||
+ Blocks.DEEPSLATE_REDSTONE_ORE,
|
||||
+ Blocks.LAPIS_ORE,
|
||||
+ Blocks.DEEPSLATE_LAPIS_ORE,
|
||||
+ Blocks.DIAMOND_ORE,
|
||||
+ Blocks.DEEPSLATE_DIAMOND_ORE
|
||||
+ //</editor-fold>
|
||||
+ ) : List.of(
|
||||
//<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
|
||||
Blocks.COPPER_ORE,
|
||||
Blocks.DEEPSLATE_COPPER_ORE,
|
||||
@@ -128,7 +148,28 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
Blocks.ENDER_CHEST
|
||||
//</editor-fold>
|
||||
);
|
||||
- public List<Block> replacementBlocks = List.of(Blocks.STONE, Blocks.OAK_PLANKS, Blocks.DEEPSLATE);
|
||||
+ public List<Block> replacementBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? List.of(
|
||||
+ //<editor-fold desc="Anti-Xray Replacement Blocks" defaultstate="collapsed">
|
||||
+ Blocks.CHEST,
|
||||
+ Blocks.AMETHYST_BLOCK,
|
||||
+ Blocks.ANDESITE,
|
||||
+ Blocks.BUDDING_AMETHYST,
|
||||
+ Blocks.CALCITE,
|
||||
+ Blocks.COAL_ORE,
|
||||
+ Blocks.DEEPSLATE_COAL_ORE,
|
||||
+ Blocks.DEEPSLATE,
|
||||
+ Blocks.DIORITE,
|
||||
+ Blocks.DIRT,
|
||||
+ Blocks.EMERALD_ORE,
|
||||
+ Blocks.GRANITE,
|
||||
+ Blocks.GRAVEL,
|
||||
+ Blocks.OAK_PLANKS,
|
||||
+ Blocks.SMOOTH_BASALT,
|
||||
+ Blocks.STONE,
|
||||
+ Blocks.TUFF
|
||||
+ //</editor-fold>
|
||||
+ ) : List.of(Blocks.STONE, Blocks.OAK_PLANKS, Blocks.DEEPSLATE);
|
||||
+ // Plazma end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,14 +193,14 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public ArmorStands armorStands;
|
||||
|
||||
public class ArmorStands extends ConfigurationPart {
|
||||
- public boolean doCollisionEntityLookups = true;
|
||||
- public boolean tick = true;
|
||||
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
|
||||
+ public boolean tick = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
|
||||
}
|
||||
|
||||
public Markers markers;
|
||||
|
||||
public class Markers extends ConfigurationPart {
|
||||
- public boolean tick = true;
|
||||
+ public boolean tick = !org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
}
|
||||
|
||||
public Sniffer sniffer;
|
||||
@@ -182,7 +223,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@MergeMap
|
||||
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
||||
@MergeMap
|
||||
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
|
||||
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
|
||||
@MergeMap
|
||||
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
||||
|
||||
@@ -383,7 +424,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Environment extends ConfigurationPart {
|
||||
public boolean disableThunder = false;
|
||||
public boolean disableIceAndSnow = false;
|
||||
- public boolean optimizeExplosions = false;
|
||||
+ public boolean optimizeExplosions = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -438,7 +479,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public Fixes fixes;
|
||||
|
||||
public class Fixes extends ConfigurationPart {
|
||||
- public boolean fixItemsMergingThroughWalls = false;
|
||||
+ public boolean fixItemsMergingThroughWalls = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean disableUnloadedChunkEnderpearlExploit = true;
|
||||
public boolean preventTntFromMovingInWater = false;
|
||||
public boolean splitOverstackedLoot = true;
|
||||
@@ -466,9 +507,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Collisions extends ConfigurationPart {
|
||||
public boolean onlyPlayersCollide = false;
|
||||
public boolean allowVehicleCollisions = true;
|
||||
- public boolean fixClimbingBypassingCrammingRule = false;
|
||||
+ public boolean fixClimbingBypassingCrammingRule = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
|
||||
- public int maxEntityCollisions = 8;
|
||||
+ public int maxEntityCollisions = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 2 : 8; // Plazma - Optimize default configurations
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -476,18 +517,41 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Chunks extends ConfigurationPart {
|
||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||
- public int maxAutoSaveChunksPerTick = 24;
|
||||
+ public int maxAutoSaveChunksPerTick = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 24; // Plazma - Optimize default configurations
|
||||
public int fixedChunkInhabitedTime = -1;
|
||||
- public boolean preventMovingIntoUnloadedChunks = false;
|
||||
+ public boolean preventMovingIntoUnloadedChunks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public Duration delayChunkUnloadsBy = Duration.of("10s");
|
||||
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
|
||||
map.defaultReturnValue(-1);
|
||||
- map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
- map.put(EntityType.SNOWBALL, -1);
|
||||
- map.put(EntityType.ENDER_PEARL, -1);
|
||||
- map.put(EntityType.ARROW, -1);
|
||||
- map.put(EntityType.FIREBALL, -1);
|
||||
- map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
|
||||
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
|
||||
+ map.put(EntityType.ARROW, 16);
|
||||
+ map.put(EntityType.DRAGON_FIREBALL, 3);
|
||||
+ map.put(EntityType.EGG, 8);
|
||||
+ map.put(EntityType.ENDER_PEARL, 8);
|
||||
+ map.put(EntityType.EXPERIENCE_BOTTLE, 3);
|
||||
+ map.put(EntityType.EXPERIENCE_ORB, 16);
|
||||
+ map.put(EntityType.EYE_OF_ENDER, 8);
|
||||
+ map.put(EntityType.FIREBALL, 8);
|
||||
+ map.put(EntityType.FIREWORK_ROCKET, 8);
|
||||
+ map.put(EntityType.LLAMA_SPIT, 3);
|
||||
+ map.put(EntityType.POTION, 8);
|
||||
+ map.put(EntityType.SHULKER_BULLET, 8);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, 8);
|
||||
+ map.put(EntityType.SNOWBALL, 8);
|
||||
+ map.put(EntityType.SPECTRAL_ARROW, 16);
|
||||
+ map.put(EntityType.TRIDENT, 16);
|
||||
+ map.put(EntityType.WITHER_SKULL, 4);
|
||||
+ } else {
|
||||
+ map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
+ map.put(EntityType.SNOWBALL, -1);
|
||||
+ map.put(EntityType.ENDER_PEARL, -1);
|
||||
+ map.put(EntityType.ARROW, -1);
|
||||
+ map.put(EntityType.FIREBALL, -1);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -502,9 +566,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public TickRates tickRates;
|
||||
|
||||
public class TickRates extends ConfigurationPart {
|
||||
- public int grassSpread = 1;
|
||||
+ public int grassSpread = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 1; // Plazma - Optimize default configurations
|
||||
public int containerUpdate = 1;
|
||||
- public int mobSpawner = 1;
|
||||
+ public int mobSpawner = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 2 : 1; // Plazma - Optimize default configurations
|
||||
public int wetFarmland = 1;
|
||||
public int dryFarmland = 1;
|
||||
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
||||
@@ -538,9 +602,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
public int lightQueueSize = 20;
|
||||
- public boolean updatePathfindingOnBlockUpdate = true;
|
||||
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
|
||||
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
||||
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
||||
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
|
||||
public boolean disableEndCredits = false;
|
||||
public float maxLeashDistance = 10f;
|
||||
public boolean disableSprintInterruptionOnAttack = false;
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357d9c7d62a 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
|
||||
@@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int {
|
||||
|
||||
@Override
|
||||
protected int fallback() {
|
||||
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) return 100; // Plazma - Optimize default configurations
|
||||
return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 23f0302f2d90b7229828890eb364bc2c9abc11d2..a9753f799ef944a46ee3cedd68c8aad7aacc2612 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -153,7 +153,7 @@ public class Main {
|
||||
File configFile = (File) optionset.valueOf("bukkit-settings");
|
||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
|
||||
configuration.options().copyDefaults(true);
|
||||
- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||
+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
|
||||
configuration.save(configFile);
|
||||
|
||||
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 a66dcea06424518290576c7647ae0717040586f9..41d5d15dfa2affdee68501efb2447a209c38992d 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -130,14 +130,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.spawnMonsters = this.get("spawn-monsters", true);
|
||||
this.useNativeTransport = this.get("use-native-transport", true);
|
||||
this.enableCommandBlock = this.get("enable-command-block", false);
|
||||
- this.spawnProtection = this.get("spawn-protection", 16);
|
||||
+ this.spawnProtection = this.get("spawn-protection", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 0 : 16); // Plazma - Optimize default configurations
|
||||
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", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 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);
|
||||
+ this.viewDistance = this.get("view-distance", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 10); // Plazma - Optimize default configurations
|
||||
+ this.simulationDistance = this.get("simulation-distance", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 10); // Plazma - Optimize default configurations
|
||||
this.maxPlayers = this.get("max-players", 20);
|
||||
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
|
||||
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
|
||||
@@ -145,7 +145,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.maxWorldSize = this.get("max-world-size", (integer) -> {
|
||||
return Mth.clamp(integer, 1, 29999984);
|
||||
}, 29999984);
|
||||
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag
|
||||
+ this.syncChunkWrites = this.get("sync-chunk-writes", false) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag // Plazma - Show disabled by default
|
||||
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
||||
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 ceea71c3e6886b03d017c44c287dc20928f63f09..e250196a4210c5b2fe5eadda6312ebc5e17590b8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -426,7 +426,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
|
||||
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
|
||||
ConfigurationSection legacyAlias = null;
|
||||
if (!this.configuration.isString("aliases")) {
|
||||
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
index a858b7ddef7f6877c0b92f4150e0dd37bea121aa..eab5ea835a524482f8cc043c7be190a835335ed2 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/Options.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -3,5 +3,6 @@ package org.plazmamc.plazma;
|
||||
public interface Options {
|
||||
|
||||
boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
+ boolean aggressiveOptimize = Boolean.getBoolean("Plazma.aggressiveOptimize");
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index a937993f318ef5703420f57fe65c5d990ce2c4dd..65b9e4fc073d0e97c6f90587d20e3ecbdaaf2c71 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -49,6 +49,7 @@ public class PurpurConfig {
|
||||
+ "join us in our Discord guild.\n"
|
||||
+ "\n"
|
||||
+ "Website: https://purpurmc.org \n"
|
||||
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n" // Plazma
|
||||
+ "Docs: https://purpurmc.org/docs \n";
|
||||
private static File CONFIG_FILE;
|
||||
public static YamlConfiguration config;
|
||||
@@ -241,7 +242,7 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
- public static boolean useAlternateKeepAlive = false;
|
||||
+ public static boolean useAlternateKeepAlive = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
private static void useAlternateKeepAlive() {
|
||||
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||
}
|
||||
@@ -486,7 +487,7 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static boolean useUPnP = false;
|
||||
- public static boolean maxJoinsPerSecond = false;
|
||||
+ public static boolean maxJoinsPerSecond = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public static boolean kickForOutOfOrderChat = true;
|
||||
private static void networkSettings() {
|
||||
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 7dc82ffccc157a17335f1bc56ab81be3813294f6..d756c25e6d0af3153e510d0162e65348b1675366 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
|
||||
public boolean idleTimeoutTargetPlayer = true;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
- public boolean teleportIfOutsideBorder = false;
|
||||
+ public boolean teleportIfOutsideBorder = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean teleportOnNetherCeilingDamage = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
@@ -3127,7 +3127,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieJockeyOnlyBaby = true;
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
- public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
|
||||
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean zombieBypassMobGriefing = false;
|
||||
public boolean zombieTakeDamageFromWater = false;
|
||||
public boolean zombieAlwaysDropExp = false;
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5f39faabc 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -150,14 +150,14 @@ public class SpigotWorldConfig
|
||||
public double itemMerge;
|
||||
private void itemMerge()
|
||||
{
|
||||
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
||||
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations
|
||||
this.log( "Item Merge Radius: " + this.itemMerge );
|
||||
}
|
||||
|
||||
public double expMerge;
|
||||
private void expMerge()
|
||||
{
|
||||
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
||||
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class SpigotWorldConfig
|
||||
public byte mobSpawnRange;
|
||||
private void mobSpawnRange()
|
||||
{
|
||||
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
|
||||
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3 : 8 ); // Paper - Vanilla // Plazma - Optimize default configurations
|
||||
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
|
||||
}
|
||||
|
||||
@@ -207,26 +207,26 @@ public class SpigotWorldConfig
|
||||
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
|
||||
}
|
||||
|
||||
- public int animalActivationRange = 32;
|
||||
- public int monsterActivationRange = 32;
|
||||
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32; // Plazma - Optimize default configurations
|
||||
public int raiderActivationRange = 48;
|
||||
- public int miscActivationRange = 16;
|
||||
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||
// Paper start
|
||||
- public int flyingMonsterActivationRange = 32;
|
||||
- public int waterActivationRange = 16;
|
||||
- public int villagerActivationRange = 32;
|
||||
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32; // Plazma - Optimize default configurations
|
||||
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveAnimals = 4;
|
||||
public int wakeUpInactiveAnimalsEvery = 60*20;
|
||||
- public int wakeUpInactiveAnimalsFor = 5*20;
|
||||
- public int wakeUpInactiveMonsters = 8;
|
||||
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveMonstersEvery = 20*20;
|
||||
- public int wakeUpInactiveMonstersFor = 5*20;
|
||||
- public int wakeUpInactiveVillagers = 4;
|
||||
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveVillagersEvery = 30*20;
|
||||
- public int wakeUpInactiveVillagersFor = 5*20;
|
||||
- public int wakeUpInactiveFlying = 8;
|
||||
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveFlyingEvery = 10*20;
|
||||
- public int wakeUpInactiveFlyingFor = 5*20;
|
||||
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||
public int villagersWorkImmunityAfter = 5*20;
|
||||
public int villagersWorkImmunityFor = 20;
|
||||
public boolean villagersActiveForPanic = true;
|
||||
@@ -299,7 +299,7 @@ public class SpigotWorldConfig
|
||||
{
|
||||
this.set( "ticks-per.hopper-check", 1 );
|
||||
}
|
||||
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
|
||||
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8: 1 ); // Plazma - Optimize default configurations
|
||||
this.hopperAmount = this.getInt( "hopper-amount", 1 );
|
||||
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
|
||||
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
|
||||
@@ -309,7 +309,7 @@ public class SpigotWorldConfig
|
||||
public int tridentDespawnRate;
|
||||
private void arrowDespawnRate()
|
||||
{
|
||||
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
|
||||
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 300 : 1200 ); // Plazma - Optimize default configurations
|
||||
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
|
||||
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
|
||||
}
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/configurations/bukkit_optimized.yml
|
||||
@@ -0,0 +1,45 @@
|
||||
+# This is the main configuration file for Bukkit.
|
||||
+# 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
|
||||
+
|
||||
+
|
||||
+settings:
|
||||
+ allow-end: true
|
||||
+ warn-on-overload: true
|
||||
+ permissions-file: permissions.yml
|
||||
+ update-folder: update
|
||||
+ plugin-profiling: false
|
||||
+ connection-throttle: 4000
|
||||
+ query-plugins: true
|
||||
+ deprecated-verbose: default
|
||||
+ shutdown-message: Server closed
|
||||
+ minimum-api: none
|
||||
+ use-map-color-cache: true
|
||||
+spawn-limits:
|
||||
+ monsters: 20
|
||||
+ animals: 5
|
||||
+ water-animals: 2
|
||||
+ water-ambient: 2
|
||||
+ water-underground-creature: 3
|
||||
+ axolotls: 3
|
||||
+ ambient: 1
|
||||
+chunk-gc:
|
||||
+ period-in-ticks: 400
|
||||
+ticks-per:
|
||||
+ animal-spawns: 400
|
||||
+ monster-spawns: 10
|
||||
+ water-spawns: 400
|
||||
+ water-ambient-spawns: 400
|
||||
+ water-underground-creature-spawns: 400
|
||||
+ axolotl-spawns: 400
|
||||
+ ambient-spawns: 400
|
||||
+ autosave: 6000
|
||||
+aliases: now-in-commands.yml
|
||||
@@ -1,14 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@gmail.com>
|
||||
Date: Fri, 10 Mar 2023 21:45:37 +0900
|
||||
Subject: [PATCH] Console log tweaks
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 10:40:49 +0900
|
||||
Subject: [PATCH] Tweak console logging
|
||||
|
||||
[Offine Warning Configuration Patch]
|
||||
Original by Irochi <me@irochi.moe>
|
||||
Licensed under the GPL 3.0
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index e6f14bb0825e3b6987ebb2ec782c8316e3b7c094..191bebab12c94756e9f98cfacbf06eb9a7c2f2f9 100644
|
||||
index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e20b104c57 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -180,16 +180,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -23,52 +20,73 @@ index e6f14bb0825e3b6987ebb2ec782c8316e3b7c094..191bebab12c94756e9f98cfacbf06eb9
|
||||
- DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
||||
- DedicatedServer.LOGGER.warn("****************************");
|
||||
- }
|
||||
- // Paper end
|
||||
- // Paper end - detect running as root
|
||||
-
|
||||
DedicatedServer.LOGGER.info("Loading properties");
|
||||
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
|
||||
|
||||
@@ -321,7 +311,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end
|
||||
- if (!this.usesAuthentication()) {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableOfflineWarnings && !this.usesAuthentication()) { // Plazma
|
||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
// Spigot start
|
||||
@@ -334,9 +324,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||
}
|
||||
// Spigot end
|
||||
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the \"server.properties\" file or set \"console-logs.offline-warning\" to \"false\" in the \"config/plazma-global.yml\" file."); // Plazma
|
||||
}
|
||||
|
||||
+ // Plazma start - Moved down
|
||||
@@ -212,6 +202,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
|
||||
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
+ // Plazma - Tweak console logging; Moved down
|
||||
+ // Paper start - detect running as root
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.enableRootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
+ DedicatedServer.LOGGER.warn("****************************");
|
||||
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||
+ DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
||||
+ DedicatedServer.LOGGER.warn("****************************");
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ // Plazma end
|
||||
+ // Paper end - detect running as root
|
||||
+ // Plazma end - Tweak console logging
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
this.getProfileCache().save(false); // Paper
|
||||
@@ -320,6 +321,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end - Add Velocity IP Forwarding Support
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.offlineWarnings && !(io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.onlineMode)) // Plazma - Tweak console logging
|
||||
if (!this.usesAuthentication()) {
|
||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
@@ -333,7 +335,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||
}
|
||||
// Spigot end
|
||||
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file or set \"console-logs.offline-warnings\" to \"false\" in the config/plazma-global.yml file."); // Plazma - Tweak console logging
|
||||
}
|
||||
|
||||
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
||||
return false;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 60aa2984e490374ab2659f9d0a4821f1ea17c700..14d15dd0d4973957871f5c06042fcaa4ea8b7a8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1469,6 +1469,7 @@ public abstract class PlayerList {
|
||||
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(message);
|
||||
+ flag = flag || org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix; // Plazma - Tweak console logging
|
||||
|
||||
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
|
||||
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 3c70653b720d3d55be199e000e89c627b90e65da..122482e1fae7d6ac8e6b32ebdcf3e611d47901c4 100644
|
||||
index 9c830ec9129ac94aa08e914a82792210c13fc1a3..f7457660566d64a8149db414e005f0b8ed2202b5 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -24,6 +24,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public ConsoleLogs consoleLogs;
|
||||
public class ConsoleLogs extends ConfigurationPart {
|
||||
|
||||
+ public boolean enableOfflineWarnings = true;
|
||||
+ public boolean enableRootUserWarnings = true;
|
||||
@@ -67,4 +67,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public ConsoleLogs consoleLogs;
|
||||
+ public class ConsoleLogs extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean offlineWarnings = true;
|
||||
+ public boolean rootUserWarnings = true;
|
||||
+ public boolean notSecurePrefix = true;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -5,15 +5,15 @@ Subject: [PATCH] Add missing purpur configuration options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index 7166f4a39fd615e10d7b1f53c57363832a41f365..599eeb043bba787b88003ad2ac128e8d7f3e69c6 100644
|
||||
index 518660609566ffe943103b305472590ee9f0a257..a6a697868b22224a26d6c39e594533c3b33e724b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -151,6 +151,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
@@ -150,6 +150,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.allayTakeDamageFromWater;
|
||||
@@ -28,20 +28,20 @@ index 7166f4a39fd615e10d7b1f53c57363832a41f365..599eeb043bba787b88003ad2ac128e8d
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.allayMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 9f19ebfa6392a080672c472e08f755379e9776b4..e5aa7d1cf2e3178f7117e40f2df444963af43d67 100644
|
||||
index 8616a8c09a21f576a07daaa93ebf64e0f03d0c88..77c1bcde8cc5c2f51418a6f385ce84f202a13787 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -93,6 +93,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
@@ -97,6 +97,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||
public int getPurpurBreedTime() {
|
||||
return this.level().purpurConfig.camelBreedingTicks;
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.camelTakeDamageFromWater;
|
||||
@@ -51,20 +51,20 @@ index 9f19ebfa6392a080672c472e08f755379e9776b4..e5aa7d1cf2e3178f7117e40f2df44496
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level().purpurConfig.camelAlwaysDropExp;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index dc1e8bcd8049d79c0e383ccd6a5697f79a3a2ebd..c0fce0582530e24d25368a9600b4f8c06d4f8286 100644
|
||||
index 37f1d3c656997906cef57d9dbefc226d04fc65fe..b3880426148bb1ffbf36113343c54850fc344d1c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -134,6 +134,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
@@ -161,6 +161,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
public float getJumpPower() {
|
||||
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.frogTakeDamageFromWater;
|
||||
@@ -79,20 +79,20 @@ index dc1e8bcd8049d79c0e383ccd6a5697f79a3a2ebd..c0fce0582530e24d25368a9600b4f8c0
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
public int getPurpurBreedTime() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e11df4c98e 100644
|
||||
index 2a9c2a69a0589e4e7b7c79d3716376b360a2eba1..630eaae555403db79f4e16880ca443904b9254ab 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -87,6 +87,23 @@ public class Tadpole extends AbstractFish {
|
||||
@@ -90,6 +90,23 @@ public class Tadpole extends AbstractFish {
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.tadpoleTakeDamageFromWater;
|
||||
@@ -107,20 +107,20 @@ index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e1
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 552777d7ef6a1190a3b84bdf2f130f735c61d275..87f56c75742d856cdae24f525eac72aa5bce5ce2 100644
|
||||
index 5e7d76dcdc170b809ab82f6e2259c9b4d3d741be..24e351b40745d15e065f4c3cd904596c6daf4cfb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -105,6 +105,18 @@ public class Sniffer extends Animal {
|
||||
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
|
||||
public boolean isControllable() {
|
||||
return level().purpurConfig.snifferControllable;
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.snifferTakeDamageFromWater;
|
||||
@@ -130,20 +130,20 @@ index 552777d7ef6a1190a3b84bdf2f130f735c61d275..87f56c75742d856cdae24f525eac72aa
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level().purpurConfig.snifferAlwaysDropExp;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index 3fa46affc4d77d01909cfeaeaba6e06ba9fd5592..6d3373393e38f0ee530baab0d828e7c2722e9b9b 100644
|
||||
index bf7ef72a7d92db8f11789a69583270644de0dac7..1f476a4fd148ac9a4c9ad5d12de46a16e4116239 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -145,6 +145,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -147,6 +147,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.wardenTakeDamageFromWater;
|
||||
@@ -158,57 +158,57 @@ index 3fa46affc4d77d01909cfeaeaba6e06ba9fd5592..6d3373393e38f0ee530baab0d828e7c2
|
||||
+ public void initAttributes() {
|
||||
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
index e88c39d405fc7068db64ad34a03dec8d559e749e..bb5d42ca73722f3a02154ed889625ded2ac63e6f 100644
|
||||
index 58af87b8faf4f8d6bdb111c49a429466acface68..22cc678f9bd39acc27ba2d2e7981f9e8026440d4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
||||
@@ -41,7 +41,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
||||
@@ -43,7 +43,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
||||
|
||||
public ChestBoat(EntityType<? extends Boat> type, Level world) {
|
||||
super(type, world);
|
||||
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma
|
||||
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma - Add missing purpur configuration options
|
||||
}
|
||||
|
||||
public ChestBoat(Level world, double d0, double d1, double d2) {
|
||||
@@ -160,7 +160,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
||||
@@ -170,7 +170,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
||||
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
- return 27;
|
||||
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma
|
||||
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma - Add missing purpur configuration options
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index d0968eeb0f9edeee43394da8a32d3ee8d491737b..00e4bea74de63da5dc174febe6d6473729ddf8ac 100644
|
||||
index 65b9e4fc073d0e97c6f90587d20e3ecbdaaf2c71..fc48ff9270e32c3b3dbf7ffd310cab7c33d459c0 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -331,6 +331,7 @@ public class PurpurConfig {
|
||||
@@ -329,6 +329,7 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static int barrelRows = 3;
|
||||
+ public static int chestBoatRows = 3; // Plazma
|
||||
+ public static int chestBoatRows = 3; // Plazma - Add missing purpur configuration options
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||
@@ -371,6 +372,7 @@ public class PurpurConfig {
|
||||
@@ -369,6 +370,7 @@ public class PurpurConfig {
|
||||
case 1 -> 9;
|
||||
default -> 27;
|
||||
});
|
||||
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma
|
||||
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma - Add missing purpur configuration options
|
||||
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73fa3d505f3 100644
|
||||
index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604bf6ab03ae 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1117,7 +1117,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1170,7 +1170,15 @@ public class PurpurWorldConfig {
|
||||
public boolean allayRidableInWater = true;
|
||||
public boolean allayControllable = true;
|
||||
public List<String> allayRespectNBT = new ArrayList<>();
|
||||
@@ -220,11 +220,11 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
+ allayMaxHealth = getDouble("mobs.allay.max-health", allayMaxHealth);
|
||||
+ allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater);
|
||||
+ allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
||||
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
||||
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
||||
@@ -1236,7 +1244,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1289,7 +1297,15 @@ public class PurpurWorldConfig {
|
||||
public double camelMovementSpeedMin = 0.09D;
|
||||
public double camelMovementSpeedMax = 0.09D;
|
||||
public int camelBreedingTicks = 6000;
|
||||
@@ -236,11 +236,11 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
+ //camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
|
||||
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
||||
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
||||
@@ -1664,7 +1680,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1717,7 +1733,15 @@ public class PurpurWorldConfig {
|
||||
public boolean frogControllable = true;
|
||||
public float frogRidableJumpHeight = 0.65F;
|
||||
public int frogBreedingTicks = 6000;
|
||||
@@ -252,11 +252,11 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
+ frogMaxHealth = getDouble("mobs.frog.attributes.max_health", frogMaxHealth);
|
||||
+ frogTakeDamageFromWater = getBoolean("mobs.frog.takes-damage-from-water", frogTakeDamageFromWater);
|
||||
+ frogAlwaysDropExp = getBoolean("mobs.frog.always-drop-exp", frogAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
||||
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
||||
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
||||
@@ -2617,7 +2641,13 @@ public class PurpurWorldConfig {
|
||||
@@ -2668,7 +2692,13 @@ public class PurpurWorldConfig {
|
||||
public boolean snifferControllable = true;
|
||||
public double snifferMaxHealth = 14.0D;
|
||||
public int snifferBreedingTicks = 6000;
|
||||
@@ -266,11 +266,11 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
private void snifferSettings() {
|
||||
+ snifferTakeDamageFromWater = getBoolean("mobs.sniffer.takes-damage-from-water", snifferTakeDamageFromWater);
|
||||
+ snifferAlwaysDropExp = getBoolean("mobs.sniffer.always-drop-exp", snifferAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
||||
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
||||
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
||||
@@ -2716,7 +2746,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2767,7 +2797,15 @@ public class PurpurWorldConfig {
|
||||
public boolean tadpoleRidable = false;
|
||||
public boolean tadpoleRidableInWater = true;
|
||||
public boolean tadpoleControllable = true;
|
||||
@@ -282,11 +282,11 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
+ tadpoleMaxHealth = getDouble("mobs.tadpole.attributes.max_health", tadpoleMaxHealth);
|
||||
+ tadpoleTakeDamageFromWater = getBoolean("mobs.tadpole.takes-damage-from-water", tadpoleTakeDamageFromWater);
|
||||
+ tadpoleAlwaysDropExp = getBoolean("mobs.tadpole.always-drop-exp", tadpoleAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
||||
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
||||
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
||||
@@ -2926,7 +2964,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2983,7 +3021,15 @@ public class PurpurWorldConfig {
|
||||
public boolean wardenRidable = false;
|
||||
public boolean wardenRidableInWater = true;
|
||||
public boolean wardenControllable = true;
|
||||
@@ -298,7 +298,7 @@ index 16c3a06df8575a4fecd1967cf18854cb6267a4f7..9c7fd73a30edbf826c8670ac6141c73f
|
||||
+ wardenMaxHealth = getDouble("mobs.warden.attributes.max_health", wardenMaxHealth);
|
||||
+ wardenTakeDamageFromWater = getBoolean("mobs.warden.takes-damage-from-water", wardenTakeDamageFromWater);
|
||||
+ wardenAlwaysDropExp = getBoolean("mobs.warden.always-drop-exp", wardenAlwaysDropExp);
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Add missing purpur configuration options
|
||||
wardenRidable = getBoolean("mobs.warden.ridable", wardenRidable);
|
||||
wardenRidableInWater = getBoolean("mobs.warden.ridable-in-water", wardenRidableInWater);
|
||||
wardenControllable = getBoolean("mobs.warden.controllable", wardenControllable);
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 23 Mar 2023 21:18:47 +0900
|
||||
Subject: [PATCH] Player configuration section
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 122482e1fae7d6ac8e6b32ebdcf3e611d47901c4..61f364abb094a1d137478c106fefa22ceb057ed2 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -27,5 +27,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean enableOfflineWarnings = true;
|
||||
public boolean enableRootUserWarnings = true;
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public Player player;
|
||||
+ public class Player extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 23 Mar 2023 21:20:20 +0900
|
||||
Subject: [PATCH] Add option to allow any usernames
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 01d5fa265fb2818465b5a71a2e2efeec751a7a05..0f1ebdc20460da22c1ff2fee2ff6428654139969 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -240,7 +240,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@Override
|
||||
public void handleHello(ServerboundHelloPacket packet) {
|
||||
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
||||
- Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
|
||||
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.allowAnyUsername) Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); // Plazma
|
||||
// Paper start - validate usernames
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 61f364abb094a1d137478c106fefa22ceb057ed2..a45ff31d08129c0d5f159615d934a4450d54146e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -32,7 +32,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Player player;
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
-
|
||||
+ public boolean allowAnyUsername = false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 18:29:51 +0900
|
||||
Subject: [PATCH] Add some missing Pufferfish configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 77c1bcde8cc5c2f51418a6f385ce84f202a13787..8ac2f6749f3bd85b73ac543bc9040aacb6032623 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -170,11 +170,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||
return dimensions.height - 0.1F * this.getScale();
|
||||
}
|
||||
|
||||
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
//this.level().getProfiler().push("camelBrain"); // Purpur
|
||||
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
|
||||
-
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
behaviorcontroller.tick((ServerLevel) this.level(), this);
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
//this.level().getProfiler().push("camelActivityUpdate"); // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 24e351b40745d15e065f4c3cd904596c6daf4cfb..aa60c4a251de2877a9b4ea72899f07194ce15ed7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -527,9 +527,11 @@ public class Sniffer extends Animal {
|
||||
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
//this.level().getProfiler().push("snifferBrain"); // Purpur
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
this.getBrain().tick((ServerLevel) this.level(), this);
|
||||
//this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
|
||||
SnifferAi.updateActivity(this);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index 1f476a4fd148ac9a4c9ad5d12de46a16e4116239..707fd662c7f17986fffcabe774de176741456227 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -320,7 +320,7 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
ServerLevel worldserver = (ServerLevel) this.level();
|
||||
|
||||
//worldserver.getProfiler().push("wardenBrain"); // Purpur
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma - Add missing pufferfish configurations
|
||||
this.getBrain().tick(worldserver, this);
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
super.customServerAiStep();
|
||||
@@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 23 Mar 2023 21:35:15 +0900
|
||||
Subject: [PATCH] Add permission to bypass reducedDebugInfo gamerule
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 824f31b68b38f2f8642fb9d59a123cfdaffbb7b2..86932974a9101779691de336a8c45c464158fca8 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -282,7 +282,7 @@ public abstract class PlayerList {
|
||||
ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player);
|
||||
GameRules gamerules = worldserver1.getGameRules();
|
||||
boolean flag = gamerules.getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN);
|
||||
- boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||
+ boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) && !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.enableBypassReducedDebugInfoPermission && player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule")); // Plazma
|
||||
|
||||
// Spigot - view distance
|
||||
playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getWorld().getSendViewDistance(), worldserver1.getWorld().getSimulationDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation(), player.getPortalCooldown())); // Paper - replace old player chunk management
|
||||
@@ -1315,7 +1315,7 @@ public abstract class PlayerList {
|
||||
player.getEntityData().refresh(player); // CraftBukkkit - SPIGOT-7218: sync metadata
|
||||
player.connection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected));
|
||||
// CraftBukkit start - from GameRules
|
||||
- int i = player.level().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) ? 22 : 23;
|
||||
+ int i = player.level().getGameRules().getBoolean(GameRules.RULE_REDUCEDDEBUGINFO) && !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.enableBypassReducedDebugInfoPermission && player.getBukkitEntity().hasPermission("plazma.bypass-reduced-debug-info-gamerule")) ? 22 : 23;
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, (byte) i));
|
||||
float immediateRespawn = player.level().getGameRules().getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN) ? 1.0F: 0.0F;
|
||||
player.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.IMMEDIATE_RESPAWN, immediateRespawn));
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index a45ff31d08129c0d5f159615d934a4450d54146e..4f54ae58bd20481f02aaec3f8406996a5e01b24f 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -33,6 +33,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
public boolean allowAnyUsername = false;
|
||||
+ public boolean enableBypassReducedDebugInfoPermission = true; // TODO: Move to Player.Permissions class
|
||||
|
||||
}
|
||||
}
|
||||
1487
patches/server/0016-Completely-remove-Mojang-Profiler.patch
Normal file
1487
patches/server/0016-Completely-remove-Mojang-Profiler.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 11:27:51 +0900
|
||||
Subject: [PATCH] Add option to change nether portal size
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
index 46910a3bdacc9df1835e16b300f9e107744d2660..9b372b494b831c374bab478267309544b4b31748 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
@@ -99,7 +99,7 @@ public class PortalShape {
|
||||
private int calculateWidth() {
|
||||
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
|
||||
|
||||
- return i >= 2 && i <= 21 ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() ? i : 0; // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
|
||||
@@ -132,7 +132,7 @@ public class PortalShape {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
|
||||
|
||||
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
|
||||
@@ -186,7 +186,7 @@ public class PortalShape {
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.min() && this.width <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() && this.height >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.min() && this.height <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max(); // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
// CraftBukkit start - return boolean
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 42d639688b6f0b9ff53debf49a920f5c8e232a19..36728e206de513e071f387d36a608e70a5984a58 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -42,6 +42,21 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public NetherPortal netherPortal;
|
||||
public class NetherPortal extends ConfigurationPart {
|
||||
|
||||
+ public Width width;
|
||||
+ public class Width extends ConfigurationPart {
|
||||
+
|
||||
+ int min = 2; public int min() { return Math.max(this.min, 1); }
|
||||
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Height height;
|
||||
+ public class Height extends ConfigurationPart {
|
||||
+
|
||||
+ int min = 3; public int min() { return Math.max(this.min, 2); }
|
||||
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
307
patches/server/0018-Reduce-create-random-instance.patch
Normal file
307
patches/server/0018-Reduce-create-random-instance.patch
Normal file
@@ -0,0 +1,307 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 21:18:22 +0900
|
||||
Subject: [PATCH] Reduce create random instance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
index b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046edd340a82 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
@@ -66,7 +66,7 @@ public class SpreadPlayersCommand {
|
||||
if (maxY < j) {
|
||||
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
|
||||
} else {
|
||||
- RandomSource randomsource = RandomSource.create();
|
||||
+ RandomSource randomsource = worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
double d0 = (double) (center.x - maxRange);
|
||||
double d1 = (double) (center.y - maxRange);
|
||||
double d2 = (double) (center.x + maxRange);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 305b90d10a499e9731f5178433fb10207e428091..47a4e4082571e43946b510a8447627923ee4086c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -456,7 +456,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
@@ -493,7 +493,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index c0729d3a38e0b9924711c0ca96afd138fa69fa3b..d45a435a3aa8fc5b8f028e0455c3789b36cbdf12 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -71,7 +71,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
this.serverId = "";
|
||||
this.server = server;
|
||||
this.connection = connection;
|
||||
- this.challenge = Ints.toByteArray(RandomSource.create().nextInt());
|
||||
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? server.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
index 0e0867d7add9a024bbe9471f8ff92bbb25996a3d..034b41aa8c8a5571f21530a4e8588b1cc110ecf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
@@ -341,7 +341,7 @@ public class QueryThreadGs4 extends GenericThread {
|
||||
this.identBytes[2] = bs[5];
|
||||
this.identBytes[3] = bs[6];
|
||||
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
|
||||
- this.challenge = RandomSource.create().nextInt(16777216);
|
||||
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
|
||||
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
index 3fac11bf02652b5f51f30f99bdf516504467d0d2..add054ac26890b627d1eee87d1b0f88a84bf2aac 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.util.RandomSource;
|
||||
|
||||
public class ShufflingList<U> implements Iterable<U> {
|
||||
protected final List<ShufflingList.WeightedEntry<U>> entries;
|
||||
- private final RandomSource random = RandomSource.create();
|
||||
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
private final boolean isUnsafe; // Paper - Fix Concurrency issue in ShufflingList during worldgen
|
||||
|
||||
public ShufflingList() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
index e553f52de2e0b30511ac1b73cb436374017cd7d7..cbb94ec3111865563e451e758e5b9813f3c6102f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
|
||||
public abstract class Sensor<E extends LivingEntity> {
|
||||
- private static final RandomSource RANDOM = RandomSource.createThreadSafe();
|
||||
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
|
||||
private static final int DEFAULT_SCAN_RATE = 20;
|
||||
protected static final int TARGETING_RANGE = 16;
|
||||
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.0);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
index 3d792957f27fd4bdfad8d76262a8e2a2012bf35f..2d96cf85fb9250bbbddb8065307a47929c0c905c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
@@ -33,7 +33,7 @@ public class AngerManagement {
|
||||
@VisibleForTesting
|
||||
protected static final int MAX_ANGER = 150;
|
||||
private static final int DEFAULT_ANGER_DECREASE = 1;
|
||||
- private int conversionDelay = Mth.randomBetweenInclusive(RandomSource.create(), 0, 2);
|
||||
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
|
||||
int highestAnger;
|
||||
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create(
|
||||
instance -> instance.group(
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
index 752b38d45d59d8b3cd492246e5aa4f378a78734d..38b534e4613641046ed3cd048f52dff0888acda2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
@@ -32,7 +32,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
||||
private static final int SPAWN_CHANCE_INCREASE = 25;
|
||||
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
|
||||
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
|
||||
- private final RandomSource random = RandomSource.create();
|
||||
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - reduce create random instace
|
||||
private final ServerLevelData serverLevelData;
|
||||
private int tickDelay;
|
||||
private int spawnDelay;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index 91497f5e6c07fcf1b05eca6846c51e1a15ed3bc0..1317d8289898798a9d86a4c995a4a1a317631bf7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -87,7 +87,7 @@ public class FishingHook extends Projectile {
|
||||
|
||||
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
|
||||
super(type, world);
|
||||
- this.syncronizedRandom = RandomSource.create();
|
||||
+ this.syncronizedRandom = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
this.openWater = true;
|
||||
this.currentState = FishingHook.FishHookState.FLYING;
|
||||
this.noCulling = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index bf2c23fad919820512ce031cf28a000b249b2876..cb81994735650ec7c54b3f5a97d94e069d254c35 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -114,7 +114,7 @@ public class Raid {
|
||||
|
||||
public Raid(int id, ServerLevel world, BlockPos pos) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.id = id;
|
||||
this.level = world;
|
||||
@@ -128,7 +128,7 @@ public class Raid {
|
||||
|
||||
public Raid(ServerLevel world, CompoundTag nbt) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.level = world;
|
||||
this.id = nbt.getInt("Id");
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
index 1a686780e5aadcbdcfceb770ce8e283b38115209..6c1ba9631e56c336ed3ddee8e6435734597a3aa3 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
@@ -97,7 +97,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||
}
|
||||
// Purpur end
|
||||
};
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = playerInventory.player.level().plazmaConfig().misc.reduceRandom ? playerInventory.player.level().random : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.enchantmentSeed = DataSlot.standalone();
|
||||
this.costs = new int[3];
|
||||
this.enchantClue = new int[]{-1, -1, -1};
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 0be03430d8257d918b7cf646af518473ae027399..824f210af6d8467ed596ece1573740d99b92b7ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -92,7 +92,7 @@ public class Explosion {
|
||||
}
|
||||
|
||||
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, SoundEvent soundEvent) {
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.toBlow = new ObjectArrayList();
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 16e6716f70d5b9090f29f8b2320302d98dd087c2..72420d9e79d4b480fa060f9b910cea7b677a1427 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -122,16 +122,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public final Thread thread;
|
||||
private final boolean isDebug;
|
||||
private int skyDarken;
|
||||
- protected int randValue = RandomSource.create().nextInt();
|
||||
protected final int addend = 1013904223;
|
||||
protected float oRainLevel;
|
||||
public float rainLevel;
|
||||
protected float oThunderLevel;
|
||||
public float thunderLevel;
|
||||
public final RandomSource random = RandomSource.create();
|
||||
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? random.nextInt() : RandomSource.create().nextInt(); // Plazma - Reduce create random instace
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
|
||||
private final ResourceKey<DimensionType> dimensionTypeId;
|
||||
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||
public final WritableLevelData levelData;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 4997f120aa9877c199fbcaa0c2f65226e13b5a23..af393eaf3d21a260f0bfff5eaeb78c389161bffd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -363,7 +363,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
}
|
||||
|
||||
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
||||
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instance
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
index 798e22fb4d685b5845ebf687e8004e94f13a9751..189f425565c9c38b29031ae26de667422eb3b6bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
@@ -224,7 +224,7 @@ public class ChunkGeneratorStructureState {
|
||||
List<CompletableFuture<ChunkPos>> list = new ArrayList(j);
|
||||
int k = placement.spread();
|
||||
HolderSet<Biome> holderset = placement.preferredBiomes();
|
||||
- RandomSource randomsource = RandomSource.create();
|
||||
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
|
||||
// Paper start - Add missing structure set seed configs
|
||||
if (this.conf.strongholdSeed != null && structureSetEntry.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
index 7bbe93966fa00b7001da53bf2f22f4d942b7cc22..6c5eececc83571b0f60e7f672ed185e1d262e99c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
@@ -81,7 +81,7 @@ public enum DragonRespawnAnimation {
|
||||
world.explode((Entity) null, (double) ((float) worldgenender_spike.getCenterX() + 0.5F), (double) worldgenender_spike.getHeight(), (double) ((float) worldgenender_spike.getCenterZ() + 0.5F), 5.0F, Level.ExplosionInteraction.BLOCK);
|
||||
SpikeConfiguration worldgenfeatureendspikeconfiguration = new SpikeConfiguration(true, ImmutableList.of(worldgenender_spike), new BlockPos(0, 128, 0));
|
||||
|
||||
- Feature.END_SPIKE.place(worldgenfeatureendspikeconfiguration, world, world.getChunkSource().getGenerator(), RandomSource.create(), new BlockPos(worldgenender_spike.getCenterX(), 45, worldgenender_spike.getCenterZ()));
|
||||
+ Feature.END_SPIKE.place(worldgenfeatureendspikeconfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), new BlockPos(worldgenender_spike.getCenterX(), 45, worldgenender_spike.getCenterZ())); // Plazma - Reduce create random instance
|
||||
}
|
||||
} else if (flag1) {
|
||||
fight.setRespawnStage(SUMMONING_DRAGON); // CraftBukkit - decompile error
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index d4f903c402765c6e8e1db99e148613748f530726..c8d76fdee94a0ffb76fcb476ca386acf154dda28 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -472,7 +472,7 @@ public class EndDragonFight {
|
||||
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
|
||||
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
||||
}).ifPresent((holder_c) -> {
|
||||
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ holder_c.value().place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instace
|
||||
});
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
||||
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
||||
}
|
||||
// Paper end - Prevent "softlocked" exit portal generation
|
||||
- if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) {
|
||||
+ if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), this.portalLocation)) { // Plazma - Reduce create random instace
|
||||
int i = Mth.positiveCeilDiv(4, 16);
|
||||
|
||||
this.level.getChunkSource().chunkMap.waitForLightBeforeSending(new ChunkPos(this.portalLocation), i);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
index 1309fabd357eb9b8f90f882ec7ff3de9e60f187d..d300668899c3382a42e6a25dd084fb814b56f6bc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
@@ -14,11 +14,12 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
|
||||
public class CraftFirework extends CraftProjectile implements Firework {
|
||||
|
||||
- private final Random random = new Random();
|
||||
+ private final net.minecraft.util.RandomSource random; // Plazma - Reduce create random instance
|
||||
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
||||
|
||||
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|
||||
super(server, entity);
|
||||
+ this.random = this.getHandle().level().plazmaConfig().misc.reduceRandom ? this.getHandle().level().getRandom() : net.minecraft.util.RandomSource.create(); // Plazma - Reduce create random instance
|
||||
|
||||
// Paper start - Expose firework item directly
|
||||
// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index f7457660566d64a8149db414e005f0b8ed2202b5..d922c572e2410fa1f719fe2371f65cd1542ca8b4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -64,6 +64,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Miscellaneous misc;
|
||||
public class Miscellaneous extends ConfigurationPart {
|
||||
|
||||
+ public boolean reduceRandom = OPTIMIZE;
|
||||
+ public boolean ignoreThreadSafeRandom = false;
|
||||
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 36728e206de513e071f387d36a608e70a5984a58..c8b10b3499fbdf41f0b268d8a9da729e3432bb66 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -22,6 +22,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Miscellaneous misc;
|
||||
public class Miscellaneous extends ConfigurationPart {
|
||||
|
||||
+ public boolean reduceRandom = OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 00:04:41 +0900
|
||||
Subject: [PATCH] Structure Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 7df971a1bd47862918f4c7342eae19226c4c9fbe..b1a75e865e61f9cdfb6a6a57cbab3db1f2a709d3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -30,4 +30,21 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public int maxChunksPerTick = 5;
|
||||
|
||||
}
|
||||
+
|
||||
+ public Structure structure;
|
||||
+ public class Structure extends ConfigurationPart {
|
||||
+
|
||||
+ public Portal portal;
|
||||
+ public class Portal extends ConfigurationPart {
|
||||
+
|
||||
+ public NetherPortal netherPortal;
|
||||
+ public class NetherPortal extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
}
|
||||
33
patches/server/0019-Apply-various-optimizations.patch
Normal file
33
patches/server/0019-Apply-various-optimizations.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:11:15 +0900
|
||||
Subject: [PATCH] Apply various optimizations
|
||||
|
||||
[REFERENCE PATCHES]
|
||||
Akarin - Swaps the predicate order of collision
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index f2c6b52fe7fbb05afa0074684cd195f6ae598f1f..f16a347e0e263a0479a73cb14626e31c9de37e6c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2154,8 +2154,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
public void playerTouch(Player player) {}
|
||||
|
||||
public void push(Entity entity) {
|
||||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma - Swaps the predicate order of collision
|
||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||
- if (!entity.noPhysics && !this.noPhysics) {
|
||||
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - Swaps the predicate order of collision
|
||||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
|
||||
double d0 = entity.getX() - this.getX();
|
||||
double d1 = entity.getZ() - this.getZ();
|
||||
@@ -2183,8 +2184,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
entity.push(d0, 0.0D, d1);
|
||||
}
|
||||
}
|
||||
-
|
||||
- }
|
||||
+ //} // Plazma - Swaps the predicate order of collision
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 00:10:52 +0900
|
||||
Subject: [PATCH] Configurable nether portal size
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
index e7554ec800f321e4e34c926c53f2375a8c3aa979..677f546cee0ebda24a6e77cb5fedd41078c7fff4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
@@ -100,7 +100,7 @@ public class PortalShape {
|
||||
private int calculateWidth() {
|
||||
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
|
||||
|
||||
- return i >= 2 && i <= 21 ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.max() ? i : 0; // Plazma
|
||||
}
|
||||
|
||||
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
|
||||
@@ -133,7 +133,7 @@ public class PortalShape {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
|
||||
|
||||
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma
|
||||
}
|
||||
|
||||
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
|
||||
@@ -187,7 +187,7 @@ public class PortalShape {
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.min() && this.width <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.width.max() && this.height >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.min() && this.height <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.portal.netherPortal.size.height.max(); // Plazma
|
||||
}
|
||||
|
||||
// CraftBukkit start - return boolean
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index b1a75e865e61f9cdfb6a6a57cbab3db1f2a709d3..3ca0f64bf5dcf104a84db91f22fae75790468052 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -40,7 +40,43 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public NetherPortal netherPortal;
|
||||
public class NetherPortal extends ConfigurationPart {
|
||||
|
||||
+ public Size size;
|
||||
+ public class Size extends ConfigurationPart {
|
||||
|
||||
+ public Width width;
|
||||
+ public Height height;
|
||||
+
|
||||
+ public class Width extends ConfigurationPart {
|
||||
+
|
||||
+ int min = 2;
|
||||
+ int max = 21;
|
||||
+
|
||||
+ public int min() {
|
||||
+ return Math.max(this.min, 1);
|
||||
+ }
|
||||
+
|
||||
+ public int max() {
|
||||
+ return Math.max(this.min, this.max);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public class Height extends ConfigurationPart {
|
||||
+
|
||||
+ int min = 3;
|
||||
+ int max = 21;
|
||||
+
|
||||
+ public int min() {
|
||||
+ return Math.max(this.min, 2);
|
||||
+ }
|
||||
+
|
||||
+ public int max() {
|
||||
+ return Math.max(this.min, this.max);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:13:07 +0900
|
||||
Subject: [PATCH] Avoid double I/O operation on load player file
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
index e0f085169fafa5e574caf368efa343514540b348..042617c7de30707f66e60536cebc31e210647b64 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
@@ -60,7 +60,8 @@ public class PlayerDataStorage {
|
||||
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
|
||||
// Spigot Start
|
||||
boolean usingWrongFile = false;
|
||||
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
||||
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
|
||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && !isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
|
||||
{
|
||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
if ( file.exists() )
|
||||
@@ -71,7 +72,7 @@ public class PlayerDataStorage {
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
- if (file.exists() && file.isFile()) {
|
||||
+ if (isNormalFile) { // Plazma - Avoid double I/O operation
|
||||
nbttagcompound = NbtIo.readCompressed(file.toPath(), NbtAccounter.unlimitedHeap());
|
||||
}
|
||||
// Spigot Start
|
||||
@@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 19:52:12 +0900
|
||||
Subject: [PATCH] Misc configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 4f54ae58bd20481f02aaec3f8406996a5e01b24f..61477d98f10ce7d0ec29d51de8c7a3b42026dd2d 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -35,5 +35,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean allowAnyUsername = false;
|
||||
public boolean enableBypassReducedDebugInfoPermission = true; // TODO: Move to Player.Permissions class
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public Misc misc;
|
||||
+ public class Misc extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 3ca0f64bf5dcf104a84db91f22fae75790468052..843cf772c18d2e9386bf5a7b1731a86c349d6b98 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -82,5 +82,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public Misc misc;
|
||||
+ public class Misc extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 12:03:06 +0900
|
||||
Subject: [PATCH] Do not refresh LootTable for non player interaction
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
index fa64bf5ad13c278438039b663ea3134e72108411..3ec9cb7c98cd5d3cb26e4a27174a75fe243c81c0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@@ -68,6 +68,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
|
||||
@Override
|
||||
public void unpackLootTable(@org.jetbrains.annotations.Nullable final Player player) {
|
||||
+ if (player == null && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.refreshLootTableForNonPlayerInteraction) return; // Plazma - Do not refresh LootTable for non player interaction
|
||||
// Copied from super with changes, always check the original method
|
||||
net.minecraft.world.level.Level level = this.getLevel();
|
||||
BlockPos blockPos = this.getBlockPos();
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d922c572e2410fa1f719fe2371f65cd1542ca8b4..a060257a62da7ed02b342b426e18e5f02ecdbdc9 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -66,6 +66,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean reduceRandom = OPTIMIZE;
|
||||
public boolean ignoreThreadSafeRandom = false;
|
||||
+ public boolean refreshLootTableForNonPlayerInteraction = !OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 20:02:59 +0900
|
||||
Subject: [PATCH] Reduce create random instance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..d157758282cc79d58134c056c52a43a24d443153 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
@@ -65,7 +65,7 @@ public class SpreadPlayersCommand {
|
||||
if (maxY < j) {
|
||||
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
|
||||
} else {
|
||||
- RandomSource randomsource = RandomSource.create();
|
||||
+ RandomSource randomsource = worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create(); // Plazma
|
||||
double d0 = (double) (center.x - maxRange);
|
||||
double d1 = (double) (center.y - maxRange);
|
||||
double d2 = (double) (center.x + maxRange);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index f39b3f1b5b37d1939766952a985684279cb2bf2d..69d22bc9f0087dc419b840c6626746e12f621012 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -447,7 +447,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
@@ -484,7 +484,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
index 1ef089dbf83de35d875c00efdf468c397be56978..dc111e0d1e7303c56cd12fa83be3ff85ab989e1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
@@ -349,7 +349,7 @@ public class QueryThreadGs4 extends GenericThread {
|
||||
this.identBytes[2] = bs[5];
|
||||
this.identBytes[3] = bs[6];
|
||||
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
|
||||
- this.challenge = RandomSource.create().nextInt(16777216);
|
||||
+ this.challenge = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? java.util.concurrent.ThreadLocalRandom.current().nextInt(16777216) : RandomSource.create().nextInt(16777216); // Plazma
|
||||
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index b8c238287e0639b578170c6fec0d4db5a1a59fe7..9e5eab45d589db16b4f1ec563e40dc3890581bf4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -86,7 +86,7 @@ public class FishingHook extends Projectile {
|
||||
|
||||
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
|
||||
super(type, world);
|
||||
- this.syncronizedRandom = RandomSource.create();
|
||||
+ this.syncronizedRandom = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
||||
this.openWater = true;
|
||||
this.currentState = FishingHook.FishHookState.FLYING;
|
||||
this.noCulling = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index f7399737548483905f3b5c08a03876b0da54b714..7ff8e19fcee67a33bbc8603f8c089a5b76ed23b6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -110,7 +110,7 @@ public class Raid {
|
||||
|
||||
public Raid(int id, ServerLevel world, BlockPos pos) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.id = id;
|
||||
this.level = world;
|
||||
@@ -124,7 +124,7 @@ public class Raid {
|
||||
|
||||
public Raid(ServerLevel world, CompoundTag nbt) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.level = world;
|
||||
this.id = nbt.getInt("Id");
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 4932374ab9a3d8582fb0ef024d817ad896dd23c4..fd9be520b838346555dee2dc13f54dcf0fe0e9d8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -81,7 +81,7 @@ public class Explosion {
|
||||
}
|
||||
|
||||
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma
|
||||
this.toBlow = new ObjectArrayList();
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 08f9af1d7aebba943096b59b6452818a1aafc94c..1d2c3147abfa09233976f4cc1cc417a9dab9ed44 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -124,7 +124,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public final Thread thread;
|
||||
private final boolean isDebug;
|
||||
private int skyDarken;
|
||||
- protected int randValue = RandomSource.create().nextInt();
|
||||
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? java.util.concurrent.ThreadLocalRandom.current().nextInt() : RandomSource.create().nextInt(); // Plazma
|
||||
protected final int addend = 1013904223;
|
||||
protected float oRainLevel;
|
||||
public float rainLevel;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 7291e4056b8e46ab59b71818388ac55fbb12993f..5e5efeec92f70060b0d409252ceff65691155367 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
}
|
||||
|
||||
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
||||
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), pos); // Plazma
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index 5b333bef255d7ef61c99510837536920c6fb6e8c..6331c068aefcdf07d2c880eef8df07add277f856 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -472,7 +472,7 @@ public class EndDragonFight {
|
||||
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
|
||||
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
||||
}).ifPresent((holder_c) -> {
|
||||
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), pos);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
||||
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
||||
}
|
||||
// Paper end
|
||||
- worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation);
|
||||
+ worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), this.portalLocation);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 61477d98f10ce7d0ec29d51de8c7a3b42026dd2d..3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,7 +40,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
-
|
||||
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 843cf772c18d2e9386bf5a7b1731a86c349d6b98..14987ceec693397602b5c8e1fe460a6fc212a0ee 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -87,7 +87,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
-
|
||||
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 12:07:06 +0900
|
||||
Subject: [PATCH] Do not load chunks to spawn phantom
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
index 0847aef56d8608cb1403485f231f30b2527f35ab..fee30f686a5d1ee50a00c2073efd5b0a80e85179 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
|
||||
|
||||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper - Ability to control player's insomnia and phantoms
|
||||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
||||
+ if (!world.plazmaConfig().entity.phantom.loadChunksToSpawn && !world.hasChunkAt(blockposition1)) continue; // Plazma - Do not load chunks to spawn phantom
|
||||
BlockState iblockdata = world.getBlockState(blockposition1);
|
||||
FluidState fluid = world.getFluidState(blockposition1);
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index c8b10b3499fbdf41f0b268d8a9da729e3432bb66..922d1d250f2e2e5a4177bcf5fe7487ff2b43413b 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -32,6 +32,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
+ public boolean loadChunksToSpawn = !OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 20:38:21 +0900
|
||||
Subject: [PATCH] Entity Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 14987ceec693397602b5c8e1fe460a6fc212a0ee..5dcabaf3fa198a05afc25753f6d062fe7d86972e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -90,4 +90,21 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
+
|
||||
+ public Entity entity;
|
||||
+ public class Entity extends ConfigurationPart {
|
||||
+
|
||||
+ public Monster monster;
|
||||
+ public class Monster extends ConfigurationPart {
|
||||
+
|
||||
+ public Phantom phantom;
|
||||
+ public class Phantom extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 5 Nov 2023 12:16:14 +0900
|
||||
Subject: [PATCH] Add option to disable moved to quickly check for specific
|
||||
players
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index f7ac60e1aa188ec25a4c5d326cdd4a109a54101c..613f12a7194920690c42ffca2fdf6908700516e5 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1472,6 +1472,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// Paper end - Prevent moving into unloaded chunks
|
||||
|
||||
+ if (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) // Plazma - Options to bypass moved to quickly check
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index a060257a62da7ed02b342b426e18e5f02ecdbdc9..f7e4d14a7eaa3e35c9b03f3c6a01ae8712ded569 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -27,6 +27,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Player player;
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
+ public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 20:42:23 +0900
|
||||
Subject: [PATCH] Various Optimizations
|
||||
|
||||
[ORIGINAL PATCHES]
|
||||
0007 - Avoid double I/O operation on load player file (Akarin)
|
||||
0008 - Don't trigger Lootable Refresh for non player interaction
|
||||
(Akarin)
|
||||
0011 - Swaps the predicate order of collision (Akarin)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index cf0d8da4c4b5f4aa4e4ef15897ca252a2b52ec8d..42c1b7c635cd22125dbb6b4d195976daac0c9ea1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2145,8 +2145,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public void playerTouch(Player player) {}
|
||||
|
||||
public void push(Entity entity) {
|
||||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
|
||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||
- if (!entity.noPhysics && !this.noPhysics) {
|
||||
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - moved up
|
||||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
|
||||
double d0 = entity.getX() - this.getX();
|
||||
double d1 = entity.getZ() - this.getZ();
|
||||
@@ -2174,8 +2175,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
entity.push(d0, 0.0D, d1);
|
||||
}
|
||||
}
|
||||
-
|
||||
- }
|
||||
+ //} // Plazma
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
index 765ee7f78532a363813286ef7db2a7e48605cb06..47830edd65b7f54a01559c80d28586b91cc07739 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
}
|
||||
|
||||
public void unpackLootTable(@Nullable Player player) {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.doNotTriggerLootTableRefreshForNonPlayerInteraction && player == null) return; // Plazma
|
||||
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
|
||||
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
|
||||
if (player instanceof ServerPlayer) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..9f1ee01eb9dcb599d1eb453653c7e7479fb24a4c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
|
||||
|
||||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
|
||||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
||||
+ if (world.plazmaLevelConfiguration().entity.monster.phantom.doNotLoadChunksToSpawn && world.hasChunkAt(blockposition1)) continue; // Plazma
|
||||
BlockState iblockdata = world.getBlockState(blockposition1);
|
||||
FluidState fluid = world.getFluidState(blockposition1);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
index 36af81f0957d17e170d229059c66f4eb4539dfeb..039c952f0c157cba6e79fa9b976958bd1763a922 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
@@ -56,7 +56,8 @@ public class PlayerDataStorage {
|
||||
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
|
||||
// Spigot Start
|
||||
boolean usingWrongFile = false;
|
||||
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
||||
+ boolean normalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
|
||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && !normalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
|
||||
{
|
||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
if ( file.exists() )
|
||||
@@ -67,7 +68,7 @@ public class PlayerDataStorage {
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
- if (file.exists() && file.isFile()) {
|
||||
+ if (normalFile) { // Plazma - Avoid double I/O operation
|
||||
nbttagcompound = NbtIo.readCompressed(file);
|
||||
}
|
||||
// Spigot Start
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 3e0d0d21dc73b2a5d033d8bcd43b08866e0d6923..e91b404fca2823748c2ed343cbd83301e55b2f0a 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -41,6 +41,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
+ public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 5dcabaf3fa198a05afc25753f6d062fe7d86972e..504913e8e05869f8f0b88f0faaf684d39eb14ea7 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -100,7 +100,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
-
|
||||
+ public boolean doNotLoadChunksToSpawn = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 20:46:40 +0900
|
||||
Subject: [PATCH] Add configuration to disable moved to quickly check for
|
||||
spectators
|
||||
|
||||
|
||||
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
|
||||
--- 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
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||
|
||||
- if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
+ if (!(this.player.level().plazmaLevelConfiguration().misc.checkSpectatorMovedToQuickly && this.player.isSpectator()) && d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Plazma
|
||||
// CraftBukkit end
|
||||
// Paper start - Add fail move event
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 504913e8e05869f8f0b88f0faaf684d39eb14ea7..61c06213b4ceb8e38e9aa41c3517f152d0d669ad 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -88,6 +88,7 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
+ public boolean checkSpectatorMovedToQuickly = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
54
patches/server/0024-Ignore-useless-entity-packets.patch
Normal file
54
patches/server/0024-Ignore-useless-entity-packets.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:35:19 +0900
|
||||
Subject: [PATCH] Ignore useless entity packets
|
||||
|
||||
[REFERENCE]
|
||||
- PurpurMC/Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index cf098d4a3111771c13766285c5ec5f1fc1f539a4..433e9a06db191f8a0ff6c23d1ac6122606e67959 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -207,6 +207,8 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
+
|
||||
+ if (this.level.plazmaConfig().entity.ignoreUselessPackets && isUselessPacket(packet1)) packet1 = null; // Plazma - Ignore useless entity packets
|
||||
}
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
@@ -281,6 +283,19 @@ public class ServerEntity {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Plazma start - Ignore useless entity packets
|
||||
+ private boolean isUselessPacket(@Nullable Packet<?> packet) {
|
||||
+ if (!(packet instanceof ClientboundMoveEntityPacket p)) return false;
|
||||
+ if (p instanceof ClientboundMoveEntityPacket.Pos)
|
||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0;
|
||||
+ if (p instanceof ClientboundMoveEntityPacket.Rot)
|
||||
+ return p.getxRot() == 0 && p.getyRot() == 0;
|
||||
+ if (p instanceof ClientboundMoveEntityPacket.PosRot)
|
||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0 && p.getxRot() == 0 && p.getyRot() == 0;
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Plazma end - Ignore useless entity packets
|
||||
+
|
||||
public void removePairing(ServerPlayer player) {
|
||||
this.entity.stopSeenByPlayer(player);
|
||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 922d1d250f2e2e5a4177bcf5fe7487ff2b43413b..c8a3e91d0d6510b519e927027f5a534cddf7d0a3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -29,6 +29,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ public boolean ignoreUselessPackets = OPTIMIZE;
|
||||
+
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
@@ -1,471 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 21:50:25 +0900
|
||||
Subject: [PATCH] Apply faster random
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..4f264e098e7907c397f09ee23a579ed7da494edc 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
@@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
|
||||
public class PaperLootableInventoryData {
|
||||
|
||||
- private static final Random RANDOM = new Random();
|
||||
+ private static final Random RANDOM = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
||||
|
||||
private long lastFill = -1;
|
||||
private long nextRefill = -1;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0acbaa18a61d1cfdb894c6c756d2b9bdc3599b82..93ff3ef401d4212cede5290990528988c7ca3a0c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -691,7 +691,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
||||
// CraftBukkit start
|
||||
if (world.generator != null) {
|
||||
- Random rand = new Random(world.getSeed());
|
||||
+ Random rand = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); rand.setSeed(world.getSeed()); // Plazma
|
||||
org.bukkit.Location spawn = world.generator.getFixedSpawnLocation(world.getWorld(), rand);
|
||||
|
||||
if (spawn != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 1392e483c363e25d1f16465d876cb7d7c70afa68..f4b99ffec5c84a5fa1f90060ec15d09b08239d49 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -229,7 +229,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- private static final Random rand = new Random();
|
||||
+ private static final Random rand = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
||||
|
||||
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
||||
this.world = world;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..7cd8a12ad560626ad3965bd46a5a71168ce6bf80 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
@@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
|
||||
public class CraftFirework extends CraftProjectile implements Firework {
|
||||
|
||||
- private final Random random = new Random();
|
||||
+ private final Random random = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
||||
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
||||
|
||||
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
index c3972ba41ad61af4c423e6f942ac984dc61716f0..f7b53cf1161e53d49ec2b72fed2473c1814159cd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
@@ -48,7 +48,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||
private final net.minecraft.world.level.chunk.ChunkGenerator delegate;
|
||||
private final ChunkGenerator generator;
|
||||
private final ServerLevel world;
|
||||
- private final Random random = new Random();
|
||||
+ private final Random random = Boolean.getBoolean("Plazma.doNotUseFasterRandom") ? new Random() : new org.plazmamc.plazma.Random(); // Plazma
|
||||
private boolean newApi;
|
||||
private boolean implementBaseHeight = true;
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Random.java b/src/main/java/org/plazmamc/plazma/Random.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e72e96be3938bdcc1ae1aa94f7465f644e1b3e16
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Random.java
|
||||
@@ -0,0 +1,394 @@
|
||||
+package org.plazmamc.plazma;
|
||||
+
|
||||
+/**
|
||||
+ + This is a faster implementation of java.util.Random
|
||||
+ + Code from <a href="https://gist.github.com/Xyene/4637619">...</a> by Xyene
|
||||
+ + Licensed unser GNU LGPL v3.0
|
||||
+ + <p>
|
||||
+ * A random number generator based on the simple and fast xor-shift pseudo
|
||||
+ * random number generator (RNG) specified in:
|
||||
+ * Marsaglia, George. (2003). Xorshift RNGs.
|
||||
+ * <a href="http://www.jstatsoft.org/v08/i14/xorshift.pdf">...</a>
|
||||
+ * Translated from:
|
||||
+ * <a href="http://www.codeproject.com/Articles/9187/A-fast-equivalent-for-System-Random">...</a>.
|
||||
+ */
|
||||
+@SuppressWarnings("SuspiciousNameCombination")
|
||||
+public class Random extends java.util.Random {
|
||||
+ final double REAL_UNIT_INT = 1.0 / (0x7FFFFFFFL);
|
||||
+ final double REAL_UNIT_UINT = 1.0 / (0xFFFFFFFFL);
|
||||
+ final long Y = 842502087L, Z = 3579807591L, W = 273326509L;
|
||||
+ long x, y, z, w;
|
||||
+
|
||||
+ public Random() {
|
||||
+ seed((int) System.currentTimeMillis());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSeed(long seed) {
|
||||
+ seed((int) seed);
|
||||
+ }
|
||||
+
|
||||
+ public void seed(int seed) {
|
||||
+ // The only stipulation stated for the xorshift RNG is that at least one of
|
||||
+ // the seeds x,y,z,w is non-zero. We fulfill that requirement by only allowing
|
||||
+ // resetting of the x seed
|
||||
+ x = seed;
|
||||
+ y = Y;
|
||||
+ z = Z;
|
||||
+ w = W;
|
||||
+ }
|
||||
+
|
||||
+ long boolBuffer;
|
||||
+ int boolBufferBits = 0;
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean nextBoolean() {
|
||||
+ if (boolBufferBits == 0) {
|
||||
+ boolBuffer = nextUInt();
|
||||
+ boolBufferBits = 32;
|
||||
+ }
|
||||
+ boolBuffer >>= 1;
|
||||
+ boolean bit = (boolBuffer & 1) == 0;
|
||||
+ --boolBufferBits;
|
||||
+ return bit;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void nextBytes(byte[] buffer) {
|
||||
+ // Fill up the bulk of the buffer in chunks of 4 bytes at a time.
|
||||
+ long x = this.x, y = this.y, z = this.z, w = this.w;
|
||||
+ int i = 0;
|
||||
+ long t;
|
||||
+ for (int bound = buffer.length - 3; i < bound; ) {
|
||||
+ // Generate 4 bytes.
|
||||
+ // Increased performance is achieved by generating 4 random bytes per loop.
|
||||
+ // Also note that no mask needs to be applied to zero out the higher order bytes before
|
||||
+ // casting because the cast ignores thos bytes. Thanks to Stefan Trosch黷z for pointing this out.
|
||||
+ t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+ w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
|
||||
+
|
||||
+ buffer[i++] = (byte) w;
|
||||
+ buffer[i++] = (byte) (w >> 8);
|
||||
+ buffer[i++] = (byte) (w >> 16);
|
||||
+ buffer[i++] = (byte) (w >> 24);
|
||||
+ }
|
||||
+
|
||||
+ // Fill up any remaining bytes in the buffer.
|
||||
+ if (i < buffer.length) {
|
||||
+ // Generate 4 bytes.
|
||||
+ t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+ w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
|
||||
+
|
||||
+ buffer[i++] = (byte) w;
|
||||
+ if (i < buffer.length) {
|
||||
+ buffer[i++] = (byte) (w >> 8);
|
||||
+ if (i < buffer.length) {
|
||||
+ buffer[i++] = (byte) (w >> 16);
|
||||
+ if (i < buffer.length) {
|
||||
+ buffer[i] = (byte) (w >> 24);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ this.x = x;
|
||||
+ this.y = y;
|
||||
+ this.z = z;
|
||||
+ this.w = w;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextDouble() {
|
||||
+ long t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+
|
||||
+ // Here we can gain a 2x speed improvement by generating a value that can be cast to
|
||||
+ // an int instead of the more easily available uint. If we then explicitly cast to an
|
||||
+ // int the compiler will then cast the int to a double to perform the multiplication,
|
||||
+ // this final cast is a lot faster than casting from a uint to a double. The extra cast
|
||||
+ // to an int is very fast (the allocated bits remain the same) and so the overall effect
|
||||
+ // of the extra cast is a significant performance improvement.
|
||||
+ //
|
||||
+ // Also note that the loss of one bit of precision is equivalent to what occurs within
|
||||
+ // System.Random.
|
||||
+ return (REAL_UNIT_INT * (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))));
|
||||
+ }
|
||||
+
|
||||
+ public double random() {
|
||||
+ return nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float nextFloat() {
|
||||
+ return (float) nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt() {
|
||||
+ long t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+ return (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt(int upperBound) {
|
||||
+ if (upperBound < 0)
|
||||
+ throw new IllegalArgumentException("upperBound must be >=0");
|
||||
+
|
||||
+ long t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+
|
||||
+ return (int) ((REAL_UNIT_INT * (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * upperBound);
|
||||
+ }
|
||||
+
|
||||
+ public int nextInt(int lowerBound, int upperBound) {
|
||||
+ if (lowerBound > upperBound)
|
||||
+ throw new IllegalArgumentException("upperBound must be >=lowerBound");
|
||||
+
|
||||
+ long t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+
|
||||
+ // The explicit int cast before the first multiplication gives better performance.
|
||||
+ // See comments in NextDouble.
|
||||
+ int range = upperBound - lowerBound;
|
||||
+ if (range < 0) {
|
||||
+ // If range is <0 then an overflow has occured and must resort to using long integer arithmetic instead (slower).
|
||||
+ // We also must use all 32 bits of precision, instead of the normal 31, which again is slower.
|
||||
+ return lowerBound + (int) ((REAL_UNIT_UINT * (double) (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))) * (double) ((long) upperBound - (long) lowerBound));
|
||||
+ }
|
||||
+ // 31 bits of precision will suffice if range<=int.MaxValue. This allows us to cast to an int and gain
|
||||
+ // a little more performance.
|
||||
+ return lowerBound + (int) ((REAL_UNIT_INT * (double) (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * (double) range);
|
||||
+ }
|
||||
+
|
||||
+ public long nextUInt() {
|
||||
+ long t = (x ^ (x << 11));
|
||||
+ x = y;
|
||||
+ y = z;
|
||||
+ z = w;
|
||||
+ return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))) & (0xFFFFFFFFL);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public long nextLong() {
|
||||
+ return nextUInt() << 32 + nextUInt();
|
||||
+ }
|
||||
+
|
||||
+ double gaussNext;
|
||||
+ boolean hasGaussNext;
|
||||
+ final double TWOPI = Math.PI * 2;
|
||||
+
|
||||
+ /**
|
||||
+ * Get a random number in the range [min, max) or [min, max] depending on rounding.
|
||||
+ *
|
||||
+ * @param min Low bound
|
||||
+ * @param max High bound
|
||||
+ * @return A uniformly distributed double
|
||||
+ */
|
||||
+ public double uniform(double min, double max) {
|
||||
+ return min + (max - min) * nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Triangular distribution.
|
||||
+ * <p/>
|
||||
+ * Continuous distribution bounded by given lower and upper limits,
|
||||
+ * and having a given mode value in-between.
|
||||
+ * http://en.wikipedia.org/wiki/Triangular_distribution
|
||||
+ *
|
||||
+ * @param low Low bound
|
||||
+ * @param high High bound
|
||||
+ * @param mode Mode
|
||||
+ * @return A number from the triangular distribution specified
|
||||
+ */
|
||||
+ public double triangular(int low, int high, int mode) {
|
||||
+ double u = nextDouble();
|
||||
+ double c = (mode - low) / (high - low);
|
||||
+ if (u > c) {
|
||||
+ u = 1.0 - u;
|
||||
+ c = 1.0 - c;
|
||||
+ int k = low;
|
||||
+ low = high;
|
||||
+ high = k;
|
||||
+ }
|
||||
+ return low + (high - low) * Math.sqrt(u * c);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gaussian distribution, mean is 0 and standard deviation is 1.
|
||||
+ * <p/>
|
||||
+ * mu is the mean, and sigma is the standard deviation.
|
||||
+ *
|
||||
+ * @return A double in Gaussian distribution
|
||||
+ */
|
||||
+ public double gauss() {
|
||||
+ return nextGaussian();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gaussian distribution, with user-specified mean and standard deviation.
|
||||
+ * <p/>
|
||||
+ * mu is the mean, and sigma is the standard deviation.
|
||||
+ *
|
||||
+ * @return A double in Gaussian distribution
|
||||
+ */
|
||||
+ public double gauss(double mu, double sigma) {
|
||||
+ return mu + sigma * nextGaussian();
|
||||
+ }
|
||||
+
|
||||
+ public double gaussUnsigned(double mu, double sigma) {
|
||||
+ double out = gauss(mu, sigma);
|
||||
+ return out > 1 ? out : 1;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Log normal distribution.
|
||||
+ * <p/>
|
||||
+ * If you take the natural logarithm of this distribution, you'll get a
|
||||
+ * normal distribution with mean mu and standard deviation sigma.
|
||||
+ * mu can have any value, and sigma must be greater than zero.
|
||||
+ *
|
||||
+ * @param mu Mean
|
||||
+ * @param sigma Standard deviation
|
||||
+ * @return A number from the log normal distribution specified
|
||||
+ */
|
||||
+ public double logNormal(double mu, double sigma) {
|
||||
+ return Math.exp(gauss(mu, sigma));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Exponential distribution.
|
||||
+ * <p/>
|
||||
+ * lambda is 1.0 divided by the desired mean. It should be
|
||||
+ * nonzero. Returned values range from 0 to positive infinity
|
||||
+ * if lambda is positive, and from negative infinity to 0
|
||||
+ * if lambda is negative.
|
||||
+ *
|
||||
+ * @param lambda A non-zero value
|
||||
+ */
|
||||
+ public double exponential(double lambda) {
|
||||
+ return -Math.log(1.0 - random()) / lambda;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Circular data distribution.
|
||||
+ * <p/>
|
||||
+ * If kappa is equal to zero, this distribution reduces
|
||||
+ * to a uniform random angle over the range 0 to 2*pi.
|
||||
+ *
|
||||
+ * @param mu the mean angle, expressed in radians between 0 and 2*pi.
|
||||
+ * @param kappa the concentration parameter, which must be greater than or
|
||||
+ * equal to zero.
|
||||
+ * @return A number from the circular data distribution specified
|
||||
+ */
|
||||
+ public double circularData(double mu, double kappa) {
|
||||
+ if (kappa <= 1e-6)
|
||||
+ return TWOPI * nextDouble();
|
||||
+
|
||||
+ double a = 1.0 + Math.sqrt(1.0 + 4.0 * kappa * kappa);
|
||||
+ double b = (a - Math.sqrt(2.0 * a)) / (2.0 * kappa);
|
||||
+ double r = (1.0 + b * b) / (2.0 * b);
|
||||
+ double u1, u2, u3, f, c, z, theta = 0;
|
||||
+
|
||||
+ while (true) {
|
||||
+ u1 = nextDouble();
|
||||
+
|
||||
+ z = Math.cos(Math.PI * u1);
|
||||
+ f = (1.0 + r * z) / (r + z);
|
||||
+ c = kappa * (r - f);
|
||||
+
|
||||
+ u2 = nextDouble();
|
||||
+
|
||||
+ if (u2 < c * (2.0 - c) || u2 <= c * Math.exp(1.0 - c))
|
||||
+ break;
|
||||
+
|
||||
+ u3 = nextDouble();
|
||||
+ if (u3 > 0.5)
|
||||
+ theta = (mu % TWOPI) + Math.acos(f);
|
||||
+ else
|
||||
+ theta = (mu % TWOPI) - Math.acos(f);
|
||||
+ }
|
||||
+ return theta;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ final double LOG4 = Math.log(4);
|
||||
+ final double SG_MAGICCONST = 1.0 + Math.log(4.5);
|
||||
+
|
||||
+ /**
|
||||
+ * Gamma distribution. Not the gamma function!
|
||||
+ * Conditions on the parameters are alpha > 0 and beta > 0.
|
||||
+ * <p/>
|
||||
+ * The probability distribution function is:
|
||||
+ * pdf(x) = (x ** (alpha - 1) * math.exp(-x / beta)) / (math.gamma(alpha) * beta ** alpha)
|
||||
+ *
|
||||
+ * @param alpha Alpha
|
||||
+ * @param beta Beta
|
||||
+ * @return A number from the gamma distribution specified
|
||||
+ */
|
||||
+ public double gamma(double alpha, double beta) {
|
||||
+ if (alpha <= 0.0 || beta <= 0.0)
|
||||
+ throw new IllegalArgumentException("alpha and beta must be > 0.0");
|
||||
+
|
||||
+ if (alpha > 1.0) {
|
||||
+ double ainv = Math.sqrt(2.0 * alpha - 1.0);
|
||||
+ double bbb = alpha - LOG4;
|
||||
+ double ccc = alpha + ainv;
|
||||
+ double u1, u2, v, x, z, r;
|
||||
+
|
||||
+ while (true) {
|
||||
+ u1 = random();
|
||||
+ if (!(1e-7 < u1 && u1 < .9999999))
|
||||
+ continue;
|
||||
+ u2 = 1.0 - random();
|
||||
+ v = Math.log(u1 / (1.0 - u1)) / ainv;
|
||||
+ x = alpha * Math.exp(v);
|
||||
+ z = u1 * u1 * u2;
|
||||
+ r = bbb + ccc * v - x;
|
||||
+ if (r + SG_MAGICCONST - 4.5 * z >= 0.0 || r >= Math.log(z))
|
||||
+ return x * beta;
|
||||
+ }
|
||||
+ } else if (alpha == 1.0) {
|
||||
+ // exponential(1)
|
||||
+ double u;
|
||||
+ u = random();
|
||||
+ while (u <= 1e-7)
|
||||
+ u = random();
|
||||
+ return -Math.log(u) * beta;
|
||||
+ } else {
|
||||
+ // alpha is between 0 and 1 (exclusive)
|
||||
+ // Uses ALGORITHM GS of Statistical Computing -Kennedy & Gentle
|
||||
+
|
||||
+ double u, b, p, x, u1;
|
||||
+ while (true) {
|
||||
+ u = random();
|
||||
+ b = (Math.E + alpha) / Math.E;
|
||||
+ p = b * u;
|
||||
+ if (p <= 1.0)
|
||||
+ x = Math.pow(p, (1.0 / alpha));
|
||||
+ else
|
||||
+ x = -Math.log((b - p) / alpha);
|
||||
+ u1 = random();
|
||||
+ if (p > 1.0) {
|
||||
+ if (u1 <= Math.pow(x, (alpha - 1.0)))
|
||||
+ break;
|
||||
+ } else if (u1 <= Math.exp(-x))
|
||||
+ break;
|
||||
+ }
|
||||
+ return x * beta;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
@@ -1,30 +1,28 @@
|
||||
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
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 27 Apr 2024 14:14:49 +0900
|
||||
Subject: [PATCH] Improve biome temperture cache
|
||||
|
||||
Original: fxmorin/MemoryLeakFix
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
|
||||
index 0c317b0147a73a8075e0883f0c132f4db0bdfea7..97c5cc3e2e6721321d9c500e331cab1aee37a0fc 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 {
|
||||
@@ -64,7 +64,7 @@ public final class Biome {
|
||||
private final MobSpawnSettings mobSettings;
|
||||
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
|
||||
return Util.make(() -> {
|
||||
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> Util.make(() -> {
|
||||
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> Util.make(() -> { // Plazma - Improve biome temperature cache
|
||||
/*
|
||||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||
@@ -125,7 +125,7 @@ public final class Biome {
|
||||
protected void rehash(int i) {
|
||||
@@ -118,7 +118,7 @@ public final class Biome {
|
||||
public float getTemperature(BlockPos blockPos) {
|
||||
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 biome temperature cache
|
||||
float f = cache.getValue(l);
|
||||
if (!Float.isNaN(f)) {
|
||||
return f;
|
||||
35
patches/server/0026-Configurable-entity-sensor-tick.patch
Normal file
35
patches/server/0026-Configurable-entity-sensor-tick.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 6 Nov 2023 11:36:08 +0900
|
||||
Subject: [PATCH] Configurable entity sensor tick
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 41ee792f572b13054084b9ad6c6e4cf67ed10290..0d83baabdfabff925c11d363a78414afebe513d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -938,10 +938,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
// Paper end - Allow nerfed mobs to jump and float
|
||||
//this.level().getProfiler().push("sensing"); // Purpur
|
||||
- this.sensing.tick();
|
||||
+ //this.sensing.tick(); // Plazma - Moved down
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
int i = this.level().getServer().getTickCount() + this.getId();
|
||||
|
||||
+ if (i % this.level().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
|
||||
if (i % 2 != 0 && this.tickCount > 1) {
|
||||
//this.level().getProfiler().push("targetSelector"); // Purpur
|
||||
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index c8a3e91d0d6510b519e927027f5a534cddf7d0a3..bc283729cab4df2c596febf1df54241571227564 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -30,6 +30,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
public boolean ignoreUselessPackets = OPTIMIZE;
|
||||
+ public int sensorTick = 1;
|
||||
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 22:07:39 +0900
|
||||
Subject: [PATCH] Do not send useless entity packets
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index fb11b020d52988360562db23d8568e5ef37e21c8..80ab684a33876d62186dcf86f555e46db1594b09 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -203,6 +203,7 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.doNotSendUselessEntityPackets && isUselessEntityPacket(packet1)) packet1 = null; // Plazma
|
||||
}
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
@@ -275,6 +276,21 @@ public class ServerEntity {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Plazma start
|
||||
+ private boolean isUselessEntityPacket(@Nullable Packet<?> packet) {
|
||||
+ if (packet == null) return false;
|
||||
+ if (packet instanceof ClientboundMoveEntityPacket p) {
|
||||
+ if (p instanceof ClientboundMoveEntityPacket.Pos)
|
||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0;
|
||||
+ else if (p instanceof ClientboundMoveEntityPacket.Rot)
|
||||
+ return p.getxRot() == 0 && p.getyRot() == 0;
|
||||
+ else if (p instanceof ClientboundMoveEntityPacket.PosRot)
|
||||
+ return p.getXa() == 0 && p.getYa() == 0 && p.getZa() == 0 && p.getxRot() == 0 && p.getyRot() == 0;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
public void removePairing(ServerPlayer player) {
|
||||
this.entity.stopSeenByPlayer(player);
|
||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index e91b404fca2823748c2ed343cbd83301e55b2f0a..d21be63b98f026fa3ac7dcdc73f9f488a7000643 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
+ public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
}
|
||||
57
patches/server/0027-Configurable-cave-lava-sea-level.patch
Normal file
57
patches/server/0027-Configurable-cave-lava-sea-level.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Tue, 7 Nov 2023 15:32:24 +0900
|
||||
Subject: [PATCH] Configurable cave lava sea level
|
||||
|
||||
This patch also fix MC-237017.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
index 98c7f695093acbcf9382a5f07a7a89e373709763..a85b1ebb4236f131b9be0104c4aa56f22e661441 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
@@ -72,6 +72,15 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
}
|
||||
|
||||
private static Aquifer.FluidPicker createFluidPicker(NoiseGeneratorSettings settings) {
|
||||
+ // Plazma start - Configurable cave lava sea level
|
||||
+ if (true) {
|
||||
+ org.plazmamc.plazma.configurations.GlobalConfiguration config = org.plazmamc.plazma.configurations.GlobalConfiguration.get();
|
||||
+ return (x, y, z) -> new Aquifer.FluidStatus(
|
||||
+ config.worldgen.caveLavaSeaLevel.useCustomSeaLevel ? config.worldgen.caveLavaSeaLevel.customSeaLevel : settings.seaLevel(),
|
||||
+ config.worldgen.caveLavaSeaLevel.customSeaLevel(settings)
|
||||
+ );
|
||||
+ }
|
||||
+ // Plazma end - Configurable cave lava sea level
|
||||
Aquifer.FluidStatus aquifer_b = new Aquifer.FluidStatus(-54, Blocks.LAVA.defaultBlockState());
|
||||
int i = settings.seaLevel();
|
||||
Aquifer.FluidStatus aquifer_b1 = new Aquifer.FluidStatus(i, settings.defaultFluid());
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index f7e4d14a7eaa3e35c9b03f3c6a01ae8712ded569..4f3ed01e12ccb8a6f1a5c4f605451bb36370a236 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -35,6 +35,25 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public WorldGeneration worldgen;
|
||||
public class WorldGeneration extends ConfigurationPart {
|
||||
|
||||
+ public CaveLavaSeaLevel caveLavaSeaLevel;
|
||||
+ public class CaveLavaSeaLevel extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean useCustomSeaLevel = false;
|
||||
+ public int customSeaLevel = -54;
|
||||
+ String customSeaBlock = "default";
|
||||
+
|
||||
+ public net.minecraft.world.level.block.state.BlockState customSeaLevel(net.minecraft.world.level.levelgen.NoiseGeneratorSettings settings) {
|
||||
+ if (this.customSeaBlock.equalsIgnoreCase("default")) return settings.defaultFluid();
|
||||
+ return net.minecraft.core.registries.BuiltInRegistries.BLOCK
|
||||
+ .getOptional(new net.minecraft.resources.ResourceLocation(this.customSeaBlock))
|
||||
+ .orElseGet(() -> {
|
||||
+ PlazmaConfigurations.LOGGER.warn("Invalid custom sea level block: {}, defaulting to lava", this.customSeaBlock);
|
||||
+ return net.minecraft.world.level.block.Blocks.LAVA;
|
||||
+ })
|
||||
+ .defaultBlockState();
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 26 Mar 2023 13:43:01 +0900
|
||||
Subject: [PATCH] No Chat Reports Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d21be63b98f026fa3ac7dcdc73f9f488a7000643..f67ac1a3dddb024af606da14b3929f10d8f22330 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -44,5 +44,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public NoChatReports noChatReports;
|
||||
+ public class NoChatReports extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+
|
||||
}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 26 Mar 2023 13:48:48 +0900
|
||||
Subject: [PATCH] Implement No Chat Reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 1f4b64a5f812376c499c98cb4be62469bd0b7dbe..c0bd2997fe3ebbfe926de832a36d209cc875f3e2 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -147,18 +147,23 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
public <T> T readJsonWithCodec(Codec<T> codec) {
|
||||
JsonElement jsonelement = (JsonElement) GsonHelper.fromJson(FriendlyByteBuf.GSON, this.readUtf(), JsonElement.class);
|
||||
DataResult<T> dataresult = codec.parse(JsonOps.INSTANCE, jsonelement);
|
||||
-
|
||||
- return Util.getOrThrow(dataresult, (s) -> {
|
||||
- return new DecoderException("Failed to decode json: " + s);
|
||||
- });
|
||||
+ // Plazma start - NCR
|
||||
+ T result = Util.getOrThrow(dataresult, (s) -> new DecoderException("Failed to decode json: " + s));
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && jsonelement.getAsJsonObject().has("preventsChatReports"))
|
||||
+ ((net.minecraft.network.protocol.status.ServerStatus) result).setPreventsChatReports(jsonelement.getAsJsonObject().get("preventsChatReports").getAsBoolean());
|
||||
+ return result;
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
|
||||
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
|
||||
|
||||
- this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
|
||||
- return new EncoderException("Failed to encode: " + s + " " + value);
|
||||
- })));
|
||||
+ // Plazma start - NCR
|
||||
+ JsonElement element = Util.getOrThrow(dataresult, (s) -> new EncoderException("Failed to encode: " + s + " " + value));
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.addQueryData() && codec == net.minecraft.network.protocol.status.ServerStatus.CODEC)
|
||||
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
|
||||
+ this.writeUtf(FriendlyByteBuf.GSON.toJson(element));
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <T> void writeId(IdMap<T> registry, T value) {
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
index 98ea56cbc8de5a5694b4f4d9a2f25811fdecba04..9e2a1f04cd9de2b0a7f3c512a4849a572d8fc00c 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
|
||||
@@ -62,4 +62,21 @@ public record ServerStatus(Component description, Optional<ServerStatus.Players>
|
||||
return new ServerStatus.Version(worldVersion.getName(), worldVersion.getProtocolVersion());
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Plazma start - NCR
|
||||
+ public boolean enforcesSecureChat() {
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled || this.enforcesSecureChat;
|
||||
+ }
|
||||
+
|
||||
+ private static boolean preventsChatReports;
|
||||
+
|
||||
+ public boolean preventsChatReports() {
|
||||
+ if (this.version().isPresent() && this.version().get().protocol() < 759 && this.version().get().protocol() > 0) return true;
|
||||
+ return this.preventsChatReports;
|
||||
+ }
|
||||
+
|
||||
+ public void setPreventsChatReports(boolean prevents) {
|
||||
+ this.preventsChatReports = prevents;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 191bebab12c94756e9f98cfacbf06eb9a7c2f2f9..2d47c13f768ac482422e118921d186d3cfd5d765 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -684,7 +684,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
public boolean enforceSecureProfile() {
|
||||
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
|
||||
|
||||
- return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null;
|
||||
+ return !org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled && dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null; // Plazma - NCR // TODO: Check
|
||||
}
|
||||
|
||||
protected boolean convertOldUsers() {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 09183dbac0e8ca2cc2c8da57b105b80eab42d459..e4c92730b63204126609a52d286da46ef6495080 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2293,10 +2293,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void send(Packet<?> packet) {
|
||||
+ // Plazma start - NCR
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket chat)
|
||||
+ packet = new ClientboundSystemChatPacket(null, Component.Serializer.toJson(chat.chatType().resolve(this.player.level().registryAccess()).get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content()))), false);
|
||||
this.send(packet, (PacketSendListener) null);
|
||||
}
|
||||
|
||||
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToGameMessage() && packet instanceof ClientboundPlayerChatPacket p && callbacks != null) {
|
||||
+ this.send(p);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
// CraftBukkit start
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 86932974a9101779691de336a8c45c464158fca8..b711efca8a834adaf0db902fab34c3c80c9cbad6 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1479,7 +1479,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Plazma - NCR
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index f67ac1a3dddb024af606da14b3929f10d8f22330..2033c7ff519e30f507e6535004687eb49c08c33b 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -49,7 +49,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public NoChatReports noChatReports;
|
||||
public class NoChatReports extends ConfigurationPart {
|
||||
|
||||
+ public boolean enabled = false;
|
||||
+ boolean addQueryData = true;
|
||||
+ boolean convertToGameMessage = true;
|
||||
|
||||
+ public boolean addQueryData() {
|
||||
+ return enabled && addQueryData;
|
||||
+ }
|
||||
+
|
||||
+ public boolean convertToGameMessage() {
|
||||
+ return enabled && convertToGameMessage;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
76
patches/server/0028-Variable-entity-wakeup-duration.patch
Normal file
76
patches/server/0028-Variable-entity-wakeup-duration.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 4 Dec 2023 23:01:32 +0900
|
||||
Subject: [PATCH] Variable entity wakeup duration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index bc283729cab4df2c596febf1df54241571227564..1e7c23c8851ba1d0f37d2b17fd334220e060888e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -39,6 +39,20 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public WakeUpDurationVariance wakeUpDurationVariance;
|
||||
+ public class WakeUpDurationVariance extends ConfigurationPart {
|
||||
+
|
||||
+ private double defaultValue() {
|
||||
+ return OPTIMIZE ? 0.2 : 0.0;
|
||||
+ }
|
||||
+
|
||||
+ double animal = defaultValue(); public double animal() { return Math.max(this.animal, 0.0); }
|
||||
+ double monster = defaultValue(); public double monster() { return Math.max(this.monster, 0.0); }
|
||||
+ double flying = defaultValue(); public double flying() { return Math.max(this.flying, 0.0); }
|
||||
+ double villager = defaultValue(); public double villager() { return Math.max(this.villager, 0.0); }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
public Structure structure;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 56e52b16b419c882440a15947f037ae1a902bc70..583647f6c9ca0fb092f30c97693bd548f692dfd3 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -68,29 +68,36 @@ public class ActivationRange
|
||||
Activity.PANIC
|
||||
};
|
||||
|
||||
+ // Plazma start - Variable entity wakeup duration
|
||||
+ private static int getWakeupDuration(net.minecraft.util.RandomSource random, int duration, double deviation) {
|
||||
+ if (deviation == 0) return duration;
|
||||
+ return (int) Math.min(Integer.MAX_VALUE, Math.max(1, Math.round(duration * (1 + deviation * random.nextGaussian()))));
|
||||
+ }
|
||||
+ // Plazma end - Variable entity wakeup duration
|
||||
private static int checkInactiveWakeup(Entity entity) {
|
||||
Level world = entity.level();
|
||||
SpigotWorldConfig config = world.spigotConfig;
|
||||
+ org.plazmamc.plazma.configurations.WorldConfigurations plazmaConfig = world.plazmaConfig(); // Plazma - Variable entity wakeup duration
|
||||
long inactiveFor = MinecraftServer.currentTick - entity.activatedTick;
|
||||
if (entity.activationType == ActivationType.VILLAGER) {
|
||||
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
|
||||
world.wakeupInactiveRemainingVillagers--;
|
||||
- return config.wakeUpInactiveVillagersFor;
|
||||
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveVillagersFor, plazmaConfig.entity.wakeUpDurationVariance.villager()); // Plazma - Variable entity wakeup duration
|
||||
}
|
||||
} else if (entity.activationType == ActivationType.ANIMAL) {
|
||||
if (inactiveFor > config.wakeUpInactiveAnimalsEvery && world.wakeupInactiveRemainingAnimals > 0) {
|
||||
world.wakeupInactiveRemainingAnimals--;
|
||||
- return config.wakeUpInactiveAnimalsFor;
|
||||
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveAnimalsFor, plazmaConfig.entity.wakeUpDurationVariance.animal()); // Plazma - Variable entity wakeup duration
|
||||
}
|
||||
} else if (entity.activationType == ActivationType.FLYING_MONSTER) {
|
||||
if (inactiveFor > config.wakeUpInactiveFlyingEvery && world.wakeupInactiveRemainingFlying > 0) {
|
||||
world.wakeupInactiveRemainingFlying--;
|
||||
- return config.wakeUpInactiveFlyingFor;
|
||||
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveFlyingFor, plazmaConfig.entity.wakeUpDurationVariance.flying()); // Plazma - Variable entity wakeup duration
|
||||
}
|
||||
} else if (entity.activationType == ActivationType.MONSTER || entity.activationType == ActivationType.RAIDER) {
|
||||
if (inactiveFor > config.wakeUpInactiveMonstersEvery && world.wakeupInactiveRemainingMonsters > 0) {
|
||||
world.wakeupInactiveRemainingMonsters--;
|
||||
- return config.wakeUpInactiveMonstersFor;
|
||||
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveMonstersFor, plazmaConfig.entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Sun, 26 Mar 2023 16:20:13 +0900
|
||||
Subject: [PATCH] FixMySpawnR Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 2033c7ff519e30f507e6535004687eb49c08c33b..b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -62,4 +62,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ public FixMySpawnR fixMySpawnR;
|
||||
+ public class FixMySpawnR extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+ public int timerTimeOut = 0;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
57
patches/server/0029-Optimise-state-lookup-more.patch
Normal file
57
patches/server/0029-Optimise-state-lookup-more.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 4 Dec 2023 23:12:47 +0900
|
||||
Subject: [PATCH] Optimise state lookup more
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..50d97c5ab33f33b81dbafd7cf42da5afd9856eeb 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
|
||||
@@ -17,6 +17,7 @@ public final class ZeroCollidingReferenceStateTable {
|
||||
protected final StateHolder<?, ?> this_state;
|
||||
|
||||
protected long[] index_table;
|
||||
+ public long[] index_table() { return this.index_table; } // Plazma - Getter
|
||||
protected StateHolder<?, ?>[][] value_table;
|
||||
|
||||
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||
index 2630f54d499abbe52798f97c8ea14a8d0bd75e99..014ccbafd8beecb7f3bfeea0cdaa6627a81796bd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
|
||||
@@ -115,6 +115,12 @@ public abstract class StateHolder<O, S> {
|
||||
}
|
||||
|
||||
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
|
||||
+ // Plazma start - Optimise state lookup more
|
||||
+ final S ret = (S) this.optimisedTable.get(property, value);
|
||||
+ if (ret == null) throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
|
||||
+ return ret;
|
||||
+ /*
|
||||
+ // Plazma end - Optimise state lookup more
|
||||
Comparable<?> comparable = this.values.get(property);
|
||||
if (comparable != null && !comparable.equals(value)) {
|
||||
S object = this.neighbours.get(property, value);
|
||||
@@ -126,10 +132,11 @@ public abstract class StateHolder<O, S> {
|
||||
} else {
|
||||
return (S)this;
|
||||
}
|
||||
+ */ // Plazma - Optimise state lookup more
|
||||
}
|
||||
|
||||
public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
|
||||
- if (this.neighbours != null) {
|
||||
+ if (this.optimisedTable.index_table() != null) { // Plazma - optimise state lookup
|
||||
throw new IllegalStateException();
|
||||
} else {
|
||||
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
|
||||
@@ -144,7 +151,7 @@ public abstract class StateHolder<O, S> {
|
||||
}
|
||||
}
|
||||
|
||||
- this.neighbours = (Table<Property<?>, Comparable<?>, S>)(table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.neighbours, this.values); // Paper - optimise state lookup
|
||||
+ this.optimisedTable.loadInTable((Table) (table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Plazma - Optimize state lookup more
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user