Compare commits
166 Commits
dev-1.20.2
...
build/1.21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a7a88a7bb | ||
|
|
8860cedaf7 | ||
|
|
527b6c7eaf | ||
|
|
e37f05bd87 | ||
|
|
dfb64f50db | ||
|
|
69d4f4bf86 | ||
|
|
64802e7e50 | ||
|
|
a313424212 | ||
|
|
fa3c15b4f3 | ||
|
|
393e079743 | ||
|
|
90d412bbf3 | ||
|
|
98cf5b2d13 | ||
|
|
32243963f5 | ||
|
|
72183c64b9 | ||
|
|
f7998d1955 | ||
|
|
58ddbf4dd6 | ||
|
|
3484117415 | ||
|
|
bff96101bb | ||
|
|
6b54d11f9c | ||
|
|
08a067e974 | ||
|
|
46433f7303 | ||
|
|
72415ee5f2 | ||
|
|
6d7683503c | ||
|
|
6a7a817c0d | ||
|
|
c531844986 | ||
|
|
e721df9890 | ||
|
|
44f2749fe5 | ||
|
|
451d2cc363 | ||
|
|
da6e51f141 | ||
|
|
acb774fbb8 | ||
|
|
ad01d8a450 | ||
|
|
45fe520135 | ||
|
|
2c85fd3304 | ||
|
|
443f09d9e7 | ||
|
|
1d63c3808d | ||
|
|
cbeb17c8e8 | ||
|
|
5557065f36 | ||
|
|
4f2deab03f | ||
|
|
b099cccffb | ||
|
|
c2f67d1f59 | ||
|
|
fd98985104 | ||
|
|
75f88071bc | ||
|
|
e6586daeaa | ||
|
|
305ff4d587 | ||
|
|
5a966df572 | ||
|
|
0d05ccbffc | ||
|
|
6d70d2180f | ||
|
|
15a9cac376 | ||
|
|
c3681a26f5 | ||
|
|
33812e0bc8 | ||
|
|
7ef7531cd3 | ||
|
|
d75427a54e | ||
|
|
9dbff3634b | ||
|
|
64df11da56 | ||
|
|
892269673e | ||
|
|
e5158825bf | ||
|
|
09d30a5d9f | ||
|
|
718927ee70 | ||
|
|
63e37b3633 | ||
|
|
6e591f2d3f | ||
|
|
34fef470e5 | ||
|
|
069250da59 | ||
|
|
4a3d274bda | ||
|
|
930ef33a61 | ||
|
|
ace7a1abe9 | ||
|
|
10ddca5626 | ||
|
|
da7a4324cd | ||
|
|
7c8614f897 | ||
|
|
151f97c9c7 | ||
|
|
225708db0a | ||
|
|
6bb6091980 | ||
|
|
f0c635282d | ||
|
|
14981765c5 | ||
|
|
386d064269 | ||
|
|
6123e40664 | ||
|
|
b5e0e31e3e | ||
|
|
0a8bd76ac3 | ||
|
|
e88cac21e4 | ||
|
|
040724b445 | ||
|
|
531a3bbe3e | ||
|
|
dd781d2610 | ||
|
|
4810a20e50 | ||
|
|
fac51e8b64 | ||
|
|
1cd33a9a1d | ||
|
|
b4737f1a07 | ||
|
|
ab38e33809 | ||
|
|
71243ee5e6 | ||
|
|
90e0b1b857 | ||
|
|
71e7a6f43f | ||
|
|
c655047139 | ||
|
|
ce17ed2020 | ||
|
|
e765830ef2 | ||
|
|
a21f3bab8a | ||
|
|
491c491ba6 | ||
|
|
4815251655 | ||
|
|
4fc2eec8b7 | ||
|
|
39a32b7ea3 | ||
|
|
5b5d1c1281 | ||
|
|
aede6b2591 | ||
|
|
d526550c66 | ||
|
|
8e50bc4b0c | ||
|
|
e25871e11c | ||
|
|
75f1875e4b | ||
|
|
f495171031 | ||
|
|
9b1303d849 | ||
|
|
cee005f2b9 | ||
|
|
6b4bc276a0 | ||
|
|
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 |
39
.editorconfig
Normal file
39
.editorconfig
Normal file
@@ -0,0 +1,39 @@
|
||||
[*]
|
||||
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
|
||||
max_line_length = 120
|
||||
ij_visual_guides = 80
|
||||
|
||||
[*.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
|
||||
|
||||
[*-Server/src/main/resources/data/**/*.json]
|
||||
indent_size = 2
|
||||
|
||||
[paper-api-generator/generated/**/*.java]
|
||||
ij_java_imports_layout = $*,|,*
|
||||
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
* text=auto eol=lf
|
||||
|
||||
*.sh text eol=lf
|
||||
gradlew text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
*.jar binary
|
||||
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 |
118
.github/workflows/build.yml
vendored
118
.github/workflows/build.yml
vendored
@@ -1,118 +0,0 @@
|
||||
name: Build Plazma
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
ORG_NAME: PlazmaMC
|
||||
MC_VERSION: 1.20.2
|
||||
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
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
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/Stable)
|
||||
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
|
||||
|
||||
- name: Release Artifacts (Latest/Development)
|
||||
if: startsWith(github.ref_name, 'dev/')
|
||||
uses: marvinpinto/action-automatic-releases@latest
|
||||
with:
|
||||
title: "Development build for ${{ env.MC_VERSION }}"
|
||||
automatic_release_tag: dev-${{ env.MC_VERSION }}
|
||||
repo_token: "${{ secrets.GH_PAT }}"
|
||||
files: build/libs/*.jar
|
||||
prerelease: true
|
||||
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
|
||||
147
.github/workflows/release.yml
vendored
Normal file
147
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
name: Release Plazma (1.21.3)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/*", "dev/*", "feat/**/*" ]
|
||||
paths:
|
||||
- "patches/server/**.patch"
|
||||
- "patches/api/**.patch"
|
||||
- "gradle.properties"
|
||||
- "release.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
ORG_NAME: PlazmaMC
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release Plazma
|
||||
strategy:
|
||||
matrix:
|
||||
base_jdk: [21]
|
||||
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 "VERSION=${BRANCH##*/}" >> $GITHUB_ENV
|
||||
|
||||
- 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
|
||||
ref: ${{ env.VERSION }}
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
path: javadoc
|
||||
|
||||
- name: Checkout javadocs
|
||||
uses: actions/checkout@v4
|
||||
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
|
||||
with:
|
||||
repository: PlazmaMC/Javadocs
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
path: jdmain
|
||||
|
||||
- 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: Get Release Number
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
run: echo "BUILD_NUMBER=$(git ls-remote --tags origin | grep "build/${{ env.VERSION }}" | wc -l)" >> $GITHUB_ENV
|
||||
|
||||
- name: Apply Patches
|
||||
run: ./gradlew applyPatches --stacktrace
|
||||
|
||||
# TODO: fix tests
|
||||
# - 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
|
||||
SUBMODULE_ADD=true
|
||||
mkdir javadoc && cd javadoc
|
||||
git init && git branch -m ${{ env.VERSION }}
|
||||
git remote add origin https://github.com/PlazmaMC/Javadocs
|
||||
fi
|
||||
|
||||
cp -rf Plazma-API/build/docs/javadoc/* javadoc/
|
||||
cd javadoc
|
||||
git add . && git commit -m "Update Javadocs"
|
||||
git push -f origin ${{ env.VERSION }}
|
||||
|
||||
cd ../jdmain
|
||||
if [ $SUBMODULE_ADD = true ]; then
|
||||
git submodule add -b ${{ env.VERSION }} https://github.com/PlazmaMC/Javadocs ${{ env.VERSION }}
|
||||
fi
|
||||
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: Release Artifacts
|
||||
if: startsWith(github.ref_name, 'ver/')
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
name: "Build #${{ env.BUILD_NUMBER }} for ${{ env.VERSION }}"
|
||||
tag_name: "build/${{ env.VERSION }}/${{ env.BUILD_NUMBER }}"
|
||||
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.BUILD_NUMBER }} for ${{ env.VERSION }}"
|
||||
tag_name: "build/${{ github.ref_name }}/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.VERSION }}"
|
||||
tag_name: build/${{ env.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 = 6a6706d3b4f934845a44ecd7533bf53966e4857c
|
||||
pufferfishCommit = 2c3f3fd4e1df97dc7ff8d770061138144847850e
|
||||
31
README.md
31
README.md
@@ -4,28 +4,21 @@
|
||||
|
||||
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
|
||||
|
||||
[](https://discord.gg/MmfC52K8A8)
|
||||
[](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
|
||||
[](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
|
||||
[](https://plazmamc.org/discord)
|
||||
[](LICENSE.md)
|
||||
[](https://plazmamc.org/downloads)
|
||||
|
||||
[](LICENSE)
|
||||
[](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
|
||||
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
||||
[](https://github.com/PPlazmaMC/Plazma/network/members)
|
||||
[](https://github.com/PlazmaMC/Plazma/watchers)
|
||||
[](https://plazmamc.org/downloads)
|
||||
[](https://github.com/PlazmaMC/Plazma/stargazers)
|
||||
[](https://github.com/PlazmaMC/Plazma/forks)
|
||||
[](https://github.com/PlazmaMC/Plazma/watchers)
|
||||
|
||||
### [⬇️ Downloads](https://plazmamc.org/downloads)
|
||||
|
||||
</div>
|
||||
|
||||
[main]: https://github.com/PlazmaMC/Plazma
|
||||
|
||||
### This is the branch for Plazma 1.20.2. If you want to know more about Plazma, please check the [main branch][main].
|
||||
이곳은 플라즈마의 1.20.2용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 [main 브랜치][main]를 확인해주세요.
|
||||
|
||||
## ⬇️ Downloads
|
||||
### If you don't know about Mojmap or Bundler, download **Reobf Paperclip**
|
||||
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
|
||||
|
||||
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|
||||
| :---: | :---: | :---: | :---: |
|
||||
| [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-paperclip-1.20.1-R0.1-SNAPSHOT-mojmap.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-reobf.jar) | [Download](https://github.com/PlazmaMC/Plazma/releases/download/latest-1.20.1/plazma-bundler-1.20.1-R0.1-SNAPSHOT-mojmap.jar) |
|
||||
> [!IMPORTANT]
|
||||
This is the branch for Plazma 1.21.2/3. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
|
||||
이곳은 플라즈마의 1.21.2/3용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 분기][main]** 를 확인해주세요.
|
||||
|
||||
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
|
||||
#
|
||||
176
build.gradle.kts
176
build.gradle.kts
@@ -1,107 +1,173 @@
|
||||
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.7-SNAPSHOT"
|
||||
`kotlin-dsl`
|
||||
`always-up-to-date`
|
||||
alias(libs.plugins.shadow) apply false
|
||||
alias(libs.plugins.paperweight)
|
||||
}
|
||||
|
||||
val jdkVersion = property("jdkVersion").toString().toInt()
|
||||
val providerRepo = property("providerRepo").toString()
|
||||
val brandName = property("brandName").toString()
|
||||
|
||||
kotlin.jvmToolchain(jdkVersion)
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||
content {
|
||||
onlyForConfigurations(PAPERCLIP_CONFIG)
|
||||
}
|
||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||
content { onlyForConfigurations(configurations.paperclip.name) }
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.10: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)
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(jdkVersion))
|
||||
|
||||
publishing.repositories.maven("https://maven.pkg.github.com/$providerRepo") {
|
||||
name = "githubPackage"
|
||||
url = uri("https://maven.pkg.github.com/$providerRepo")
|
||||
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_USERNAME")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java")
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(17)
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = jdkVersion
|
||||
options.compilerArgs.addAll(listOf(
|
||||
"--add-modules=jdk.incubator.vector",
|
||||
"-Xmaxwarns", "1"
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
|
||||
withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
|
||||
withType<Test> {
|
||||
minHeapSize = "2g"
|
||||
maxHeapSize = "2g"
|
||||
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(":${brandName.lowercase()}-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 {
|
||||
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
||||
apiOutputDir.set(layout.projectDirectory.dir("Plazma-API"))
|
||||
apiPatchDir.set(projectDir.resolve("patches/api"))
|
||||
apiOutputDir.set(projectDir.resolve("$brandName-API"))
|
||||
|
||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||
serverOutputDir.set(layout.projectDirectory.dir("Plazma-Server"))
|
||||
serverPatchDir.set(projectDir.resolve("patches/server"))
|
||||
serverOutputDir.set(projectDir.resolve("$brandName-Server"))
|
||||
}
|
||||
|
||||
patchTasks.register("generatedApi") {
|
||||
isBareDirectory = true
|
||||
upstreamDirPath = "paper-api-generator/generated"
|
||||
patchDir = projectDir.resolve("patches/generated-api")
|
||||
outputDir = projectDir.resolve("paper-api-generator/generated")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val upstreamTask = tasks.register("updateUpstream") {
|
||||
val tempDir = layout.cacheDir("updateUpstream");
|
||||
val file = "gradle.properties";
|
||||
val paperRepoVal = property("paperRepo").toString()
|
||||
val paperBranch = property("paperBranch").toString()
|
||||
val purpurRepoVal = property("purpurRepo").toString()
|
||||
val purpurBranch = property("purpurBranch").toString()
|
||||
val pufferfishRepoVal = property("pufferfishRepo").toString()
|
||||
val pufferfishBranch = property("pufferfishBranch").toString()
|
||||
val isUsePufferfish = property("usePufferfish").toString().toBoolean()
|
||||
|
||||
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;
|
||||
alwaysUpToDate {
|
||||
|
||||
copy {
|
||||
from(file)
|
||||
into(tempDir)
|
||||
filter { line: String ->
|
||||
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
|
||||
paperRepo.set(paperRepoVal)
|
||||
paperRef.set(paperBranch)
|
||||
paperCommitName.set("paperCommit")
|
||||
|
||||
purpurRepo.set(purpurRepoVal)
|
||||
purpurRef.set(purpurBranch)
|
||||
purpurCommitName.set("purpurCommit")
|
||||
|
||||
pufferfishRepo.set(pufferfishRepoVal)
|
||||
pufferfishRef.set(pufferfishBranch)
|
||||
usePufferfish.set(isUsePufferfish)
|
||||
|
||||
}
|
||||
|
||||
tasks {
|
||||
applyPatches {
|
||||
dependsOn("applyGeneratedApiPatches")
|
||||
}
|
||||
|
||||
rebuildPatches {
|
||||
dependsOn("rebuildGeneratedApiPatches")
|
||||
}
|
||||
|
||||
generateDevelopmentBundle {
|
||||
apiCoordinates.set("${project.group}:${brandName.lowercase()}-api")
|
||||
libraryRepositories.addAll(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
"https://maven.pkg.github.com/$providerRepo",
|
||||
"https://papermc.io/repo/repository/maven-public/"
|
||||
)
|
||||
}
|
||||
|
||||
clean {
|
||||
doLast {
|
||||
listOf(
|
||||
".gradle/caches",
|
||||
"$brandName-API",
|
||||
"$brandName-Server",
|
||||
"paper-api-generator",
|
||||
"run",
|
||||
|
||||
// remove dev environment files
|
||||
"0001-fixup.patch",
|
||||
"compare.txt"
|
||||
).forEach {
|
||||
projectDir.resolve(it).deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from(tempDir.file("gradle.properties"))
|
||||
into(project.file(file).parent)
|
||||
}
|
||||
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.6.2-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,79 @@
|
||||
package org.plazmamc.alwaysuptodate
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
import org.plazmamc.alwaysuptodate.tasks.*
|
||||
import org.plazmamc.alwaysuptodate.utils.CheckGitTask
|
||||
import org.plazmamc.alwaysuptodate.utils.configureTask
|
||||
import org.plazmamc.alwaysuptodate.utils.flatten
|
||||
import org.plazmamc.alwaysuptodate.utils.registerTask
|
||||
|
||||
class AlwaysUpToDate : Plugin<Project> {
|
||||
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
override fun apply(target: Project): Unit = with(target) {
|
||||
|
||||
Git.checkForGit()
|
||||
|
||||
val extension = extensions.create("alwaysUpToDate", AlwaysUpToDateExtension::class.java)
|
||||
|
||||
val git = configureTask<CheckGitTask>("checkGitStatus", "Verify that Git is available")
|
||||
|
||||
fun generateTasks(
|
||||
upstream: String,
|
||||
provider: AlwaysUpToDateExtension.() -> Pair<Pair<Property<String>, Property<String>>, Property<String>>
|
||||
): Triple<TaskProvider<CheckUpstreamCommit>, TaskProvider<CreateCompareComment>, TaskProvider<CreateCompareComment>> {
|
||||
val i = registerTask<CheckUpstreamCommit>("check$upstream", "Check if the $upstream commit is up to date") {
|
||||
dependsOn(git)
|
||||
val (repo, ref, commitProperty) = extension.provider().flatten()
|
||||
this.repo.set(repo)
|
||||
this.ref.set(ref)
|
||||
this.commitPropertyName.set(commitProperty)
|
||||
}
|
||||
|
||||
val j = registerTask<CreateCompareComment>("compare$upstream", "Create a comment comparing the $upstream commit") {
|
||||
dependsOn(git)
|
||||
val (repo, ref, commitProperty) = extension.provider().flatten()
|
||||
this.repo.set(repo)
|
||||
this.ref.set(ref)
|
||||
this.commitPropertyName.set(commitProperty)
|
||||
this.clear.set(false)
|
||||
}
|
||||
|
||||
val k = registerTask<CreateCompareComment>(
|
||||
"cleanCompare$upstream",
|
||||
"Create a comment comparing the $upstream commit"
|
||||
) {
|
||||
dependsOn(git)
|
||||
val (repo, ref, commitProperty) = extension.provider().flatten()
|
||||
this.repo.set(repo)
|
||||
this.ref.set(ref)
|
||||
this.commitPropertyName.set(commitProperty)
|
||||
this.clear.set(true)
|
||||
}
|
||||
|
||||
return (i to j to k).flatten()
|
||||
}
|
||||
|
||||
val (checkPaper, comparePaper, cleanComparePaper) = generateTasks("Paper") { paperRepo to paperRef to paperCommitName }
|
||||
val (checkPurpur, comparePurpur, cleanComparePurpur) = generateTasks("Purpur") { purpurRepo to purpurRef to purpurCommitName }
|
||||
|
||||
registerTask<SimpleUpstreamUpdateTask>("updateUpstream", "Update the upstream commit") {
|
||||
dependsOn(git)
|
||||
repo.convention(extension.paperRepo)
|
||||
ref.convention(extension.paperRef)
|
||||
workDir.set(layout.projectDirectory)
|
||||
regex.convention("paperCommit = ")
|
||||
}
|
||||
|
||||
registerTask<PurpurUpdateTask>("updateImplementation", "Update the implementation") {
|
||||
dependsOn(git)
|
||||
workDir.set(layout.projectDirectory)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,20 @@
|
||||
package org.plazmamc.alwaysuptodate
|
||||
|
||||
import org.gradle.api.provider.Property
|
||||
|
||||
interface AlwaysUpToDateExtension {
|
||||
|
||||
val paperRepo: Property<String>
|
||||
val paperRef: Property<String>
|
||||
|
||||
val purpurRepo: Property<String>
|
||||
val purpurRef: Property<String>
|
||||
|
||||
val pufferfishRepo: Property<String>
|
||||
val pufferfishRef: Property<String>
|
||||
val usePufferfish: Property<Boolean>
|
||||
|
||||
val paperCommitName: Property<String>
|
||||
val purpurCommitName: Property<String>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
|
||||
import org.plazmamc.alwaysuptodate.utils.extension
|
||||
import org.plazmamc.alwaysuptodate.utils.flatten
|
||||
import org.plazmamc.alwaysuptodate.utils.git
|
||||
import org.plazmamc.alwaysuptodate.utils.property
|
||||
|
||||
abstract class CheckUpstreamCommit : Task() {
|
||||
|
||||
@get:Input
|
||||
abstract val repo: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val ref: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val commitPropertyName: Property<String>
|
||||
|
||||
override fun init(): Unit = with(project) {
|
||||
outputs.upToDateWhen { checkCommitFor { repo to ref to commitPropertyName } }
|
||||
|
||||
doLast {
|
||||
println(checkCommitFor { repo to ref to commitPropertyName })
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun Project.getLatest(repository: String, branch: String) =
|
||||
git("ls-remote", repository).readText()?.lines()
|
||||
?.first("[a-z0-9]{40}\trefs/heads/$branch".toRegex()::matches)?.split("\t")?.first()
|
||||
?: throw AlwaysUpToDateException("Failed to get latest commit of $repository")
|
||||
|
||||
fun Project.checkCommitFor(block: AlwaysUpToDateExtension.() -> Pair<Pair<Property<String>, Property<String>>, Property<String>>): Boolean =
|
||||
extension.block().flatten().let { getLatest(extension { it.first }, extension { it.second }) == property { it.third } }
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.fromJson
|
||||
import io.papermc.paperweight.util.gson
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.plazmamc.alwaysuptodate.utils.property
|
||||
import paper.libs.com.google.gson.JsonObject
|
||||
import java.net.URI
|
||||
|
||||
abstract class CreateCompareComment : Task() {
|
||||
|
||||
@get:Input
|
||||
abstract val clear: Property<Boolean>
|
||||
|
||||
@get:Input
|
||||
abstract val repo: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val ref: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val commitPropertyName: Property<String>
|
||||
|
||||
@TaskAction
|
||||
fun create() = with(project) {
|
||||
val builder = StringBuilder()
|
||||
val rawRepo = URI.create(repo.get()).path.substring(1)
|
||||
|
||||
if (clear.get() || !file("compare.txt").exists())
|
||||
builder.append("\n\nUpstream has released updates that appear to apply and compile correctly.")
|
||||
else
|
||||
builder.append(file("compare.txt").readText())
|
||||
|
||||
builder.append("\n\n[${rawRepo.split("/").last()} Changes]\n")
|
||||
|
||||
gson.fromJson<JsonObject>(
|
||||
URI.create("https://api.github.com/repos/$rawRepo/compare/${property { commitPropertyName }}...${ref.get()}").toURL().readText()
|
||||
)["commits"].asJsonArray.forEach { obj ->
|
||||
obj.asJsonObject.let {
|
||||
builder.append("$rawRepo@${it["sha"].asString.subSequence(0, 7)}: ${it["commit"].asJsonObject["message"].asString.split("\n")[0]}\n")
|
||||
}
|
||||
}
|
||||
file("compare.txt").writeText(builder.toString())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputDirectory
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.plazmamc.alwaysuptodate.utils.addCommit
|
||||
|
||||
abstract class GenerateMergedAPIPatch : Task() {
|
||||
|
||||
@get:InputDirectory
|
||||
abstract val inputDir: DirectoryProperty
|
||||
|
||||
@get:Internal
|
||||
abstract val workDir: DirectoryProperty
|
||||
|
||||
@get:Input
|
||||
abstract val commitTitle: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val author: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val license: Property<String>
|
||||
|
||||
@TaskAction
|
||||
fun generate() = with(workDir.path) {
|
||||
val dotGit = resolve(".git").toFile().also(java.io.File::deleteRecursively)
|
||||
|
||||
inputDir.path.toFile().copyRecursively(dotGit, overwrite = true)
|
||||
Git(this).addCommit("${commitTitle.get()}\n\n${license.get()}", "--author=${author.get()}")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.plazmamc.alwaysuptodate.utils.addCommit
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
|
||||
abstract class GenerateMergedServerPatch : Task() {
|
||||
|
||||
@get:Internal
|
||||
abstract val workDir: DirectoryProperty
|
||||
|
||||
@get:Input
|
||||
abstract val commitTitle: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val author: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val license: Property<String>
|
||||
|
||||
@TaskAction
|
||||
fun generate() = with(workDir.path) {
|
||||
val dotGit = resolve(".git").toFile().also(java.io.File::deleteRecursively)
|
||||
|
||||
copySource(this)
|
||||
|
||||
val paper = resolve("../.gradle/caches/paperweight/upstreams/paper/Paper-Server")
|
||||
copySource(paper)
|
||||
|
||||
Git(paper).addCommit("Vanilla Sources", "--author=Automated <auto@mated.null>")
|
||||
|
||||
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
|
||||
Git(this).addCommit("${commitTitle.get()}\n\n${license.get()}", "--author=${author.get()}")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal 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("com").toFile().copyRecursively(target.resolve("java/com").toFile(), overwrite = true)
|
||||
resolve("data").toFile().copyRecursively(target.resolve("resources/data").toFile(), overwrite = true)
|
||||
resolve("assets").toFile().copyRecursively(target.resolve("resources/assets").toFile(), overwrite = true)
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.patcher.tasks.CheckoutRepo
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.cache
|
||||
import io.papermc.paperweight.util.path
|
||||
import io.papermc.paperweight.util.set
|
||||
import org.gradle.api.file.Directory
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.OutputDirectory
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
import org.plazmamc.alwaysuptodate.utils.*
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
import java.util.*
|
||||
import kotlin.io.path.ExperimentalPathApi
|
||||
import kotlin.io.path.name
|
||||
import kotlin.io.path.walk
|
||||
|
||||
@Deprecated("It will soon be changed to be available for other upstreams.")
|
||||
abstract class PurpurUpdateTask : Task() {
|
||||
|
||||
private val pufferfishHeader = """
|
||||
Pufferfish
|
||||
Copyright (C) ${Calendar.getInstance().get(Calendar.YEAR)} 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 pufferfishAuthor = "Kevin Raneri <kevin.raneri@gmail.com>"
|
||||
private val purpurHeader = """
|
||||
PurpurMC
|
||||
Copyright (C) ${Calendar.getInstance().get(Calendar.YEAR)} 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()
|
||||
private val purpurAuthor = "granny <contact@granny.dev>"
|
||||
|
||||
@get:Internal
|
||||
abstract val workDir: DirectoryProperty
|
||||
|
||||
@get:OutputDirectory
|
||||
abstract val purpurDir: DirectoryProperty
|
||||
|
||||
@get:OutputDirectory
|
||||
abstract val pufferfishDir: DirectoryProperty
|
||||
|
||||
override fun init(): Unit = with(project) {
|
||||
val wd = layout.cache.resolve("alwaysUpToDate/update/purpur").also { it.toFile().deleteRecursively() }
|
||||
workDir.set(wd)
|
||||
|
||||
val compare =
|
||||
configureTask<CreateCompareComment>("createPurpurCompareComment", "Create Purpur Compare Comment") {
|
||||
clear.convention(true)
|
||||
repo.convention(extension.purpurRepo)
|
||||
ref.convention(extension.purpurRef)
|
||||
commitPropertyName.convention(extension.purpurCommitName)
|
||||
}
|
||||
|
||||
val paper = dependsOn<SimpleUpstreamUpdateTask>("updatePaper", "Update Paper") {
|
||||
outputs.upToDateWhen { checkCommitFor { repo to ref to paperCommitName } }
|
||||
dependsOn(compare)
|
||||
repo.convention(extension.paperRepo)
|
||||
ref.convention(extension.paperRef)
|
||||
regex.convention("paperCommit = ")
|
||||
workDir.set(layout.projectDirectory)
|
||||
}
|
||||
|
||||
fun checkout(
|
||||
name: String, repo: Provider<String>, ref: Provider<String>, regex: String, block: CheckoutRepo.() -> Unit
|
||||
): Pair<TaskProvider<CheckoutRepo>, Directory> {
|
||||
val updatePaper = configureTask<SimpleUpstreamUpdateTask>("update${name}Paper", "Update $name's Paper") {
|
||||
this.repo.convention(extension.paperRepo)
|
||||
this.ref.convention(extension.paperRef)
|
||||
this.regex.convention(regex)
|
||||
this.workDir.set(wd.resolve(name))
|
||||
}
|
||||
|
||||
val checkout = dependsOn<CheckoutRepo>("checkout$name", "Checkout $name") {
|
||||
this.dependsOn(paper)
|
||||
this.repoName.convention(name)
|
||||
this.url.convention(repo)
|
||||
this.ref.convention(ref)
|
||||
this.workDir.set(wd)
|
||||
|
||||
this.block()
|
||||
// this.finalizedBy(updatePaper)
|
||||
}
|
||||
|
||||
return checkout to checkout.flatMap { it.outputDir }.get()
|
||||
}
|
||||
|
||||
val (checkoutPufferfish, pufferfish) =
|
||||
checkout("Pufferfish", extension.pufferfishRepo, extension.pufferfishRef, "paperRef=") {
|
||||
onlyIf { extension { usePufferfish } }
|
||||
}
|
||||
val (checkoutPurpur, purpur) =
|
||||
checkout("Purpur", extension.purpurRepo, extension.purpurRef, "paperCommit = ") {}
|
||||
|
||||
pufferfishDir.set(pufferfish)
|
||||
purpurDir.set(purpur)
|
||||
|
||||
val preparePurpur = configureTask("preparePurpur", "Prepare Purpur Sources") {
|
||||
mustRunAfter(paper)
|
||||
dependsOn(checkoutPurpur)
|
||||
doLast { Gradle(purpur.path)("applyPatches").executeOut() }
|
||||
}
|
||||
val preparePufferfish = configureTask("preparePufferfish", "Prepare Pufferfish Sources") {
|
||||
onlyIf { extension { usePufferfish } }
|
||||
mustRunAfter(paper)
|
||||
dependsOn(checkoutPurpur, checkoutPufferfish)
|
||||
doLast {
|
||||
val base = pufferfish.path.resolve("patches").also { it.toFile().deleteRecursively() }
|
||||
val source = purpur.path.resolve("patches")
|
||||
source.resolve("server").copyPatch(base.resolve("server"), "Pufferfish-Server-Changes")
|
||||
source.resolve("api").copyPatch(base.resolve("api"), "Pufferfish-API-Changes")
|
||||
Gradle(pufferfish.path)("applyPatches").executeOut()
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn(preparePurpur, preparePufferfish)
|
||||
|
||||
val serverPatch =
|
||||
configureTask<GenerateMergedServerPatch>("generateMergedServerPatches", "Generate Merged Server Patch") {
|
||||
dependsOn(preparePurpur)
|
||||
if (!extension { usePufferfish }) {
|
||||
workDir.convention(purpur.dir("Purpur-Server"))
|
||||
commitTitle.convention("Purpur Server Changes")
|
||||
license.convention(purpurHeader)
|
||||
author.convention(purpurAuthor)
|
||||
return@configureTask
|
||||
}
|
||||
|
||||
dependsOn(preparePufferfish)
|
||||
workDir.convention(pufferfish.dir("pufferfish-server"))
|
||||
commitTitle.convention("Pufferfish Server Changes")
|
||||
license.convention(pufferfishHeader)
|
||||
author.convention(pufferfishAuthor)
|
||||
|
||||
doLast {
|
||||
val dotGit = pufferfish.dir("pufferfish-server/.git").path.toFile()
|
||||
|
||||
purpur.path.resolve("Purpur-Server").let {
|
||||
val purpurDotGit = it.resolve(".git").toFile().also(File::deleteRecursively)
|
||||
|
||||
copySource(it)
|
||||
dotGit.copyRecursively(purpurDotGit, overwrite = true)
|
||||
Git(it).addCommit("Purpur Server Changes\n\n$purpurHeader", "--author=$purpurAuthor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val pufferfishAPIChanges = configureTask<GenerateMergedAPIPatch>(
|
||||
"generateMergedPufferfishAPIPatch",
|
||||
"Generate Merged Pufferfish API Patch"
|
||||
) {
|
||||
dependsOn(preparePufferfish)
|
||||
inputDir.convention(pufferfish.dir(".gradle/caches/paperweight/upstreams/paper/Paper-API/.git"))
|
||||
workDir.convention(pufferfish.dir("pufferfish-api"))
|
||||
commitTitle.convention("Pufferfish API Changes")
|
||||
license.convention(pufferfishHeader)
|
||||
author.convention(pufferfishAuthor)
|
||||
}
|
||||
|
||||
val apiPatch = configureTask<GenerateMergedAPIPatch>(
|
||||
"generateMergedAPIPatches",
|
||||
"Generate Merged API Patches"
|
||||
) {
|
||||
dependsOn(preparePurpur)
|
||||
if (extension { usePufferfish }) dependsOn(pufferfishAPIChanges)
|
||||
|
||||
workDir.convention(purpur.dir("Purpur-API"))
|
||||
commitTitle.convention("Purpur API Changes")
|
||||
license.convention(purpurHeader)
|
||||
author.convention(purpurAuthor)
|
||||
inputDir.convention(
|
||||
if (extension { usePufferfish }) pufferfish.dir("pufferfish-api/.git")
|
||||
else purpur.dir(".gradle/caches/paperweight/upstreams/paper/Paper-API/.git")
|
||||
)
|
||||
}
|
||||
|
||||
dependsOn("buildPatches", "Build Merged Patches") {
|
||||
dependsOn(serverPatch, apiPatch)
|
||||
doLast { Gradle(purpur.path)("rebuildPatches").executeOut() }
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun update() = with(project) {
|
||||
val purpur = purpurDir.path
|
||||
val pufferfish = if (extension { usePufferfish }) pufferfishDir.path else null
|
||||
|
||||
val patches = purpur.resolve("patches")
|
||||
with(layout.projectDirectory.path.resolve("patches")) {
|
||||
patches.resolve("server").copyPatch( resolve("server"),
|
||||
if (pufferfish == null) "" else "Pufferfish-Server-Changes",
|
||||
"Purpur-Server-Changes"
|
||||
)
|
||||
|
||||
patches.resolve("api").copyPatch( resolve("api"),
|
||||
if (pufferfish == null) "" else "Pufferfish-API-Changes",
|
||||
"Purpur-API-Changes"
|
||||
)
|
||||
}
|
||||
|
||||
file("gradle.properties").let {
|
||||
it.writeText(
|
||||
it.readText().replace("purpurCommit = .*".toRegex(), "purpurCommit = ${Git(purpur).revParse()}")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalPathApi::class)
|
||||
private fun Path.copyPatch(to: Path, vararg name: String) = walk().sorted()
|
||||
.filter { entry -> name.filter { it != "" }.any { entry.name.endsWith("$it.patch") } }.map(Path::toFile)
|
||||
.forEachIndexed { count, patch ->
|
||||
patch.copyTo(
|
||||
to.resolve("${count + 1}".padStart(4, '0') + "-" + name.first { patch.name.substring(5) == "$it.patch" } + ".patch").toFile(),
|
||||
overwrite = true
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputDirectory
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
|
||||
import org.plazmamc.alwaysuptodate.utils.dependsOn
|
||||
import org.plazmamc.alwaysuptodate.utils.extension
|
||||
|
||||
abstract class SimpleUpstreamUpdateTask : Task() {
|
||||
|
||||
@get:Input
|
||||
abstract val repo: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val ref: Property<String>
|
||||
|
||||
@get:InputDirectory
|
||||
abstract val workDir: DirectoryProperty
|
||||
|
||||
@get:Input
|
||||
abstract val regex: Property<String>
|
||||
|
||||
override fun init(): Unit = with(project) {
|
||||
dependsOn<CreateCompareComment>("createCompareComment", "Create Paper Compare Comment") {
|
||||
onlyIf { !this@SimpleUpstreamUpdateTask.state.upToDate }
|
||||
clear.convention(false)
|
||||
repo.convention(extension.paperRepo)
|
||||
ref.convention(extension.paperRef)
|
||||
commitPropertyName.convention(extension.paperCommitName)
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun update() = (Git(workDir.path)("ls-remote", repo.get()).readText()?.lines()
|
||||
?.filterNot("[a-z0-9]{40}\trefs/heads/${ref.get()}".toRegex()::matches)?.first()?.split("\t")?.first()
|
||||
?: throw AlwaysUpToDateException("Failed to get latest commit")).let { commit ->
|
||||
workDir.file("gradle.properties").path.toFile().let {
|
||||
it.writeText(it.readText().replace("${regex.get()}.*".toRegex(), "${regex.get()}$commit"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.plazmamc.alwaysuptodate.tasks
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
|
||||
abstract class Task : DefaultTask() {
|
||||
|
||||
protected open fun init() {}
|
||||
|
||||
init {
|
||||
this.init()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.plazmamc.alwaysuptodate.tasks.Task
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.exists
|
||||
|
||||
val Git.path: Path
|
||||
get() = Git::class.java.getDeclaredField("repo").apply { isAccessible = true }.get(this) as Path
|
||||
|
||||
abstract class CheckGitTask : Task() {
|
||||
|
||||
@TaskAction
|
||||
fun checkGit() = Git.checkForGit()
|
||||
|
||||
}
|
||||
|
||||
fun Git.revParse(): String = this("rev-parse", "HEAD").captureOut(true).out.trim()
|
||||
|
||||
fun Git.addCommit(vararg args: String) {
|
||||
this("add", ".").executeSilently()
|
||||
this("commit", "-m", *args).executeSilently()
|
||||
this.wait()
|
||||
}
|
||||
|
||||
fun Git.wait() {
|
||||
val lockFile = path.resolve(".git/gc.pid")
|
||||
while (lockFile.exists()) {
|
||||
println("detected lockfile, waiting for it to be removed")
|
||||
Thread.sleep(1000)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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,116 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
import io.papermc.paperweight.util.Git
|
||||
import io.papermc.paperweight.util.configureTask
|
||||
import io.papermc.paperweight.util.path
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
|
||||
|
||||
private var extensionAccessor: AlwaysUpToDateExtension? = null
|
||||
set(value) {
|
||||
if (field != null) throw IllegalAccessException("ExtensionAccessor already initialized")
|
||||
field = value
|
||||
}
|
||||
|
||||
val Project.extension: AlwaysUpToDateExtension
|
||||
get() {
|
||||
if (extensionAccessor == null) extensionAccessor =
|
||||
project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
|
||||
return extensionAccessor!!
|
||||
}
|
||||
|
||||
val Project.git: Git get() = Git(layout.projectDirectory.path)
|
||||
|
||||
fun <T> Project.extension(block: AlwaysUpToDateExtension.() -> Property<T>): T =
|
||||
extension.block().get()
|
||||
|
||||
fun Project.property(block: AlwaysUpToDateExtension.() -> Property<String>) =
|
||||
this.property(extension(block)) as String
|
||||
|
||||
inline fun <reified T : Task> Task.dependsOn(
|
||||
name: String,
|
||||
description: String,
|
||||
noinline block: T.() -> Unit = {}
|
||||
): TaskProvider<T> =
|
||||
project.configureTask<T>(name, description, block).also { this.dependsOn(it) }
|
||||
|
||||
@JvmName("dependsOnDefaultTask")
|
||||
fun Task.dependsOn(
|
||||
name: String,
|
||||
description: String,
|
||||
block: DefaultTask.() -> Unit = {}
|
||||
): TaskProvider<DefaultTask> =
|
||||
this.dependsOn<DefaultTask>(name, description, block)
|
||||
|
||||
inline fun <reified T : Task> Task.finalizedBy(
|
||||
name: String,
|
||||
description: String,
|
||||
noinline block: T.() -> Unit = {}
|
||||
): TaskProvider<T> =
|
||||
project.configureTask<T>(name, description, block).also { this.finalizedBy(it) }
|
||||
|
||||
@JvmName("finalizedByDefaultTask")
|
||||
fun Task.finalizedBy(
|
||||
name: String,
|
||||
description: String,
|
||||
block: DefaultTask.() -> Unit = {}
|
||||
): TaskProvider<DefaultTask> =
|
||||
this.finalizedBy<DefaultTask>(name, description, block)
|
||||
|
||||
inline fun <reified T : Task> Task.mustRunAfter(
|
||||
name: String,
|
||||
description: String,
|
||||
noinline block: T.() -> Unit = {}
|
||||
): TaskProvider<T> =
|
||||
project.configureTask<T>(name, description, block).also { this.mustRunAfter(it) }
|
||||
|
||||
@JvmName("mustRunAfterDefaultTask")
|
||||
fun Task.mustRunAfter(
|
||||
name: String,
|
||||
description: String,
|
||||
block: DefaultTask.() -> Unit = {}
|
||||
): TaskProvider<DefaultTask> =
|
||||
this.mustRunAfter<DefaultTask>(name, description, block)
|
||||
|
||||
inline fun <reified T : Task> Project.configureTask(
|
||||
name: String,
|
||||
description: String,
|
||||
noinline block: T.() -> Unit = {}
|
||||
): TaskProvider<T> =
|
||||
tasks.configureTask<T>(name) {
|
||||
this.group = "always up to date"
|
||||
this.description = description
|
||||
this.block()
|
||||
}
|
||||
|
||||
@JvmName("configureDefaultTask")
|
||||
fun Project.configureTask(
|
||||
name: String,
|
||||
description: String,
|
||||
block: DefaultTask.() -> Unit = {}
|
||||
): TaskProvider<DefaultTask> =
|
||||
this.configureTask<DefaultTask>(name, description, block)
|
||||
|
||||
inline fun <reified T : Task> Project.registerTask(
|
||||
name: String,
|
||||
description: String,
|
||||
crossinline block: T.() -> Unit = {}
|
||||
): TaskProvider<T> =
|
||||
tasks.register(name, T::class.java) {
|
||||
this.group = "always up to date"
|
||||
this.description = description
|
||||
this.block()
|
||||
}
|
||||
|
||||
@JvmName("registerDefaultTask")
|
||||
fun Project.registerTask(
|
||||
name: String,
|
||||
description: String,
|
||||
block: DefaultTask.() -> Unit = {}
|
||||
): TaskProvider<DefaultTask> =
|
||||
this.registerTask<DefaultTask>(name, description, block)
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.plazmamc.alwaysuptodate.utils
|
||||
|
||||
fun <A, B, C> Pair<Pair<A, B>, C>.flatten() = Triple(first.first, first.second, second)
|
||||
@@ -0,0 +1 @@
|
||||
implementation-class=org.plazmamc.alwaysuptodate.AlwaysUpToDate
|
||||
13
fxapi.sh
13
fxapi.sh
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# FixupAPI
|
||||
|
||||
PS1="$"
|
||||
|
||||
cd Plazma-API
|
||||
|
||||
git add .
|
||||
git commit -m "fixup"
|
||||
git format-patch -1
|
||||
|
||||
cd ../
|
||||
13
fxsrv.sh
13
fxsrv.sh
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# FixupServer
|
||||
|
||||
PS1="$"
|
||||
|
||||
cd Plazma-Server
|
||||
|
||||
git add .
|
||||
git commit -m "fixup"
|
||||
git format-patch -1
|
||||
|
||||
cd ../
|
||||
@@ -1,9 +1,29 @@
|
||||
group = org.plazmamc.plazma
|
||||
version = 1.20.2-R0.1-SNAPSHOT
|
||||
|
||||
paperCommit = 38376f43a0c268e5223746cab13910f55e5ecf41
|
||||
|
||||
org.gradle.daemon = 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
|
||||
|
||||
paper.runMemoryGb = 8
|
||||
paper.runDisableWatchdog = true
|
||||
|
||||
group = org.plazmamc.plazma
|
||||
brandKey = plazmamc:plazma
|
||||
brandName = Plazma
|
||||
providerName = PlazmaMC
|
||||
providerRepo = PlazmaMC/PlazmaBukkit
|
||||
|
||||
version = 1.21.3-R0.1-SNAPSHOT
|
||||
mcVersion = 1.21.3
|
||||
jdkVersion = 21
|
||||
|
||||
paperRepo = https://github.com/PaperMC/Paper
|
||||
paperBranch = master
|
||||
purpurRepo = https://github.com/PurpurMC/Purpur
|
||||
purpurBranch = ver/1.21.3
|
||||
pufferfishRepo = https://github.com/pufferfish-gg/Pufferfish
|
||||
pufferfishBranch = ver/1.21
|
||||
usePufferfish = false
|
||||
|
||||
paperCommit = 6288adb001b71a2f2a0a1866fc406016ada06bb5
|
||||
purpurCommit = 89e388c3a2c40b61e8e34ec03fcf1af735396af2
|
||||
|
||||
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.7.4"
|
||||
paperclip = "3.0.3"
|
||||
decompiler = "1.10.1"
|
||||
remapper = "0.10.3"
|
||||
|
||||
[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.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
24
gradlew
vendored
24
gradlew
vendored
@@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -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" \
|
||||
|
||||
184
gradlew.bat
vendored
184
gradlew.bat
vendored
@@ -1,92 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
65
initDev
Executable file
65
initDev
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
# To initialize your development environment,
|
||||
# run below command in your terminal:
|
||||
# source ./initDev
|
||||
|
||||
export PROJECT_DIR=$(pwd)
|
||||
|
||||
alias api="cd $PROJECT_DIR/*-API"
|
||||
alias srv="cd $PROJECT_DIR/*-Server"
|
||||
|
||||
alias c="clear;"
|
||||
alias ap="./gradlew --no-rebuild applyPatches"
|
||||
alias aap="./gradlew --no-rebuild applyAPIPatches"
|
||||
alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches"
|
||||
alias asp="./gradlew --no-rebuild applyServerPatches"
|
||||
|
||||
alias rp="./gradlew --no-rebuild rebuildPatches"
|
||||
alias rap="./gradlew --no-rebuild rebuildAPIPatches"
|
||||
alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches"
|
||||
alias rsp="./gradlew --no-rebuild rebuildServerPatches"
|
||||
|
||||
alias lg="git log --oneline base..HEAD"
|
||||
alias rc="git rebase --autosquash -i base"
|
||||
alias rcc="git rebase --continue"
|
||||
|
||||
# generate Fixup patches for Server
|
||||
function fs() {
|
||||
cd ./*-Server || exit 1
|
||||
garg="."
|
||||
[[ "$1" == "-x" ]] && garg="--amend"
|
||||
|
||||
git add .
|
||||
git commit "$garg" -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
|
||||
cd ../
|
||||
}
|
||||
|
||||
# generate Fixup patches for API
|
||||
function fa() {
|
||||
cd ./*-API || exit 1
|
||||
garg="."
|
||||
[[ "$1" == "-x" ]] && garg="--amend"
|
||||
|
||||
git add .
|
||||
git commit "$garg" -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
|
||||
cd ../
|
||||
}
|
||||
|
||||
# ReApply Server Patches
|
||||
function rasp() {
|
||||
rm -rf ./*-Server
|
||||
./gradlew applyServerPatches
|
||||
}
|
||||
|
||||
# Commit Updated Upstream
|
||||
function cuu() {
|
||||
# shellcheck disable=SC2059
|
||||
printf "Updated Upstream ($1)$(/bin/cat compare.txt)" | git commit -F -
|
||||
}
|
||||
|
||||
33
libs/api.versions.toml
Normal file
33
libs/api.versions.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
[versions]
|
||||
gson = "2.10.1"
|
||||
joml = "1.10.5"
|
||||
guava = "32.1.2-jre"
|
||||
sentry = "5.4.0"
|
||||
jspecify = "1.0.0"
|
||||
fastutil = "8.5.6"
|
||||
findbugs = "1.3.9"
|
||||
slf4j-api = "2.0.9"
|
||||
brigadier = "1.2.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" }
|
||||
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify" }
|
||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
|
||||
brigadier = { group = "com.mojang", name = "brigadier", version.ref = "brigadier" }
|
||||
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 = [ "jspecify", "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry", "brigadier" ]
|
||||
annotations = [ "annotations", "checkerqual" ]
|
||||
47
libs/common.versions.toml
Normal file
47
libs/common.versions.toml
Normal file
@@ -0,0 +1,47 @@
|
||||
[versions]
|
||||
asm = "9.7.1"
|
||||
log4j = "2.19.0"
|
||||
junit = "1.10.0"
|
||||
mockito = "5.14.1"
|
||||
jupiter = "5.10.0"
|
||||
hamcrest = "2.2"
|
||||
snakeyaml = "2.2"
|
||||
adventure = "4.17.0"
|
||||
commons-lang2 = "2.6"
|
||||
commons-lang3 = "3.12.0"
|
||||
maven-provider = "3.9.6"
|
||||
maven-resolver = "1.9.18"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit" }
|
||||
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", "junit" ]
|
||||
maven = [ "maven-connector", "maven-transport" ]
|
||||
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]
|
||||
56
libs/server.versions.toml
Normal file
56
libs/server.versions.toml
Normal file
@@ -0,0 +1,56 @@
|
||||
[versions]
|
||||
art = "2.0.3"
|
||||
tca = "1.3.0"
|
||||
upnp = "1.0"
|
||||
ansi = "1.0.3"
|
||||
jansi = "3.21.0"
|
||||
rhino = "1.7.14"
|
||||
mysql = "9.1.0"
|
||||
flare = "34637f3f87"
|
||||
sqlite = "3.46.1.3"
|
||||
pioneer = "2.2.0"
|
||||
haproxy = "4.1.97.Final"
|
||||
rewriter = "0.0.3"
|
||||
srgutils = "1.0.9"
|
||||
sparkapi = "0.1-20240720.200737-2"
|
||||
sparknt = "1.10.105-SNAPSHOT"
|
||||
velocity = "3.3.0-SNAPSHOT"
|
||||
disruptor = "3.4.4"
|
||||
simpleyaml = "1.8.4"
|
||||
classgraph = "4.8.47"
|
||||
mapping-io = "0.5.0"
|
||||
configurate = "4.2.0-SNAPSHOT"
|
||||
|
||||
[libraries]
|
||||
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
|
||||
tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" }
|
||||
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" }
|
||||
flare = { group = "com.github.technove", name = "flare", version.ref = "flare" }
|
||||
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" }
|
||||
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
|
||||
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" }
|
||||
|
||||
spark-api = { group = "me.lucko", name = "spark-api", version.ref = "sparkapi" }
|
||||
spark-paper = { group = "me.lucko", name = "spark-paper", version.ref = "sparknt" }
|
||||
|
||||
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
|
||||
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
|
||||
|
||||
rewriter = { group = "io.papermc", name = "reflection-rewriter", version.ref = "rewriter" }
|
||||
rewriter-runtime = { group = "io.papermc", name = "reflection-rewriter-runtime", version.ref = "rewriter" }
|
||||
rewriter-generator = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
|
||||
|
||||
[bundles]
|
||||
runtime = [ "sqlite", "mysql", "disruptor" ]
|
||||
implementation = [ "spark-api", "spark-paper", "jansi", "tca", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime", "srgutils", "art", "rewriter", "rewriter-runtime", "rewriter-generator", "flare" ]
|
||||
test = [ "classgraph", "pioneer" ]
|
||||
14
mkapi.sh
14
mkapi.sh
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# PatchAPI <Patch Name>
|
||||
|
||||
PS1="$"
|
||||
|
||||
cd Plazma-API
|
||||
|
||||
git add .
|
||||
git commit -m $1
|
||||
|
||||
cd ../
|
||||
|
||||
./gradlew rebuildAPIPatches
|
||||
14
mksrv.sh
14
mksrv.sh
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# PatchServer <Patch Name>
|
||||
|
||||
PS1="$"
|
||||
|
||||
cd Plazma-Server
|
||||
|
||||
git add .
|
||||
git commit -m $1
|
||||
|
||||
cd ../
|
||||
|
||||
./gradlew rebuildServerPatches
|
||||
9358
patches/24w44a.patch
Normal file
9358
patches/24w44a.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,523 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Sat, 30 Sep 2023 09:45:48 +0000
|
||||
Subject: [PATCH] Pufferfish API Changes
|
||||
|
||||
Original: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Copyright (C) 2023 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/>.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 639651972fddce4dff63a0f0a7e566a15b9e2dd6..6c0df825238ca037abeb2ba619983b6f554180ea 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -46,6 +46,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")
|
||||
@@ -102,6 +103,8 @@ tasks.jar {
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
val options = options as StandardJavadocDocletOptions
|
||||
+ options.addStringOption("-add-modules", "jdk.incubator.vector") // Pufferfish
|
||||
+ options.addStringOption("Xdoclint:none", "-quiet") // Pufferfish
|
||||
options.overview = "src/main/javadoc/overview.html"
|
||||
options.use()
|
||||
options.isDocFilesSubDirs = true
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b196a10948
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
||||
@@ -0,0 +1,162 @@
|
||||
+package gg.pufferfish.pufferfish.sentry;
|
||||
+
|
||||
+import com.google.gson.Gson;
|
||||
+import java.lang.reflect.Field;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.Map;
|
||||
+import java.util.TreeMap;
|
||||
+import org.apache.logging.log4j.ThreadContext;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.plugin.Plugin;
|
||||
+import org.bukkit.plugin.RegisteredListener;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public class SentryContext {
|
||||
+
|
||||
+ private static final Gson GSON = new Gson();
|
||||
+
|
||||
+ public static void setPluginContext(@Nullable Plugin plugin) {
|
||||
+ if (plugin != null) {
|
||||
+ ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
|
||||
+ ThreadContext.put("pufferfishsentry_pluginversion", plugin.getDescription().getVersion());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void removePluginContext() {
|
||||
+ ThreadContext.remove("pufferfishsentry_pluginname");
|
||||
+ ThreadContext.remove("pufferfishsentry_pluginversion");
|
||||
+ }
|
||||
+
|
||||
+ public static void setSenderContext(@Nullable CommandSender sender) {
|
||||
+ if (sender != null) {
|
||||
+ ThreadContext.put("pufferfishsentry_playername", sender.getName());
|
||||
+ if (sender instanceof Player player) {
|
||||
+ ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void removeSenderContext() {
|
||||
+ ThreadContext.remove("pufferfishsentry_playername");
|
||||
+ ThreadContext.remove("pufferfishsentry_playerid");
|
||||
+ }
|
||||
+
|
||||
+ public static void setEventContext(@NotNull Event event, @NotNull RegisteredListener registration) {
|
||||
+ setPluginContext(registration.getPlugin());
|
||||
+
|
||||
+ try {
|
||||
+ // Find the player that was involved with this event
|
||||
+ Player player = null;
|
||||
+ if (event instanceof PlayerEvent) {
|
||||
+ player = ((PlayerEvent) event).getPlayer();
|
||||
+ } else {
|
||||
+ Class<? extends Event> eventClass = event.getClass();
|
||||
+
|
||||
+ Field playerField = null;
|
||||
+
|
||||
+ for (Field field : eventClass.getDeclaredFields()) {
|
||||
+ if (field.getType().equals(Player.class)) {
|
||||
+ playerField = field;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (playerField != null) {
|
||||
+ playerField.setAccessible(true);
|
||||
+ player = (Player) playerField.get(event);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (player != null) {
|
||||
+ setSenderContext(player);
|
||||
+ }
|
||||
+ } catch (Exception e) {} // We can't really safely log exceptions.
|
||||
+
|
||||
+ ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
|
||||
+ }
|
||||
+
|
||||
+ public static void removeEventContext() {
|
||||
+ removePluginContext();
|
||||
+ removeSenderContext();
|
||||
+ ThreadContext.remove("pufferfishsentry_eventdata");
|
||||
+ }
|
||||
+
|
||||
+ private static Map<String, String> serializeFields(Object object) {
|
||||
+ Map<String, String> fields = new TreeMap<>();
|
||||
+ fields.put("_class", object.getClass().getName());
|
||||
+ for (Field declaredField : object.getClass().getDeclaredFields()) {
|
||||
+ try {
|
||||
+ if (Modifier.isStatic(declaredField.getModifiers())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ String fieldName = declaredField.getName();
|
||||
+ if (fieldName.equals("handlers")) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ declaredField.setAccessible(true);
|
||||
+ Object value = declaredField.get(object);
|
||||
+ if (value != null) {
|
||||
+ fields.put(fieldName, value.toString());
|
||||
+ } else {
|
||||
+ fields.put(fieldName, "<null>");
|
||||
+ }
|
||||
+ } catch (Exception e) {} // We can't really safely log exceptions.
|
||||
+ }
|
||||
+ return fields;
|
||||
+ }
|
||||
+
|
||||
+ public static class State {
|
||||
+
|
||||
+ private Plugin plugin;
|
||||
+ private Command command;
|
||||
+ private String commandLine;
|
||||
+ private Event event;
|
||||
+ private RegisteredListener registeredListener;
|
||||
+
|
||||
+ public @Nullable Plugin getPlugin() {
|
||||
+ return plugin;
|
||||
+ }
|
||||
+
|
||||
+ public void setPlugin(@Nullable Plugin plugin) {
|
||||
+ this.plugin = plugin;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable Command getCommand() {
|
||||
+ return command;
|
||||
+ }
|
||||
+
|
||||
+ public void setCommand(@Nullable Command command) {
|
||||
+ this.command = command;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable String getCommandLine() {
|
||||
+ return commandLine;
|
||||
+ }
|
||||
+
|
||||
+ public void setCommandLine(@Nullable String commandLine) {
|
||||
+ this.commandLine = commandLine;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable Event getEvent() {
|
||||
+ return event;
|
||||
+ }
|
||||
+
|
||||
+ public void setEvent(@Nullable Event event) {
|
||||
+ this.event = event;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable RegisteredListener getRegisteredListener() {
|
||||
+ return registeredListener;
|
||||
+ }
|
||||
+
|
||||
+ public void setRegisteredListener(@Nullable RegisteredListener registeredListener) {
|
||||
+ this.registeredListener = registeredListener;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704ff713345
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||
@@ -0,0 +1,40 @@
|
||||
+package gg.pufferfish.pufferfish.simd;
|
||||
+
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.logging.Logger;
|
||||
+import jdk.incubator.vector.FloatVector;
|
||||
+import jdk.incubator.vector.IntVector;
|
||||
+import jdk.incubator.vector.VectorSpecies;
|
||||
+
|
||||
+/**
|
||||
+ * Basically, java is annoying and we have to push this out to its own class.
|
||||
+ */
|
||||
+@Deprecated
|
||||
+public class SIMDChecker {
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public static boolean canEnable(Logger logger) {
|
||||
+ try {
|
||||
+ if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
|
||||
+ return false;
|
||||
+ } else {
|
||||
+ SIMDDetection.testRun = true;
|
||||
+
|
||||
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
|
||||
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
|
||||
+
|
||||
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
|
||||
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
|
||||
+
|
||||
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
|
||||
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c6070711b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
||||
@@ -0,0 +1,35 @@
|
||||
+package gg.pufferfish.pufferfish.simd;
|
||||
+
|
||||
+import java.util.logging.Logger;
|
||||
+
|
||||
+@Deprecated
|
||||
+public class SIMDDetection {
|
||||
+
|
||||
+ public static boolean isEnabled = false;
|
||||
+ public static boolean versionLimited = false;
|
||||
+ public static boolean testRun = false;
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public static boolean canEnable(Logger logger) {
|
||||
+ try {
|
||||
+ return SIMDChecker.canEnable(logger);
|
||||
+ } catch (NoClassDefFoundError | Exception ignored) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public static int getJavaVersion() {
|
||||
+ // https://stackoverflow.com/a/2591122
|
||||
+ String version = System.getProperty("java.version");
|
||||
+ if(version.startsWith("1.")) {
|
||||
+ version = version.substring(2, 3);
|
||||
+ } else {
|
||||
+ int dot = version.indexOf(".");
|
||||
+ if(dot != -1) { version = version.substring(0, dot); }
|
||||
+ }
|
||||
+ version = version.split("-")[0]; // Azul is stupid
|
||||
+ return Integer.parseInt(version);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be0741465f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
|
||||
@@ -0,0 +1,83 @@
|
||||
+package gg.pufferfish.pufferfish.simd;
|
||||
+
|
||||
+import java.awt.Color;
|
||||
+import jdk.incubator.vector.FloatVector;
|
||||
+import jdk.incubator.vector.IntVector;
|
||||
+import jdk.incubator.vector.VectorMask;
|
||||
+import jdk.incubator.vector.VectorSpecies;
|
||||
+import org.bukkit.map.MapPalette;
|
||||
+
|
||||
+@Deprecated
|
||||
+public class VectorMapPalette {
|
||||
+
|
||||
+ private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
|
||||
+ private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public static void matchColorVectorized(int[] in, byte[] out) {
|
||||
+ int speciesLength = I_SPEC.length();
|
||||
+ int i;
|
||||
+ for (i = 0; i < in.length - speciesLength; i += speciesLength) {
|
||||
+ float[] redsArr = new float[speciesLength];
|
||||
+ float[] bluesArr = new float[speciesLength];
|
||||
+ float[] greensArr = new float[speciesLength];
|
||||
+ int[] alphasArr = new int[speciesLength];
|
||||
+
|
||||
+ for (int j = 0; j < speciesLength; j++) {
|
||||
+ alphasArr[j] = (in[i + j] >> 24) & 0xFF;
|
||||
+ redsArr[j] = (in[i + j] >> 16) & 0xFF;
|
||||
+ greensArr[j] = (in[i + j] >> 8) & 0xFF;
|
||||
+ bluesArr[j] = (in[i + j] >> 0) & 0xFF;
|
||||
+ }
|
||||
+
|
||||
+ IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
|
||||
+ FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
|
||||
+ FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
|
||||
+ FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
|
||||
+ IntVector resultIndex = IntVector.zero(I_SPEC);
|
||||
+ VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
|
||||
+
|
||||
+ modificationMask = modificationMask.and(alphas.lt(128).not());
|
||||
+ FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
|
||||
+
|
||||
+ for (int c = 4; c < MapPalette.colors.length; c++) {
|
||||
+ // We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
|
||||
+ // For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
|
||||
+ FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
|
||||
+ FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
|
||||
+ FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
|
||||
+
|
||||
+ FloatVector rMean = reds.add(compReds).div(2.0f);
|
||||
+ FloatVector rDiff = reds.sub(compReds);
|
||||
+ FloatVector gDiff = greens.sub(compGreens);
|
||||
+ FloatVector bDiff = blues.sub(compBlues);
|
||||
+
|
||||
+ FloatVector weightR = rMean.div(256.0f).add(2);
|
||||
+ FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
|
||||
+ FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
|
||||
+
|
||||
+ FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
|
||||
+
|
||||
+ // Now we compare to the best distance we've found.
|
||||
+ // This mask contains a "1" if better, and a "0" otherwise.
|
||||
+ VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
|
||||
+ bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
|
||||
+
|
||||
+ // Update the result array
|
||||
+ // We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
|
||||
+ resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
|
||||
+ }
|
||||
+
|
||||
+ for (int j = 0; j < speciesLength; j++) {
|
||||
+ int index = resultIndex.lane(j);
|
||||
+ out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // For the final ones, fall back to the regular method
|
||||
+ for (; i < in.length; i++) {
|
||||
+ out[i] = MapPalette.matchColor(new Color(in[i], true));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9584e245144b561b4f6745b2f26a4f69a6f92891 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.map;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
+import gg.pufferfish.pufferfish.simd.SIMDDetection; // Pufferfish
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
@@ -40,7 +41,7 @@ public final class MapPalette {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
- static final Color[] colors = {
|
||||
+ public static final Color[] colors = { // Pufferfish - public access
|
||||
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
|
||||
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
|
||||
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
|
||||
@@ -211,9 +212,15 @@ public final class MapPalette {
|
||||
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
|
||||
|
||||
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
|
||||
+ // Pufferfish start
|
||||
+ if (!SIMDDetection.isEnabled) {
|
||||
for (int i = 0; i < pixels.length; i++) {
|
||||
result[i] = matchColor(new Color(pixels[i], true));
|
||||
}
|
||||
+ } else {
|
||||
+ gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result);
|
||||
+ }
|
||||
+ // Pufferfish end
|
||||
return result;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index fc2dae69165776d08274e34a69962cc70445f411..899d67fa782fac639fe7fb096e05c551d75bd647 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -584,7 +584,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
// Paper start
|
||||
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, msg, ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
|
||||
}
|
||||
// Paper end
|
||||
@@ -654,9 +656,11 @@ public final class SimplePluginManager implements PluginManager {
|
||||
));
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
|
||||
// Paper start - error reporting
|
||||
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
|
||||
server.getLogger().log(Level.SEVERE, msg, ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
|
||||
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
|
||||
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bacacd7ef6c 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
@@ -336,7 +336,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
try {
|
||||
jPlugin.setEnabled(true);
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
+ // Paper start - Disable plugins that fail to load
|
||||
+ this.server.getPluginManager().disablePlugin(jPlugin);
|
||||
+ return;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
// Perhaps abort here, rather than continue going, but as it stands,
|
||||
@@ -361,7 +367,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
try {
|
||||
jPlugin.setEnabled(false);
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
}
|
||||
|
||||
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
|
||||
--- 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
|
||||
private io.papermc.paper.plugin.provider.classloader.PluginClassLoaderGroup classLoaderGroup; // Paper
|
||||
public io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext; // Paper
|
||||
|
||||
+ private boolean closed = false; // Pufferfish
|
||||
+
|
||||
static {
|
||||
ClassLoader.registerAsParallelCapable();
|
||||
}
|
||||
@@ -183,6 +185,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
|
||||
+ public boolean _airplane_hasClass(@NotNull String name) { return this.classes.containsKey(name); } // Pufferfish
|
||||
@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
|
||||
}
|
||||
Class<?> result = classes.get(name);
|
||||
|
||||
- if (result == null) {
|
||||
+ if (result == null && !this.closed) { // Pufferfish
|
||||
String path = name.replace('.', '/').concat(".class");
|
||||
JarEntry entry = jar.getJarEntry(path);
|
||||
|
||||
@@ -237,6 +240,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
this.setClass(name, result); // Paper
|
||||
}
|
||||
|
||||
+ if (result == null) throw new ClassNotFoundException(name); // Pufferfish
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -251,6 +255,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
// Paper end
|
||||
super.close();
|
||||
} finally {
|
||||
+ this.closed = true; // Pufferfish
|
||||
jar.close();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
150
patches/api/0002-Use-Gradle-Version-Catalogs.patch
Normal file
150
patches/api/0002-Use-Gradle-Version-Catalogs.patch
Normal file
@@ -0,0 +1,150 @@
|
||||
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 628ec6699d34c1877c02001de95096bc7b44120e..782a4c89b2f861f4c96718713ed2e4cd443084af 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,11 +9,13 @@ java {
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
+/* // Plazma - Use Gradle Versuib Catalogs
|
||||
val annotationsVersion = "24.1.0"
|
||||
val bungeeCordChatVersion = "1.20-R0.2"
|
||||
val adventureVersion = "4.17.0"
|
||||
val slf4jVersion = "2.0.9"
|
||||
val log4jVersion = "2.17.1"
|
||||
+ */
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -27,57 +29,29 @@ configurations.api {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api
|
||||
- // 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")
|
||||
- // Paper start - adventure
|
||||
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
|
||||
- exclude("com.google.guava", "guava")
|
||||
- }
|
||||
- // Paper - adventure
|
||||
- api("org.yaml:snakeyaml:2.2")
|
||||
- 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")
|
||||
- apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
|
||||
- apiAndDocs("net.kyori:adventure-api")
|
||||
- apiAndDocs("net.kyori:adventure-text-minimessage")
|
||||
- apiAndDocs("net.kyori:adventure-text-serializer-gson")
|
||||
- apiAndDocs("net.kyori:adventure-text-serializer-legacy")
|
||||
- apiAndDocs("net.kyori:adventure-text-serializer-plain")
|
||||
- apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
- api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
- api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
- api("io.sentry:sentry:5.4.0") // Pufferfish
|
||||
-
|
||||
- implementation("org.ow2.asm:asm:9.7.1")
|
||||
- implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
- // Paper end
|
||||
-
|
||||
- api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins
|
||||
- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
-
|
||||
- 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.33.0"
|
||||
- compileOnlyApi(checkerQual)
|
||||
- testCompileOnly(checkerQual)
|
||||
- // Paper end
|
||||
- api("org.jspecify:jspecify:1.0.0") // Paper - add jspecify
|
||||
-
|
||||
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||
- testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.7.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 }
|
||||
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
|
||||
+ apiAndDocs(platform(common.adventure.bom))
|
||||
+ apiAndDocs(common.bundles.adventure)
|
||||
+
|
||||
+ compileOnly(common.bundles.maven)
|
||||
+ compileOnly(api.annotations)
|
||||
+ compileOnlyApi(api.checkerqual)
|
||||
+
|
||||
+ testImplementation(common.asm.tree)
|
||||
+ testImplementation(common.commons.lang3)
|
||||
+ testImplementation(common.bundles.test)
|
||||
+
|
||||
+ testCompileOnly(api.annotations)
|
||||
+ testCompileOnly(api.checkerqual)
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -162,27 +136,24 @@ 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://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://jspecify.dev/docs/api/",
|
||||
- // Paper end
|
||||
- // Paper start
|
||||
- "https://jd.advntr.dev/api/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/key/$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/",
|
||||
- // Paper end
|
||||
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
|
||||
+ // Plazma start - Use Gradle Version Catalogs
|
||||
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/key/${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://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}/",
|
||||
+ "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}",
|
||||
+ "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}/",
|
||||
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}",
|
||||
+ // Plazma end
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
|
||||
93
patches/api/0003-Fork-friendly-Rebranding.patch
Normal file
93
patches/api/0003-Fork-friendly-Rebranding.patch
Normal file
@@ -0,0 +1,93 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Tue, 14 May 2024 18:36:30 +0900
|
||||
Subject: [PATCH] Fork-friendly Rebranding
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
|
||||
index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..41d10421e1e79711e2e90ff2dc225bfd9cac9284 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingHandler.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
|
||||
@@ -127,7 +127,7 @@ class TimingHandler implements Timing {
|
||||
while ((last = TIMING_STACK.removeLast()) != this) {
|
||||
last.timingDepth = 0;
|
||||
if ("Minecraft".equalsIgnoreCase(last.identifier.group)) {
|
||||
- Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to Paper unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)");
|
||||
+ Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)"); // Plazma - Fork-friendly Rebranding
|
||||
} else {
|
||||
Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Report this to the plugin " + last.identifier.group + " (Look for errors above this in the logs) (" + last.identifier + " did not stopTiming)", new Throwable());
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
index 7196594e07af19a14c320d77df893978525fe386..6ac3376f12df2ee3e0519ab8b5a0c8211350e550 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
@@ -33,6 +33,29 @@ public interface ServerBuildInfo {
|
||||
Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
|
||||
// Purpur end
|
||||
|
||||
+ // Plazma start - Fork-friendly Rebranding
|
||||
+ /**
|
||||
+ * The brand id for Plazma.
|
||||
+ */
|
||||
+ Key BRAND_PLAZMA_ID = Key.key("plazmamc", "plazma");
|
||||
+
|
||||
+ // For those who fork Plazma - please add the new branding key here
|
||||
+
|
||||
+ /**
|
||||
+ * The brand id of the server.
|
||||
+ */
|
||||
+ Key BRAND_ID = BRAND_PLAZMA_ID;
|
||||
+
|
||||
+ /**
|
||||
+ * Supported brands of the server.
|
||||
+ */
|
||||
+ java.util.List<Key> SUPPORTED_BRANDS = java.util.Arrays.asList(
|
||||
+ BRAND_PAPER_ID,
|
||||
+ BRAND_PURPUR_ID,
|
||||
+ BRAND_PLAZMA_ID
|
||||
+ );
|
||||
+ // Plazma end - Fork-friendly Rebranding
|
||||
+
|
||||
/**
|
||||
* Gets the {@code ServerBuildInfo}.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
index c880d0010849ab733ad13bbd18fab3c864d0cf61..316317222a137c2781b9b0c38948912e9dd08c76 100644
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -259,7 +259,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
// Purpur start
|
||||
int distance = getVersionFetcher().distance();
|
||||
final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
|
||||
- ChatColor.parseMM("<grey>Current Purpur Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
|
||||
+ ChatColor.parseMM("<grey>Current " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()), // Plazma - Fork-friendly Rebranding
|
||||
// Purpur end
|
||||
msg
|
||||
);
|
||||
@@ -282,6 +282,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
}
|
||||
}
|
||||
|
||||
+ /* // Plazma - Fork-friendly Rebranding
|
||||
private static int getDistance(@NotNull String repo, @NotNull String hash) {
|
||||
try {
|
||||
BufferedReader reader = Resources.asCharSource(
|
||||
@@ -302,4 +303,5 @@ public class VersionCommand extends BukkitCommand {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ */ // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java
|
||||
index 60e086be70529e0804280b24a2a3e7ae72d8d363..dcf1d53af919e94a6947bc3f81121bd4fad1a163 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/EventExecutor.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/EventExecutor.java
|
||||
@@ -54,7 +54,7 @@ public interface EventExecutor {
|
||||
if (m.getReturnType() != Void.TYPE) {
|
||||
final org.bukkit.plugin.java.JavaPlugin plugin = org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(m.getDeclaringClass());
|
||||
org.bukkit.Bukkit.getLogger().warning("@EventHandler method " + m.getDeclaringClass().getName() + (Modifier.isStatic(m.getModifiers()) ? '.' : '#') + m.getName()
|
||||
- + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of Paper."
|
||||
+ + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + "." // Plazma - Fork-friendly Rebranding
|
||||
+ " This should be reported to the developers of " + plugin.getPluginMeta().getDisplayName() + " (" + String.join(",", plugin.getPluginMeta().getAuthors()) + ')');
|
||||
}
|
||||
if (Modifier.isStatic(m.getModifiers())) {
|
||||
@@ -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 eb29794f6ca2efc9cde4dd1685822f9a3a73f3b9..d84c788fe1183833c86cde0ba8e174418cede950 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
|
||||
@@ -2277,6 +2277,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,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 6c0df825238ca037abeb2ba619983b6f554180ea..54da0cab8681daac2dd9fbf0eb94de471819d4c8 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -171,3 +171,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
|
||||
26
patches/api/0005-Various-API-Tweaks.patch
Normal file
26
patches/api/0005-Various-API-Tweaks.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 6 May 2024 20:43:37 +0900
|
||||
Subject: [PATCH] Various API Tweaks
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
index 41eaa8159f8c028faa118300e95f6a0fb9cfe989..76a5381a959ae4e153dba291a362f3d58aeceac9 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
@@ -584,6 +584,15 @@ public class MaterialTags {
|
||||
.add(material -> material.name().startsWith("DEEPSLATE_") && material.name().endsWith("_ORE"))
|
||||
.ensureSize("DEEPSLATE_ORES", 8).lock();
|
||||
|
||||
+ // Plazma start - Various API Tweaks
|
||||
+ /**
|
||||
+ * Covers the variants of stone ores.
|
||||
+ */
|
||||
+ public static final MaterialSetTag STONE_ORES = new MaterialSetTag(keyFor("stone_ores"))
|
||||
+ .add(material -> !material.name().startsWith("DEEPSLATE_") && !material.name().startsWith("NETHER_") && material.name().endsWith("_ORE"))
|
||||
+ .ensureSize("STONE_ORES", 8).lock();
|
||||
+ // Plazma end - Various API Tweaks
|
||||
+
|
||||
/**
|
||||
* Covers the variants of raw ore blocks.
|
||||
*/
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 28 Sep 2023 12:21:36 +0900
|
||||
Subject: [PATCH] Implement No Chat Reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
index 2eb13c049fa917d41fa9ad17fdec9ec4c33701a8..5d50f83a76affc74f989870ca1bc8d7a75f3b2ba 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
||||
@@ -215,6 +215,8 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
||||
* Fallback cause
|
||||
*/
|
||||
UNKNOWN,
|
||||
+
|
||||
+ NCR_NOT_INSTALLED, // Plazma - Implement No Chat Reports
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -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 e0aa5b925cbd6c2733ad70cb0722c7ab7c4d0419..51cea31c55c7e1a00cfb966349147fc874e1736b 100644
|
||||
--- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -440,6 +440,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
|
||||
+
|
||||
private static <T extends Mob> @NonNull GoalKey<T> create(final @NonNull String key,
|
||||
final @NonNull Class<T> type) {
|
||||
return GoalKey.of(type, NamespacedKey.minecraft(key));
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
117
patches/server/0002-Build-System-Changes.patch
Normal file
117
patches/server/0002-Build-System-Changes.patch
Normal file
@@ -0,0 +1,117 @@
|
||||
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] Build System Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index ccb31eb5993db028d0cbf104261205c9462f8734..44ebd149b18cf002cb9ffc9073c95ab1bd9bd356 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,63 +13,29 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur
|
||||
- // 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.17.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
- /*
|
||||
- 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
|
||||
- runtimeOnly(log4jPlugins.output)
|
||||
- alsoShade(log4jPlugins.output)
|
||||
- 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.22.1") // Paper - remove exclusion
|
||||
- implementation("org.ow2.asm:asm-commons:9.7.1")
|
||||
- implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
- implementation("commons-lang:commons-lang:2.6")
|
||||
- runtimeOnly("org.xerial:sqlite-jdbc:3.46.1.3")
|
||||
- runtimeOnly("com.mysql:mysql-connector-j:9.1.0")
|
||||
- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
- // Paper start - Use Velocity cipher
|
||||
- implementation("com.velocitypowered:velocity-native:3.3.0-SNAPSHOT") {
|
||||
- isTransitive = false
|
||||
- }
|
||||
- // Paper end - Use Velocity cipher
|
||||
-
|
||||
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
-
|
||||
- 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
|
||||
-
|
||||
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||
- testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
|
||||
- testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
- implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
|
||||
- implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
|
||||
- // Paper start - Remap reflection
|
||||
- val reflectionRewriterVersion = "0.0.3"
|
||||
- implementation("io.papermc:reflection-rewriter:$reflectionRewriterVersion")
|
||||
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
|
||||
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
|
||||
- // Paper end - Remap reflection
|
||||
- // Paper start - spark
|
||||
- implementation("me.lucko:spark-api:0.1-20240720.200737-2")
|
||||
- implementation("me.lucko:spark-paper:1.10.105-SNAPSHOT")
|
||||
- // Paper end - spark
|
||||
+ // Plazma start - Build System Changes
|
||||
+ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api"))
|
||||
+ implementation(common.snakeyaml)
|
||||
+ implementation(common.asm.commons)
|
||||
+ implementation(common.log4j.core)
|
||||
+ implementation(common.log4j.iostreams)
|
||||
+ implementation(common.commons.lang2)
|
||||
+ implementation(common.adventure.serializer.ansi)
|
||||
+ implementation(server.velocity) { isTransitive = false }
|
||||
+ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") }
|
||||
+ implementation(server.bundles.implementation)
|
||||
+
|
||||
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
|
||||
+ alsoShade(log4jPlugins.output) // diff on changes
|
||||
+ runtimeOnly(log4jPlugins.output) // diff on changes
|
||||
+
|
||||
+ runtimeOnly(common.maven.provider)
|
||||
+ runtimeOnly(common.bundles.maven)
|
||||
+ runtimeOnly(server.bundles.runtime)
|
||||
+
|
||||
+ testImplementation(common.bundles.test)
|
||||
+ testImplementation(server.bundles.test)
|
||||
+ // Plazma end - Build System Changes
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -89,14 +55,14 @@ tasks.jar {
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
- "Implementation-Title" to "Purpur", // Pufferfish // Purpur
|
||||
+ "Implementation-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding
|
||||
"Implementation-Version" to implementationVersion,
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
- "Specification-Title" to "Purpur", // Pufferfish // Purpur
|
||||
+ "Specification-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding
|
||||
"Specification-Version" to project.version,
|
||||
- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur
|
||||
- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur
|
||||
- "Brand-Name" to "Purpur", // Pufferfish // Purpur
|
||||
+ "Specification-Vendor" to rootProject.providers.gradleProperty("providerName").get(), // Purpur // Plazma - Fork-friendly Rebranding
|
||||
+ "Brand-Id" to rootProject.providers.gradleProperty("brandKey").get(), // Purpur // Plazma - Fork-friendly Rebranding
|
||||
+ "Brand-Name" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to Instant.now().toString(),
|
||||
"Git-Branch" to gitBranch, // Paper
|
||||
426
patches/server/0003-Fork-friendly-Rebranding.patch
Normal file
426
patches/server/0003-Fork-friendly-Rebranding.patch
Normal file
@@ -0,0 +1,426 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 21 Dec 2022 19:31:24 +0900
|
||||
Subject: [PATCH] Fork-friendly Rebranding
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f 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 {
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// 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(io.papermc.paper.ServerBrandConstants.BRAND_NAME, serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..6995627310de4911d87a2f93a723d6b93dc0612f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -36,7 +36,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static final int DISTANCE_ERROR = -1;
|
||||
private static final int DISTANCE_UNKNOWN = -2;
|
||||
// Purpur start
|
||||
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
|
||||
+ // private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; // Plazma - Fork-friendly Rebranding
|
||||
private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; }
|
||||
// Purpur end
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
|
||||
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
|
||||
} else {
|
||||
- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur
|
||||
+ updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", build); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
final @Nullable Component history = this.getHistory();
|
||||
|
||||
@@ -63,8 +63,12 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
//int distance = DISTANCE_ERROR; // Purpur - use field
|
||||
|
||||
final OptionalInt buildNumber = build.buildNumber();
|
||||
- if (buildNumber.isPresent()) {
|
||||
- distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
|
||||
+ // Plazma start - TODO: CI Checking
|
||||
+ //noinspection PointlessBooleanExpression
|
||||
+ if (false && buildNumber.isPresent()) {
|
||||
+ throw new UnsupportedOperationException("Version fetching from CI is not supported yet");
|
||||
+ // distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
|
||||
+ // Plazma end - TODO: CI Checking
|
||||
} else {
|
||||
final Optional<String> gitBranch = build.gitBranch();
|
||||
final Optional<String> gitCommit = build.gitCommit();
|
||||
@@ -80,12 +84,13 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur
|
||||
.append(Component.newline())
|
||||
.append(text("Download the new version at: ")
|
||||
- .append(text(DOWNLOAD_PAGE, NamedTextColor.GOLD)
|
||||
+ .append(text(io.papermc.paper.ServerBrandConstants.DOWNLOAD_PAGE, NamedTextColor.GOLD) // Plazma - Fork-friendly Rebranding
|
||||
.hoverEvent(text("Click to open", NamedTextColor.WHITE))
|
||||
- .clickEvent(ClickEvent.openUrl(DOWNLOAD_PAGE))));
|
||||
+ .clickEvent(ClickEvent.openUrl(io.papermc.paper.ServerBrandConstants.DOWNLOAD_PAGE)))); // Plazma - Fork-friendly Rebranding
|
||||
};
|
||||
}
|
||||
|
||||
+ /* // Plazma - TODO: CI Checking
|
||||
private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
|
||||
try {
|
||||
try (final BufferedReader reader = Resources.asCharSource(
|
||||
@@ -105,6 +110,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
return DISTANCE_ERROR;
|
||||
}
|
||||
}
|
||||
+ */ // Plazma - TODO: CI Checking
|
||||
|
||||
// Contributed by Techcable <Techcable@outlook.com> in GH-65
|
||||
private static int fetchDistanceFromGitHub(final String repo, final String branch, final 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 90b3526479320064378f2cde6c2f2b8e48a59ba6..21658c61ad091647d5421d1dbf892d03ca175c74 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Purpur") // Purpur
|
||||
+ .appName(io.papermc.paper.ServerBrandConstants.BRAND_NAME) // Purpur // Plazma - Fork-friendly Rebranding
|
||||
.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/io/papermc/paper/ServerBrandConstants.java b/src/main/java/io/papermc/paper/ServerBrandConstants.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3af005ce2bbd30601917987d8c831db23c733ab8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBrandConstants.java
|
||||
@@ -0,0 +1,29 @@
|
||||
+package io.papermc.paper;
|
||||
+
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public interface ServerBrandConstants {
|
||||
+
|
||||
+ // Basic brand informations
|
||||
+ String BRAND_NAME = "Plazma";
|
||||
+ String RESOURCE_PATH = "META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties";
|
||||
+
|
||||
+ @Nullable
|
||||
+ String ASCII_LOGO = """
|
||||
+
|
||||
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m╗\033[38;2;56;91;166m\s
|
||||
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m█\033[38;2;196;31;137m█\033[38;2;193;33;138m╗ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m╗ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m╔\033[38;2;116;65;153m╝ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m█\033[38;2;101;72;157m╗\033[38;2;97;73;157m \033[38;2;94;75;158m█\033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m╗
|
||||
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╔\033[38;2;193;33;138m╝ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m \033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m╔\033[38;2;120;64;153m╝\033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m╔\033[38;2;104;71;156m█\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m█\033[38;2;91;76;159m╔\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
|
||||
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m═\033[38;2;196;31;137m╝\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m╔\033[38;2;123;62;152m╝\033[38;2;120;64;153m \033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m╚\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m╔\033[38;2;91;76;159m╝\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
|
||||
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m║\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m█\033[38;2;180;38;140m█\033[38;2;177;39;141m█\033[38;2;174;41;142m█\033[38;2;170;42;142m█\033[38;2;167;43;143m╗ \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m║\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m \033[38;2;101;72;157m╚\033[38;2;97;73;157m═\033[38;2;94;75;158m╝\033[38;2;91;76;159m \033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m║\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
|
||||
+ \033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
|
||||
+ """;
|
||||
+
|
||||
+ // Support URLs
|
||||
+ String DOWNLOAD_PAGE = "https://plazmamc.org/downloads";
|
||||
+ String CONFIG_REFERENCE = "https://docs.plazmamc.org/plazma/administration/reference/configurations";
|
||||
+ String START_GUIDE = "https://docs.plazmamc.org/plazma/administration/getting-started";
|
||||
+ String USAGE_GUIDE = "https://docs.plazmamc.org/plazma/administration/getting-started/next-step";
|
||||
+ String SUPPORT_PAGE = "https://github.com/PlazmaMC/Plazma/issues";
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index a6e5950b5875cafd734300cdfbf58f5d3736f3c8..a337e2c9576fb70a8ee9082e9b69719c804b286e 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -30,9 +30,6 @@ public record ServerBuildInfoImpl(
|
||||
private static final String ATTRIBUTE_GIT_BRANCH = "Git-Branch";
|
||||
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
|
||||
|
||||
- private static final String BRAND_PAPER_NAME = "Paper";
|
||||
- private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur
|
||||
-
|
||||
private static final String BUILD_DEV = "DEV";
|
||||
|
||||
public ServerBuildInfoImpl() {
|
||||
@@ -43,9 +40,9 @@ public record ServerBuildInfoImpl(
|
||||
this(
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
|
||||
.map(Key::key)
|
||||
- .orElse(BRAND_PURPUR_ID), // Purpur
|
||||
+ .orElse(BRAND_ID), // Purpur // Plazma - Fork-friendly Rebranding
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
||||
- .orElse(BRAND_PURPUR_NAME), // Purpur
|
||||
+ .orElse(ServerBrandConstants.BRAND_NAME), // Purpur // Plazma - Fork-friendly Rebranding
|
||||
SharedConstants.getCurrentVersion().getId(),
|
||||
SharedConstants.getCurrentVersion().getName(),
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
||||
@@ -62,7 +59,7 @@ public record ServerBuildInfoImpl(
|
||||
|
||||
@Override
|
||||
public boolean isBrandCompatible(final @NotNull Key brandId) {
|
||||
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Purpur
|
||||
+ return brandId.equals(this.brandId) || SUPPORTED_BRANDS.contains(brandId); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
index 87e5f614ba988547a827486740db217e28585773..f5aac6cde46ca08a4d4792e38f514bb3d8188ae8 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
@@ -113,9 +113,7 @@ public abstract class Configurations<G, W> {
|
||||
try {
|
||||
loader.save(node);
|
||||
} catch (ConfigurateException ex) {
|
||||
- if (ex.getCause() instanceof AccessDeniedException) {
|
||||
- LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex);
|
||||
- } else throw ex;
|
||||
+ if (ex.getCause() instanceof AccessDeniedException) LOGGER.warn("Could not save {}: {} could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at {} for more details.", filename, io.papermc.paper.ServerBrandConstants.BRAND_NAME, io.papermc.paper.ServerBrandConstants.CONFIG_REFERENCE, ex); else throw ex; // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
||||
index 710477ae27ebc5afdf0012ef0867d05efd293c24..3a5e7546c5cc1fcec880cece3f0d0b04ec23cc18 100644
|
||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
||||
@@ -32,13 +32,13 @@ public class CrashReport {
|
||||
private boolean trackingStackTrace = true;
|
||||
private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
|
||||
private final SystemReport systemReport = new SystemReport();
|
||||
- private List<String> extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!", ""); // Purpur - Rebrand
|
||||
+ private List<String> extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO " + io.papermc.paper.ServerBrandConstants.BRAND_NAME.toUpperCase() + " INSTEAD!", ""); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
|
||||
|
||||
public CrashReport(String message, Throwable cause) {
|
||||
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(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index f0d762bd140fad27ae73bcf3e61b640b9e3f2592..3a9f7143505ba1a70bcd224ee8fef5c844a94ed1 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -108,6 +108,11 @@ public class Main {
|
||||
*/ // CraftBukkit end
|
||||
|
||||
try {
|
||||
+ // Plazma start - Fork-friendly Rebranding
|
||||
+ //noinspection ConstantValue
|
||||
+ if (io.papermc.paper.ServerBrandConstants.ASCII_LOGO != null)
|
||||
+ System.out.println(io.papermc.paper.ServerBrandConstants.ASCII_LOGO);
|
||||
+ // Plazma end - Fork-friendly Rebranding
|
||||
|
||||
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6acffd0d74f35ea9ec7e9937b65c3fc81c7769e5..e11c65bd47875d6c7a4e9927cd772afeb0e51da9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1278,7 +1278,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.info("*************************************************************************************");
|
||||
LOGGER.info("This is the first time you're starting this server.");
|
||||
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
||||
- LOGGER.info("View this and more helpful information here: https://docs.papermc.io/paper/next-steps");
|
||||
+ LOGGER.info("View this and more helpful information here: {}", io.papermc.paper.ServerBrandConstants.START_GUIDE); // Plazma - Fork-friendly Rebranding
|
||||
LOGGER.info("*************************************************************************************");
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index e9ad8e2ac267c46df80e884308df8bb12d0deeff..4aaeb0521a5e48a7d74a7968c952fcca7b6c0433 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -775,7 +775,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.bukkit.plugin.Plugin[] plugins = this.server.getPluginManager().getPlugins();
|
||||
|
||||
result.append(this.server.getName());
|
||||
- result.append(" on Bukkit ");
|
||||
+ result.append(" on ").append(io.papermc.paper.ServerBrandConstants.BRAND_NAME).append(" "); // Plazma - Fork-friendly Rebranding
|
||||
result.append(this.server.getBukkitVersion());
|
||||
|
||||
if (plugins.length > 0 && this.server.getQueryPlugins()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index b97d8f43f24baf36eca9064b2b48bf6c092f848c..9dce68d9d3f5dc0bb3cc7c11859d3082b73347cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -56,10 +56,10 @@ 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server"); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
public final boolean pvp = this.get("pvp", true);
|
||||
public final boolean allowFlight = this.get("allow-flight", false);
|
||||
- public final String motd = this.get("motd", "A Minecraft Server");
|
||||
+ public final String motd = this.get("motd", "A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server"); // Plazma - Fork-friendly Rebranding
|
||||
public final String bugReportLink = this.get("bug-report-link", "");
|
||||
public final boolean forceGameMode = this.get("force-gamemode", false);
|
||||
public final boolean enforceWhitelist = this.get("enforce-whitelist", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 8f74c2ec5252b6265549589310d742337c91cb2c..ecb5a046514e3cd448cbf633c728831b1eb5d30b 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 {
|
||||
;
|
||||
}
|
||||
|
||||
- final JFrame jframe = new JFrame("Purpur Minecraft server"); // Purpur
|
||||
+ final JFrame jframe = new JFrame(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server"); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
final MinecraftServerGui servergui = new MinecraftServerGui(server);
|
||||
|
||||
jframe.setDefaultCloseOperation(2);
|
||||
@@ -64,7 +64,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
jframe.pack();
|
||||
jframe.setLocationRelativeTo((Component) null);
|
||||
jframe.setVisible(true);
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper - Improve ServerGUI // Purpur
|
||||
+ jframe.setName(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Fork-friendly Rebranding
|
||||
|
||||
// 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(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server - shutting down!"); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
server.halt(true);
|
||||
servergui.runFinalizers();
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
|
||||
// Paper start - Add onboarding message for initial server start
|
||||
private JComponent buildOnboardingPanel() {
|
||||
- String onboardingLink = "https://docs.papermc.io/paper/next-steps";
|
||||
+ String onboardingLink = io.papermc.paper.ServerBrandConstants.USAGE_GUIDE; // Plazma - Fork-friendly Rebranding
|
||||
JPanel jPanel = new JPanel();
|
||||
|
||||
javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index 4a96d914f8aa6f0c5f13fc85369a311f25835ac2..5b4285d6b37346bcea3bf072c6f00bd50c62e703 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -89,7 +89,7 @@ public class DamageSource {
|
||||
|
||||
public DamageSource customEventDamager(Entity entity) {
|
||||
if (this.directEntity != null) {
|
||||
- throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper)");
|
||||
+ throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + ")"); // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
DamageSource damageSource = this.cloneInstance();
|
||||
damageSource.customEventDamager = entity;
|
||||
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 0dde7cd71a32e6c0cde6cbbaef585896a3d7dae7..9b4afcd708270225da272ba5278397ffe1f91403 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
|
||||
@@ -274,7 +274,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
// 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 PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur
|
||||
+ 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
|
||||
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index b2d60b214b58d9a5fadf3629e5ebc358c904d1c6..f9ee08eae4a1e1c6490e4682901609c0e4d52579 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -143,7 +143,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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Version"); // Plazma - Fork-friendly Rebranding
|
||||
|
||||
this.acceptsAll(Main.asList("demo"), "Demo mode");
|
||||
|
||||
@@ -188,7 +188,7 @@ public class Main {
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
.ofType(String.class)
|
||||
- .defaultsTo("Unknown Server")
|
||||
+ .defaultsTo("A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server") // Plazma - Fork-friendly Rebranding
|
||||
.describedAs("Name");
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index c914e1e13c4f64f24efa5f825e58efb69632bfa6..c558a2621381cf54661fd3926a00982af2037365 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.parsePending();
|
||||
} else {
|
||||
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME); // Paper // Purpur // Plazma - Fork-friendly Rebranding
|
||||
// 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..e0414f59b7c5ef149d8e52ebf76dc3e46d9de4d3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
public static String getBukkitVersion() {
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream(io.papermc.paper.ServerBrandConstants.RESOURCE_PATH); // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding
|
||||
Properties properties = new Properties();
|
||||
|
||||
if (stream != null) {
|
||||
@@ -20,7 +20,7 @@ public final class Versioning {
|
||||
|
||||
result = properties.getProperty("version");
|
||||
} catch (IOException ex) {
|
||||
- Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get Bukkit version!", ex);
|
||||
+ Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " version!", ex); // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index f51cc3de3ca935ef90f7f0e9dd0506b856fc55f3..d889d964067058762fcffab9945fe586ce8d2a07 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||
if (isLongTimeout) {
|
||||
// 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " bug." ); // Paper // Purpur // Plazma - Fork-friendly Rebranding
|
||||
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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " bug, please report this to " + io.papermc.paper.ServerBrandConstants.SUPPORT_PAGE ); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
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, io.papermc.paper.ServerBrandConstants.BRAND_NAME + " version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -184,12 +184,12 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||
// 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME.toUpperCase() + " - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + "!):" ); // Paper // Purpur // Plazma - Fork-friendly Rebranding
|
||||
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), 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 );
|
||||
@@ -205,7 +205,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||
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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -1,80 +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/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index b0b2cbd8d9db1772d43a285eca9060f3879acab0..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -604,15 +604,6 @@ public class Metrics {
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||
- final String paperVersion;
|
||||
- final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
||||
- if (implVersion != null) {
|
||||
- final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||
- paperVersion = "git-Pufferfish-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Pufferfish
|
||||
- } else {
|
||||
- paperVersion = "unknown";
|
||||
- }
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("pufferfish_version", () -> paperVersion)); // Pufferfish
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
||||
index 733134401fcba393053c7a2dfa1d0d44f8f79ff5..17d931ef47846b59e28dc0c5b5ae91396a1d3e7d 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) -> { // Plazma - decompile fix
|
||||
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> { // Plazma - decompile fix
|
||||
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema()); // Plazma - decompile fix
|
||||
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
|
||||
return leavesSection;
|
||||
})));
|
||||
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
|
||||
- return typed;
|
||||
+ return typed2x; // Plazma - decompile fix
|
||||
} 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) -> { // Plazma - decompile fix
|
||||
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2); // Plazma - decompile fix
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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 = (List) optional.map((list) -> { // Plazma - decompile fix
|
||||
+ return (List) list.stream().map(Pair::getSecond).collect(Collectors.toList()); // Plazma - decompile fix
|
||||
}).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, (List) this.palette.stream().map((dynamic) -> { // Plazma - decompile fix
|
||||
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
3597
patches/server/0004-Rebrand-Logo.patch
Normal file
3597
patches/server/0004-Rebrand-Logo.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,382 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@outlook.com>
|
||||
Date: Wed, 21 Dec 2022 19:31:24 +0900
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 393dab1ece76e0ca1e0b58c0b2c72d5c1c41a84d..cfb74b11743ce2f7a78a6a8085f9dd05b65a3152 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
// Purpur start
|
||||
- implementation(project(":purpur-api"))
|
||||
+ implementation(project(":plazma-api"))
|
||||
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||
exclude("io.papermc.paper", "paper-api")
|
||||
}
|
||||
@@ -87,7 +87,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-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
|
||||
--- 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 {
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// 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.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -603,7 +603,7 @@ public class Metrics {
|
||||
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||
+ 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.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
|
||||
--- 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;
|
||||
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 int distance = -2; public int distance() { return distance; }
|
||||
// Purpur end
|
||||
private static @Nullable String mcVer;
|
||||
@@ -33,8 +33,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
|
||||
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 {
|
||||
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("Pattern: " + VER_PATTERN.toString());
|
||||
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
||||
}
|
||||
@@ -57,6 +57,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
|
||||
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
||||
+ /* // Plazma - Disable CI Checking
|
||||
//int distance; // Purpur - use field
|
||||
try {
|
||||
int jenkinsBuild = Integer.parseInt(versionInfo);
|
||||
@@ -65,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
versionInfo = versionInfo.replace("\"", "");
|
||||
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
||||
}
|
||||
+ // Plazma start - Disable CI Checking
|
||||
+ */
|
||||
+ versionInfo = versionInfo.replace("\"", ""); // Plazma
|
||||
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo); // Plazma
|
||||
+ // Plazma end
|
||||
|
||||
switch (distance) {
|
||||
case -1:
|
||||
@@ -83,6 +89,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
}
|
||||
|
||||
+ /* // Plazma - Disable CI Checking
|
||||
private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) {
|
||||
if (siteApiVersion == null) { return -1; }
|
||||
try {
|
||||
@@ -102,6 +109,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ */ // Plazma - Disable CI Checking
|
||||
|
||||
// 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
|
||||
--- 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 {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Purpur") // Purpur
|
||||
+ .appName("Plazma") // Purpur // Plazma
|
||||
.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 ed3527612315e6e0649182ce4e1ae2834b0918a9..ae02c029f0169d30a34d4a4e65ea6cb4fa498111 100644
|
||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
||||
@@ -35,7 +35,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
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
@@ -125,7 +125,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
|
||||
// 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 27a238cc56702297c88fde0f379178222ccf6c5b..30fc258faa6f087cf3c91411b48116a3ac416031 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -108,6 +108,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
|
||||
+ \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┛
|
||||
+ """);
|
||||
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
|
||||
+ // Plazma end
|
||||
+
|
||||
// Paper start
|
||||
if (Boolean.getBoolean("Paper.isRunDev")) {
|
||||
net.minecraft.server.packs.VanillaPackResourcesBuilder.developmentConfig = builder -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 8c3942d9ce4f8a102a47bec74af5911760fda4e3..cf9f7d52b07cffd41293ba5a6fab3a7f77a2cf03 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -914,7 +914,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
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326fc57c32c 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
;
|
||||
}
|
||||
|
||||
- final JFrame jframe = new JFrame("Purpur Minecraft server"); // Purpur
|
||||
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma
|
||||
final MinecraftServerGui servergui = new MinecraftServerGui(server);
|
||||
|
||||
jframe.setDefaultCloseOperation(2);
|
||||
@@ -64,7 +64,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
jframe.pack();
|
||||
jframe.setLocationRelativeTo((Component) null);
|
||||
jframe.setVisible(true);
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper // Purpur
|
||||
+ jframe.setName("Plazma Minecraft server"); // Paper // Purpur // Plazma
|
||||
|
||||
// Paper start - Add logo as frame image
|
||||
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
|
||||
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 75622ee77096d7eb311df0fd16b70c0f6dae3ccc..0325eada6271f021b4cc6e398b6e3e75b915f8aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1321,7 +1321,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 db571f658f636cdda1dcdbaffa0c4da67fae11ad..0ba8a251bf1f5a7a6f27823686bf0d636feba769 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
|
||||
@@ -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
|
||||
}
|
||||
|
||||
private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a7081f2ce7e001c9a75b620c55703a0218f6dc28..005c854a10f343cd7488b282de002249bf5c4ced 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -267,7 +267,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 serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 465e63a5849e224d86e82ef6c31c99846245e63b..2a384f70d14189af1690caba35b8202da519caf9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
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
|
||||
}
|
||||
|
||||
@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
|
||||
--- 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 {
|
||||
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
|
||||
// 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
|
||||
--- 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;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public final class Versioning {
|
||||
- public static String getBukkitVersion() {
|
||||
- String result = "Unknown-Version";
|
||||
-
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
|
||||
+ // Plazma start
|
||||
+ public static String version = "Unknown-Version";
|
||||
+ static {
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties");
|
||||
Properties properties = new Properties();
|
||||
|
||||
if (stream != null) {
|
||||
try {
|
||||
properties.load(stream);
|
||||
|
||||
- result = properties.getProperty("version");
|
||||
+ version = properties.getProperty("version");
|
||||
} catch (IOException ex) {
|
||||
- Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get Bukkit version!", ex);
|
||||
+ Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get Plazma version!", ex);
|
||||
}
|
||||
}
|
||||
+ }
|
||||
|
||||
- return result;
|
||||
+ public static String getBukkitVersion() {
|
||||
+ return version;
|
||||
}
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -231,7 +231,7 @@ public class PurpurConfig {
|
||||
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
}
|
||||
|
||||
- public static String serverModName = "Purpur";
|
||||
+ public static String serverModName = "Plazma"; // Plazma
|
||||
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 dbd502761ff6e6efb252bb41376a7ff028c73895..c765cb5dd8c3c1b668b7031e6c784ed9cf2d58e1 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
if (isLongTimeout) {
|
||||
// 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, "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, "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
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -185,12 +185,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, "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
|
||||
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
|
||||
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, "------------------------------" );
|
||||
1359
patches/server/0005-Plazma-Configurations.patch
Normal file
1359
patches/server/0005-Plazma-Configurations.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,333 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <alphakr93@gmail.com>
|
||||
Date: Fri, 10 Mar 2023 22:08:56 +0900
|
||||
Subject: [PATCH] Rebrand Logo
|
||||
|
||||
|
||||
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
|
||||
index 518591dd83289e041a16e2c2e7d7e7640d4b2e1b..278de5d47a7802ab89d9ae39c1560ef87d6d6fc4 100644
|
||||
GIT binary patch
|
||||
literal 7999
|
||||
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
|
||||
E0k}Z_!T<mO
|
||||
|
||||
literal 9260
|
||||
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
|
||||
HqBZh=dic2S
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
128
patches/server/0006-Setup-basic-configuration-sections.patch
Normal file
128
patches/server/0006-Setup-basic-configuration-sections.patch
Normal file
@@ -0,0 +1,128 @@
|
||||
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..aff5c68bc715c6ea9b5b808e5a94cbac9a3725ba 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,49 @@ 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 Structure structure;
|
||||
+ public class Structure extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Miscellaneous misc;
|
||||
+ public class Miscellaneous extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
|
||||
index 25c0f5d28107b45677aa7b19bc0d5238512d9826..ac0f038de0ce5cf6df0b730af69d3229c3119eff 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
|
||||
@@ -2,9 +2,12 @@ package org.plazmamc.plazma.configurations;
|
||||
|
||||
import org.spongepowered.configurate.NodePath;
|
||||
|
||||
+import static org.spongepowered.configurate.NodePath.path;
|
||||
+
|
||||
interface RemovedConfigurations {
|
||||
|
||||
NodePath[] WORLD_PATHS = {
|
||||
+ path("structure", "nether-portal")
|
||||
};
|
||||
|
||||
NodePath[] GLOBAL_PATHS = {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..8dce68cf7769fcd5ea03be32621ccb6bab174697 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -19,4 +19,38 @@ 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 {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Block block;
|
||||
+ public class Block extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 16:02:29 +0900
|
||||
Subject: [PATCH] Add more metrics
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..fa88d48adc3aefcd823f431f099e46c94fd071a1 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -636,16 +636,51 @@ public class Metrics {
|
||||
return map;
|
||||
}));
|
||||
|
||||
+ // Plazma start - Add more metrics
|
||||
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
|
||||
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
|
||||
+
|
||||
+ if (datapacks == 0) return Collections.singletonMap("0", entry);
|
||||
+ else if (datapacks <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (datapacks <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (datapacks <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (datapacks <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ return Collections.singletonMap("50+", entry);
|
||||
+ }));
|
||||
+
|
||||
+ List<Plugin> plugins = Arrays.stream(Bukkit.getPluginManager().getPlugins()).toList();
|
||||
+
|
||||
+ metrics.addCustomChart(new DrilldownPie("plugins", () -> {
|
||||
+ int pluginCount = (int) plugins.stream().filter(Plugin::isEnabled).count();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(pluginCount), 1);
|
||||
+
|
||||
+ if (pluginCount == 0) return Collections.singletonMap("0", entry);
|
||||
+ else if (pluginCount <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (pluginCount <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (pluginCount <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (pluginCount <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ return Collections.singletonMap("50+", entry);
|
||||
+ }));
|
||||
+
|
||||
+ metrics.addCustomChart(new DrilldownPie("disabled_plugins", () -> {
|
||||
+ int disabled = (int) plugins.stream().filter(java.util.function.Predicate.not(Plugin::isEnabled)).count();
|
||||
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(disabled), 1);
|
||||
+
|
||||
+ if (disabled == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry);
|
||||
+ else if (disabled <= 5) return Collections.singletonMap("1-5", entry);
|
||||
+ else if (disabled <= 10) return Collections.singletonMap("6-10", entry);
|
||||
+ else if (disabled <= 25) return Collections.singletonMap("11-25", entry);
|
||||
+ else if (disabled <= 50) return Collections.singletonMap("26-50", entry);
|
||||
+ return Collections.singletonMap("50+ \uD83D\uDE2D", entry);
|
||||
+ }));
|
||||
+ // Plazma end
|
||||
+
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
|
||||
// count legacy plugins
|
||||
- int legacy = 0;
|
||||
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||
- if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
||||
- legacy++;
|
||||
- }
|
||||
- }
|
||||
+ int legacy = (int) plugins.stream().filter(p -> CraftMagicNumbers.isLegacy(p.getDescription())).count(); // Plazma
|
||||
|
||||
// insert real value as lower dimension
|
||||
Map<String, Integer> entry = new HashMap<>();
|
||||
40
patches/server/0007-Warn-on-startup.patch
Normal file
40
patches/server/0007-Warn-on-startup.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 3 May 2024 19:50:32 +0900
|
||||
Subject: [PATCH] Warn on startup
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 3a9f7143505ba1a70bcd224ee8fef5c844a94ed1..e0885f53aa3d0ae95a40574806af70c865025a9d 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -113,6 +113,18 @@ public class Main {
|
||||
if (io.papermc.paper.ServerBrandConstants.ASCII_LOGO != null)
|
||||
System.out.println(io.papermc.paper.ServerBrandConstants.ASCII_LOGO);
|
||||
// Plazma end - Fork-friendly Rebranding
|
||||
+ // Plazma start - Warn on startup
|
||||
+ if (!org.plazmamc.plazma.Options.NO_WARN) {
|
||||
+ LOGGER.warn("Warning! " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
|
||||
+ if (io.papermc.paper.ServerBuildInfo.buildInfo().asString(io.papermc.paper.ServerBuildInfo.StringRepresentation.VERSION_FULL).contains("DEV")) {
|
||||
+ LOGGER.error("*********************** CAUTION ***********************");
|
||||
+ LOGGER.error("This version is a development version of {}.", io.papermc.paper.ServerBrandConstants.BRAND_NAME);
|
||||
+ LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems.");
|
||||
+ LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!");
|
||||
+ LOGGER.error("*******************************************************");
|
||||
+ }
|
||||
+ }
|
||||
+ // Plazma end
|
||||
|
||||
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
index ca11bd22a65c8b9f4fffb1832ada8c519ab75b98..5d41bd4d4b86ca0c7c03d3ac6e75b3f1f1abe73b 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/Options.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -6,5 +6,6 @@ import static java.lang.System.getProperty;
|
||||
public interface Options {
|
||||
|
||||
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
|
||||
+ boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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/build.gradle.kts b/build.gradle.kts
|
||||
index 44ebd149b18cf002cb9ffc9073c95ab1bd9bd356..c45f40170cbdc03df31451d2c30a877f8d8f26af 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -133,7 +133,7 @@ fun TaskContainer.registerRunTask(
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
vendor.set(JvmVendorSpec.JETBRAINS)
|
||||
})
|
||||
- jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
|
||||
+ jvmArgs("-DPlazma.DevelopmentEnvironment", "-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods") // Plazma - Always agree EULA on development mode
|
||||
|
||||
if (rootProject.childProjects["test-plugin"] != null) {
|
||||
val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index e0885f53aa3d0ae95a40574806af70c865025a9d..e9ba8ad80a66b8b0c99d214709222310758fcc65 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -179,6 +179,7 @@ public class Main {
|
||||
|
||||
// Spigot Start
|
||||
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
|
||||
+ eulaAgreed = eulaAgreed || org.plazmamc.plazma.Options.DEVELOPMENT; // Plazma - Always agree EULA on development mode
|
||||
if ( eulaAgreed )
|
||||
{
|
||||
System.err.println( "You have used the Spigot command line EULA agreement flag." );
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
index 5d41bd4d4b86ca0c7c03d3ac6e75b3f1f1abe73b..b891735728e14c40c67e21897b5043efc7077b7f 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/Options.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -7,5 +7,6 @@ public interface Options {
|
||||
|
||||
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
|
||||
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
+ boolean DEVELOPMENT = getBoolean("Plazma.DevelopmentEnvironment");
|
||||
|
||||
}
|
||||
98
patches/server/0009-Add-more-metrics.patch
Normal file
98
patches/server/0009-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 8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f..48d33d4131af90eee35c9553898a2ac7ec5e2b7e 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,31 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 16:59:14 +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 b875f4af9dcb45bcad0ee59a958442ba673268fe..d38685f82d2e6c4e71179bf3a85a8b183aa6c44b 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -161,6 +161,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]);
|
||||
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.allowAnyUsername) // Plazma - Add option to allow any usernames
|
||||
Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
|
||||
// Paper start - validate usernames
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 44df2c0a1ed3d006b455ba2a47d6bc9059d804e1..00c95194788d56f539d1c75e9a1ce48e950c096c 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -39,6 +39,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Player player;
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
+ public boolean allowAnyUsername = false;
|
||||
+
|
||||
}
|
||||
|
||||
public ConsoleLogs consoleLogs;
|
||||
@@ -3,149 +3,198 @@ 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
|
||||
[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 5f223856b06e901b100fcca8e6dd968e0b2e3a8e..13df89e7cc219cdb80c4114d05148c685ad2ecee 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -72,7 +72,7 @@ public class PufferfishConfig {
|
||||
getString("info.version", "1.0");
|
||||
setComment("info",
|
||||
"Pufferfish Configuration",
|
||||
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
|
||||
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - no advertisement
|
||||
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
|
||||
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
|
||||
|
||||
@@ -219,7 +219,7 @@ public class PufferfishConfig {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int 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.doOptimize() ? 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.doOptimize()); // 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.doOptimize() ? 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.",
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index c69892a5f31895b85e530beadd8864ac32470ba7..5f652268dadaca96a98203ad12d7a0ba0b19563b 100644
|
||||
index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206567e012f 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -154,7 +154,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -147,7 +147,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.doOptimize() ? 180000 : 10000; // Plazma - Optimize default configurations
|
||||
+ public int earlyWarningDelay = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 180000 : 10000; // Plazma - Optimize default configurations
|
||||
}
|
||||
|
||||
public SpamLimiter spamLimiter;
|
||||
@@ -189,7 +189,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;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public BookSize bookSize;
|
||||
|
||||
public class BookSize extends ConfigurationPart {
|
||||
- public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(2560)); // TODO this appears to be a duplicate setting with one above
|
||||
+ public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(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;
|
||||
@@ -266,7 +266,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) {
|
||||
@@ -334,7 +342,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 ec5e23136423e42e4f55e6ea646b8285c1ca14e2..a1d22ad65fc751fa93384f59853434ab65836133 100644
|
||||
index 1d18cad6c32815854ff8dace256b59022200c842..2de2d307ecd298c5205f40c0a4cc4d56c2495f62 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -88,15 +88,27 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -100,12 +100,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.doOptimize() ? EngineMode.OBFUSCATE_LAYER : EngineMode.HIDE; // Plazma - Optimize default configurations
|
||||
+ 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 = false;
|
||||
+ public boolean lavaObscures = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
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>
|
||||
- public List<Block> hiddenBlocks = List.of(
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ public List<String> hiddenBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ?
|
||||
+ List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "iron_ore",
|
||||
+ "deepslate_iron_ore", "raw_iron_block", "gold_ore", "deepslate_gold_ore", "raw_gold_block",
|
||||
+ "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore", "diamond_ore",
|
||||
+ "deepslate_diamond_ore") :
|
||||
+ List.of("copper_ore", "deepslate_copper_ore","gold_ore", "deepslate_gold_ore",
|
||||
+ "iron_ore", "deepslate_iron_ore", "coal_ore", "deepslate_coal_ore", "lapis_ore",
|
||||
+ "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore",
|
||||
+ "deepslate_diamond_ore", "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore",
|
||||
+ "deepslate_emerald_ore", "ender_chest");; // TODO update type to List<Block>
|
||||
+ public List<String> replacementBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ?
|
||||
+ List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore",
|
||||
+ "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "granite", "gravel",
|
||||
+ "oak_planks", "smooth_basalt", "stone", "tuff") : List.of("stone", "oak_planks", "deepslate"); // TODO update type to List<Block>
|
||||
+ 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,
|
||||
@@ -132,7 +152,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +162,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.doOptimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
|
||||
@@ -154,14 +195,14 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public ArmorStands armorStands;
|
||||
|
||||
@ConfigSerializable
|
||||
public record DespawnRange(@Required int soft, @Required int hard) {
|
||||
@@ -375,7 +387,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class ArmorStands extends ConfigurationPart {
|
||||
- public boolean doCollisionEntityLookups = true;
|
||||
- public boolean tick = true;
|
||||
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
|
||||
+ public boolean tick = !org.plazmamc.plazma.Options.AGGRESSIVE; // 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;
|
||||
@@ -406,7 +447,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.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ public boolean optimizeExplosions = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -427,7 +439,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -462,7 +503,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public Fixes fixes;
|
||||
|
||||
public class Fixes extends ConfigurationPart {
|
||||
- public boolean fixItemsMergingThroughWalls = false;
|
||||
+ public boolean fixItemsMergingThroughWalls = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ public boolean fixItemsMergingThroughWalls = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
|
||||
public boolean disableUnloadedChunkEnderpearlExploit = true;
|
||||
public boolean preventTntFromMovingInWater = false;
|
||||
public boolean splitOverstackedLoot = true;
|
||||
@@ -455,9 +467,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -490,9 +531,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.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ 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.doOptimize() ? 2 : 8; // Plazma - Optimize default configurations
|
||||
+ public int maxEntityCollisions = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 2 : 8; // Plazma - Optimize default configurations
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -465,18 +477,40 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -500,18 +541,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.doOptimize() ? 8 : 24; // Plazma - Optimize default configurations
|
||||
+ 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.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ 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.defaultReturnValue(-1);
|
||||
- map.put(EntityType.EXPERIENCE_ORB, -1);
|
||||
- map.put(EntityType.SNOWBALL, -1);
|
||||
- map.put(EntityType.ENDER_PEARL, -1);
|
||||
@@ -153,7 +202,7 @@ index ec5e23136423e42e4f55e6ea646b8285c1ca14e2..a1d22ad65fc751fa93384f59853434ab
|
||||
- map.put(EntityType.FIREBALL, -1);
|
||||
- map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()) {
|
||||
+ 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);
|
||||
@@ -184,185 +233,193 @@ index ec5e23136423e42e4f55e6ea646b8285c1ca14e2..a1d22ad65fc751fa93384f59853434ab
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -491,9 +525,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -526,9 +590,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.doOptimize() ? 4 : 1; // Plazma - Optimize default configurations
|
||||
+ 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.doOptimize() ? 2 : 1; // Plazma - Optimize default configurations
|
||||
+ 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));
|
||||
public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
|
||||
}
|
||||
@@ -517,9 +551,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -562,9 +626,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.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
|
||||
public boolean showSignClickCommandFailureMsgsToPlayer = false;
|
||||
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
|
||||
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
|
||||
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
|
||||
public AlternateCurrentUpdateOrder alternateCurrentUpdateOrder = AlternateCurrentUpdateOrder.HORIZONTAL_FIRST_OUTWARD;
|
||||
public boolean disableEndCredits = false;
|
||||
public float maxLeashDistance = 10f;
|
||||
public boolean disableSprintInterruptionOnAttack = false;
|
||||
public DoubleOr.Default maxLeashDistance = DoubleOr.Default.USE_DEFAULT;
|
||||
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..ba7cf430cdff947a74ae067fc79020ae01e7e457 100644
|
||||
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.doOptimize()) return 100; // Plazma - Optimize default configurations
|
||||
+ 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 30fc258faa6f087cf3c91411b48116a3ac416031..a32a1787cbcacb0d3ed6f0d751a04e8fa9d11dd6 100644
|
||||
index e9ba8ad80a66b8b0c99d214709222310758fcc65..3066d9a2f6b2fe677181d6a0204140a30aedfe6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -163,7 +163,7 @@ public class Main {
|
||||
@@ -164,7 +164,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.doOptimize() ? "configurations/bukkit_optimized.yml" : "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");
|
||||
@@ -177,8 +177,7 @@ public class Main {
|
||||
}
|
||||
|
||||
// Spigot Start
|
||||
- boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
|
||||
- eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev");
|
||||
+ boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" ) || Boolean.getBoolean("Paper.isRunDev"); // Plazma
|
||||
if ( eulaAgreed )
|
||||
{
|
||||
System.err.println( "You have used the Spigot command line EULA agreement flag." );
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index cda4544ae96a4fcb5c6c4483df67a59f1b53fd27..54f2c5187322c6dea70c4e0e63cce2e68e7ac647 100644
|
||||
index 9dce68d9d3f5dc0bb3cc7c11859d3082b73347cb..2182361a13e8f7fb12a4d65de6bca15cf9537701 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -130,15 +130,15 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.allowNether = this.get("allow-nether", true);
|
||||
@@ -132,14 +132,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.enableCommandBlock = this.get("enable-command-block", false);
|
||||
- this.spawnProtection = this.get("spawn-protection", 16);
|
||||
+ this.enableCommandBlock = this.get("enable-command-block", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize()); // Plazma - Optimize default configurations
|
||||
+ this.spawnProtection = this.get("spawn-protection", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 0 : 16); // Plazma - Optimize default configurations
|
||||
+ 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", 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.doOptimize() ? 7 : 10); // Plazma - Optimize default configurations
|
||||
+ this.simulationDistance = this.get("simulation-distance", org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 10); // Plazma - Optimize default configurations
|
||||
+ 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);
|
||||
@@ -146,7 +146,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -147,7 +147,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 = this.get("sync-chunk-writes", Boolean.getBoolean("Paper.enable-sync-chunk-writes")); // Paper - hide behind flag // Plazma - Optimize default configurations
|
||||
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag
|
||||
+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag // Plazma - Completely remove this setting
|
||||
this.regionFileComression = this.get("region-file-compression", "deflate");
|
||||
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 3e8f42811e9254567f2522e68b6018704bd63ae2..f8805e11551fddfda44aa36ba4e83f3df2f87500 100644
|
||||
index 66e2dff21c1aedd7de707077b7cb420e82127f91..6374f17ea3d3c94b8937dd7dced1150f9a0b5def 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -431,7 +431,7 @@ public final class CraftServer implements Server {
|
||||
@@ -437,7 +437,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(org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
|
||||
- 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 b891735728e14c40c67e21897b5043efc7077b7f..1bb779d7c87dcd1a9c819b08e509f62df0559559 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/Options.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -8,5 +8,6 @@ public interface Options {
|
||||
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
|
||||
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
boolean DEVELOPMENT = getBoolean("Plazma.DevelopmentEnvironment");
|
||||
+ boolean AGGRESSIVE = getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||
index 39db772735d57e12bbb26a6505ca7a5e360cdd78..eabd643bf096786285ee21e898b2bf8460cd5a26 100644
|
||||
index 09053b4ccf268fd204c81dbb8d4f10fa9edcad5f..93f67f125b3674e645cfdae27e579e12d31a236e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
|
||||
@@ -302,7 +302,7 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Le
|
||||
}
|
||||
}
|
||||
|
||||
- public static boolean optimizeConfig() {
|
||||
+ public static boolean doOptimize() {
|
||||
return OPTIMIZE_CONFIG;
|
||||
}
|
||||
@@ -35,6 +35,15 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Wo
|
||||
static final String WORLD_CONFIG_FILE_NAME = "plazma-world.yml";
|
||||
static final boolean OPTIMIZE = !Options.NO_OPTIMIZE;
|
||||
|
||||
+ static {
|
||||
+ if (Options.AGGRESSIVE) {
|
||||
+ LOGGER.warn("Aggressive configuration optimization is enabled. It can greatly affect gameplay.");
|
||||
+ } else if (OPTIMIZE) {
|
||||
+ LOGGER.warn("Default configuration optimization is enabled. It may have some impact on gameplay.");
|
||||
+ LOGGER.warn("To disable default configuration optimization, type \"-DPlazma.disableConfigOptimization\" before the -jar in the server startup command.");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
private static final String HEADER_START = """
|
||||
#### ENGLISH ####
|
||||
This is the %s configuration file for Plazma.
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index d0d31002562e728fa1a6c9bc81baa4534f11d365..5f0b10932f8dda09131ba68207cbfea4715e0f33 100644
|
||||
index 95cd1156766895546ef5574b33a60806bff08fa2..097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc 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 {
|
||||
@@ -244,7 +244,7 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
- public static boolean useAlternateKeepAlive = false;
|
||||
+ public static boolean useAlternateKeepAlive = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ 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);
|
||||
}
|
||||
@@ -491,7 +491,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 d4d9f748d259df8b6f4566efa21c15c470de5ba2..d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde 100644
|
||||
index 742a46ef95a5e46e9c338cedcecaf008a7108c58..2198477c174f89fdaece5ffef8b40c8096a9c9a9 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -423,7 +423,7 @@ public class PurpurWorldConfig {
|
||||
@@ -422,7 +422,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.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ 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;
|
||||
@@ -3066,7 +3066,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3243,7 +3243,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.doOptimize(); // Plazma - Optimize default configurations
|
||||
+ 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 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8f6f528e6 100644
|
||||
index 2c408fa4abcbe1171c58aee8799c8cf7867d0f0a..aadad0a1e3c7e20b0ab97095ee6e6fb7dbfbd234 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.doOptimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations
|
||||
- this.itemMerge = this.getDouble("merge-radius.item", 0.5 );
|
||||
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 0.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.doOptimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations
|
||||
- this.expMerge = this.getDouble("merge-radius.exp", -1 );
|
||||
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : -1); // Plazma - Optimize default configurations
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -371,65 +428,76 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
|
||||
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.doOptimize() ? 3 : 8 ); // Paper - Vanilla // Plazma - Optimize default configurations
|
||||
+ 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
|
||||
@@ -207,27 +207,29 @@ 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.doOptimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 24 : 32; // Plazma - Optimize default configurations
|
||||
public int raiderActivationRange = 48;
|
||||
- public int raiderActivationRange = 64;
|
||||
- public int miscActivationRange = 16;
|
||||
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||
// Paper start
|
||||
- // Paper start
|
||||
- public int flyingMonsterActivationRange = 32;
|
||||
- public int waterActivationRange = 16;
|
||||
- public int villagerActivationRange = 32;
|
||||
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 48 : 32; // Plazma - Optimize default configurations
|
||||
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 16; // Plazma - Optimize default configurations
|
||||
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 16 : 32; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveAnimals = 4;
|
||||
public int wakeUpInactiveAnimalsEvery = 60*20;
|
||||
- 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.doOptimize() ? 40 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 8; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveMonstersEvery = 20*20;
|
||||
- public int wakeUpInactiveMonstersEvery = 20*20;
|
||||
- public int wakeUpInactiveMonstersFor = 5*20;
|
||||
- public int wakeUpInactiveVillagers = 4;
|
||||
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 4; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveVillagersEvery = 30*20;
|
||||
- public int wakeUpInactiveVillagersEvery = 30*20;
|
||||
- public int wakeUpInactiveVillagersFor = 5*20;
|
||||
- public int wakeUpInactiveFlying = 8;
|
||||
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 20 : 100; // Plazma - Optimize default configurations
|
||||
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 8; // Plazma - Optimize default configurations
|
||||
public int wakeUpInactiveFlyingEvery = 10*20;
|
||||
- public int wakeUpInactiveFlyingEvery = 10*20;
|
||||
- public int wakeUpInactiveFlyingFor = 5*20;
|
||||
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
|
||||
public int villagersWorkImmunityAfter = 5*20;
|
||||
- public int villagersWorkImmunityAfter = 5*20;
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
|
||||
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32;
|
||||
+ public int raiderActivationRange = 64; // diff on changes
|
||||
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
|
||||
+ // Paper start // diff on changes
|
||||
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32;
|
||||
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
|
||||
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
|
||||
+ public int wakeUpInactiveAnimals = 4; // diff on changes
|
||||
+ public int wakeUpInactiveAnimalsEvery = 1200;
|
||||
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100;
|
||||
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8;
|
||||
+ public int wakeUpInactiveMonstersEvery = 400;
|
||||
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
|
||||
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4;
|
||||
+ public int wakeUpInactiveVillagersEvery = 600;
|
||||
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100;
|
||||
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8;
|
||||
+ public int wakeUpInactiveFlyingEvery = 200;
|
||||
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
|
||||
+ public int villagersWorkImmunityAfter = 100;
|
||||
+ // Plazma end - Optimize default configurations
|
||||
public int villagersWorkImmunityFor = 20;
|
||||
public boolean villagersActiveForPanic = true;
|
||||
@@ -299,7 +299,7 @@ public class SpigotWorldConfig
|
||||
// Paper end
|
||||
@@ -299,7 +301,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.doOptimize() ? 8: 1 ); // Plazma - Optimize default configurations
|
||||
+ 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
|
||||
@@ -309,7 +311,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.doOptimize() ? 300 : 1200 ); // Plazma - Optimize default configurations
|
||||
+ 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 );
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 15 May 2024 16:13:17 +0900
|
||||
Subject: [PATCH] Add an option to apply the configuration to the vanilla
|
||||
default
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 3b636760f32b9b5b277edb15782d6206567e012f..6d0f1448a1546cdaf81335b47e3bc9e361095545 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -87,7 +87,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Component flyingVehicle = Component.translatable("multiplayer.disconnect.flying");
|
||||
}
|
||||
|
||||
- public Component noPermission = Component.text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", NamedTextColor.RED);
|
||||
+ public Component noPermission = org.plazmamc.plazma.Options.VANILLAIZE ? Component.translatable("command.unknown.command") : Component.text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", NamedTextColor.RED);
|
||||
public boolean useDisplayNameInQuitMessage = false;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6374f17ea3d3c94b8937dd7dced1150f9a0b5def..2b3c8de6671d7af92d91a12960b58369cd191ca8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -437,7 +437,19 @@ 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(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
|
||||
+ // Plazma start - Add an option to apply the configuration to the vanilla default
|
||||
+ String configPath;
|
||||
+ if (org.plazmamc.plazma.Options.NO_OPTIMIZE) {
|
||||
+ if (org.plazmamc.plazma.Options.VANILLAIZE) configPath = "configurations/bukkit_vanillaized.yml";
|
||||
+ else configPath = "configurations/bukkit.yml";
|
||||
+ } else {
|
||||
+ if (org.plazmamc.plazma.Options.VANILLAIZE) configPath = "configurations/bukkit_optimized_vanillaized.yml";
|
||||
+ else configPath = "configurations/bukkit_optimized.yml";
|
||||
+ }
|
||||
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(
|
||||
+ new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(configPath), Charsets.UTF_8)
|
||||
+ )); // Plazma - Optimize default configurations
|
||||
+ // Plazma end - Add an option to apply the configuration to the vanilla default
|
||||
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 1bb779d7c87dcd1a9c819b08e509f62df0559559..a8711b8a66b443d40cad8dfec31cca357e0877b4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/Options.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Options.java
|
||||
@@ -9,5 +9,7 @@ public interface Options {
|
||||
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
|
||||
boolean DEVELOPMENT = getBoolean("Plazma.DevelopmentEnvironment");
|
||||
boolean AGGRESSIVE = getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
|
||||
+ boolean VANILLAIZE = getBoolean("Plazma.vanillaize") && !AGGRESSIVE;
|
||||
+ boolean USE_VANILLA = getBoolean("Plazma.useVanillaConfiguration") && !AGGRESSIVE && NO_OPTIMIZE;
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 4dbb109d0526afee99b9190fc256585121aac9b5..3835a7aa3e3c60a6f50f1d6e781f280ea8a83fb3 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -193,8 +193,8 @@ public class SpigotConfig
|
||||
public static String whitelistMessage;
|
||||
public static String unknownCommandMessage;
|
||||
public static String serverFullMessage;
|
||||
- public static String outdatedClientMessage = "Outdated client! Please use {0}";
|
||||
- public static String outdatedServerMessage = "Outdated server! I\'m still on {0}";
|
||||
+ public static String outdatedClientMessage = org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.outdated_client>" : "Outdated client! Please use {0}";
|
||||
+ public static String outdatedServerMessage = org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.outdated_server>" : "Outdated server! I'm still on {0}";
|
||||
private static String transform(String s)
|
||||
{
|
||||
return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\\\n", "\n" );
|
||||
@@ -207,9 +207,9 @@ public class SpigotConfig
|
||||
SpigotConfig.set( "messages.outdated-server", SpigotConfig.outdatedServerMessage );
|
||||
}
|
||||
|
||||
- SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", "You are not whitelisted on this server!" ) );
|
||||
- SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", "Unknown command. Type \"/help\" for help." ) );
|
||||
- SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", "The server is full!" ) );
|
||||
+ SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.not_whitelisted>" : "You are not whitelisted on this server!" ) ); // Plazma - Add an option to apply the configuration to the vanilla default
|
||||
+ SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:command.unknown.command>" : "Unknown command. Type \"/help\" for help." ) );
|
||||
+ SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.server_full>" : "The server is full!" ) );
|
||||
SpigotConfig.outdatedClientMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-client", SpigotConfig.outdatedClientMessage ) );
|
||||
SpigotConfig.outdatedServerMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-server", SpigotConfig.outdatedServerMessage ) );
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class SpigotConfig
|
||||
SpigotConfig.timeoutTime = SpigotConfig.getInt( "settings.timeout-time", SpigotConfig.timeoutTime );
|
||||
SpigotConfig.restartOnCrash = SpigotConfig.getBoolean( "settings.restart-on-crash", SpigotConfig.restartOnCrash );
|
||||
SpigotConfig.restartScript = SpigotConfig.getString( "settings.restart-script", SpigotConfig.restartScript );
|
||||
- SpigotConfig.restartMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.restart", "Server is restarting" ) );
|
||||
+ SpigotConfig.restartMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.restart", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:disconnect.quitting>" : "Server is restarting" ) );
|
||||
SpigotConfig.commands.put( "restart", new RestartCommand( "restart" ) );
|
||||
// WatchdogThread.doStart( SpigotConfig.timeoutTime, SpigotConfig.restartOnCrash ); // Paper - moved to after paper config initialization
|
||||
}
|
||||
diff --git a/src/main/resources/configurations/bukkit_optimized_vanillaized.yml b/src/main/resources/configurations/bukkit_optimized_vanillaized.yml
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b7ed456b0172caebdf5b548052ff2ae688377020
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/configurations/bukkit_optimized_vanillaized.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: <lang:multiplayer.disconnect.server_shutdown>
|
||||
+ 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
|
||||
diff --git a/src/main/resources/configurations/bukkit_vanillaized.yml b/src/main/resources/configurations/bukkit_vanillaized.yml
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..22fe392b9970bb82db293d638b0dd5727bd60e5a
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/configurations/bukkit_vanillaized.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: <lang:multiplayer.disconnect.server_shutdown>
|
||||
+ minimum-api: none
|
||||
+ use-map-color-cache: true
|
||||
+spawn-limits:
|
||||
+ monsters: 70
|
||||
+ animals: 10
|
||||
+ water-animals: 5
|
||||
+ water-ambient: 20
|
||||
+ water-underground-creature: 5
|
||||
+ axolotls: 5
|
||||
+ ambient: 15
|
||||
+chunk-gc:
|
||||
+ period-in-ticks: 600
|
||||
+ticks-per:
|
||||
+ animal-spawns: 400
|
||||
+ monster-spawns: 1
|
||||
+ water-spawns: 1
|
||||
+ water-ambient-spawns: 1
|
||||
+ water-underground-creature-spawns: 1
|
||||
+ axolotl-spawns: 1
|
||||
+ ambient-spawns: 1
|
||||
+ autosave: 6000
|
||||
+aliases: now-in-commands.yml
|
||||
@@ -1,944 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 17:52:52 +0900
|
||||
Subject: [PATCH] Completely remove Mojang Profiler
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 11de2f237e6dd950b8ddba3d5cfe9066d09f0903..44248dc470d0882b7287debd1993cedf0f238aca 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -113,16 +113,16 @@ import net.minecraft.util.Unit;
|
||||
import net.minecraft.util.datafix.DataFixers;
|
||||
import net.minecraft.util.profiling.EmptyProfileResults;
|
||||
import net.minecraft.util.profiling.ProfileResults;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.profiling.ResultField;
|
||||
-import net.minecraft.util.profiling.SingleTickProfiler;
|
||||
+//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||
import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
|
||||
-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder;
|
||||
-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder;
|
||||
-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder;
|
||||
-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider;
|
||||
-import net.minecraft.util.profiling.metrics.storage.MetricsPersister;
|
||||
+//import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Completely remove profiler
|
||||
+//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove profiler
|
||||
+//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove profiler
|
||||
+//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove profiler
|
||||
+//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
||||
import net.minecraft.world.Difficulty;
|
||||
import net.minecraft.world.RandomSequences;
|
||||
@@ -214,11 +214,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public LevelStorageSource.LevelStorageAccess storageSource;
|
||||
public final PlayerDataStorage playerDataStorage;
|
||||
private final List<Runnable> tickables = Lists.newArrayList();
|
||||
- private MetricsRecorder metricsRecorder;
|
||||
- private ProfilerFiller profiler;
|
||||
- private Consumer<ProfileResults> onMetricsRecordingStopped;
|
||||
- private Consumer<Path> onMetricsRecordingFinished;
|
||||
- private boolean willStartRecordingMetrics;
|
||||
+ //private MetricsRecorder metricsRecorder; // Plazma - Completely remove profiler
|
||||
+ //private ProfilerFiller profiler; // Plazma - Completely remove profiler
|
||||
+ //private Consumer<ProfileResults> onMetricsRecordingStopped; // Plazma - Completely remove profiler
|
||||
+ //private Consumer<Path> onMetricsRecordingFinished; // Plazma - Completely remove profiler
|
||||
+ //private boolean willStartRecordingMetrics; // Plazma - Completely remove profiler
|
||||
@Nullable
|
||||
private MinecraftServer.TimeProfiler debugCommandProfiler;
|
||||
private boolean debugCommandProfilerDelayStart;
|
||||
@@ -2309,10 +2309,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
|
||||
+ /* // Plazma - Completely remove profiler
|
||||
public ProfilerFiller getProfiler() {
|
||||
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Purpur
|
||||
return this.profiler;
|
||||
}
|
||||
+ */ // Plazma - Completely remove profiler
|
||||
|
||||
public abstract boolean isSingleplayerOwner(GameProfile profile);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
index ebcd2bbcf8f25c52de3deaff32a8522dbf662141..0ff246c5f7c6f02c12a55b1d9c7b35ad3fd4c1c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.level.storage.loot.LootDataManager;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
||||
this.lootData = conditionManager;
|
||||
}
|
||||
|
||||
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
||||
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
||||
Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
|
||||
|
||||
prepared.forEach((minecraftkey, jsonelement) -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||
index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..6783dc11a321c244296e84223c51cd1a489a9b96 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||
import net.minecraft.server.packs.resources.Resource;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.tags.TagLoader;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@@ -62,7 +62,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||
CompletableFuture<Map<ResourceLocation, List<TagLoader.EntryWithSource>>> completableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
return this.tagsLoader.load(manager);
|
||||
}, prepareExecutor);
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||
index 097ac55028d66ef9ab430ff5dd103db6e3b99fc7..2993e9f326c43ef3f06d5e332899f9fad1f03718 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||
@@ -19,7 +19,7 @@ import net.minecraft.commands.FunctionInstantiationException;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.level.GameRules;
|
||||
|
||||
public class ServerFunctionManager {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 3f4df62773dfe1045914325ce5bc13162192679c..0f27bdc25dc5246d98358a26e1d01e17bc779c2d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||
import net.minecraft.server.network.ServerPlayerConnection;
|
||||
import net.minecraft.util.CsvOutput;
|
||||
import net.minecraft.util.Mth;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.thread.BlockableEventLoop;
|
||||
import net.minecraft.util.thread.ProcessorHandle;
|
||||
import net.minecraft.util.thread.ProcessorMailbox;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 6255960ae70e14eb11da5043eb003575e300ddf6..999f57366cad34f92a1f80437bf7bd84b40c0e6b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.core.SectionPos;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||
import net.minecraft.util.VisibleForDebug;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.thread.BlockableEventLoop;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index e7efdd572716e50ecca217898b8a368e5829f925..72c2af8638d71b92a9762dedb0efec53ce8094f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -77,7 +77,7 @@ import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.ProgressListener;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.util.Unit;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.valueproviders.IntProvider;
|
||||
import net.minecraft.util.valueproviders.UniformInt;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
@@ -694,15 +694,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||
|
||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma
|
||||
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type()/*, minecraftserver::getProfiler*/, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
||||
this.pvpMode = minecraftserver.isPvpAllowed();
|
||||
this.convertable = convertable_conversionsession;
|
||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||
// CraftBukkit end
|
||||
this.players = Lists.newArrayList();
|
||||
this.entityTickList = new EntityTickList();
|
||||
- this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||
- this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||
+ this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||
+ this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||
this.navigatingMobs = new ObjectOpenHashSet();
|
||||
this.blockEvents = new ObjectLinkedOpenHashSet();
|
||||
this.blockEventsToReschedule = new ArrayList(64);
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||
index 828196decc89e7e03f88c4a3208ee1ab2bb69242..c0088e0e566abb928c8dcd6f819d82cc1122589b 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
||||
@@ -2,10 +2,10 @@ package net.minecraft.server.packs.resources;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
|
||||
public interface PreparableReloadListener {
|
||||
- CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor);
|
||||
+ CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor); // Plazma - Completely remove profiler
|
||||
|
||||
default String getName() {
|
||||
return this.getClass().getSimpleName();
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||
index 7383c7d3820dce06108eaafd236a7c6c06a10a42..4e1f4e026cd7c566468a58b2ea232d5dee80b86f 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
||||
@@ -3,11 +3,11 @@ package net.minecraft.server.packs.resources;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import net.minecraft.util.Unit;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
|
||||
public interface ResourceManagerReloadListener extends PreparableReloadListener {
|
||||
@Override
|
||||
- default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||
+ default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
|
||||
//applyProfiler.startTick(); // Purpur
|
||||
//applyProfiler.push("listener"); // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||
index 9cc09f0415a09299102dbcf022326944368ea033..2e9e63f3ee6268cafa3b90666cf31019e7341dbb 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
||||
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
import net.minecraft.resources.FileToIdConverter;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener<Map<ResourceLocation, JsonElement>> {
|
||||
@@ -25,7 +25,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparableR
|
||||
}
|
||||
|
||||
@Override
|
||||
- protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) {
|
||||
+ protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager/*, ProfilerFiller profilerFiller*/) { // Plazma - Completely remove Profiler
|
||||
Map<ResourceLocation, JsonElement> map = new HashMap<>();
|
||||
scanDirectory(resourceManager, this.directory, this.gson, map);
|
||||
return map;
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..7de117e0464a24da632d134870554fd11e1b87ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
||||
@@ -2,19 +2,19 @@ package net.minecraft.server.packs.resources;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
|
||||
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
|
||||
@Override
|
||||
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
- return this.prepare(manager, prepareProfiler);
|
||||
+ return this.prepare(manager/*, prepareProfiler*/); // Plazma - Completely remove profiler
|
||||
}, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> {
|
||||
- this.apply(prepared, manager, applyProfiler);
|
||||
+ this.apply(prepared, manager/*, applyProfiler*/); // Plazma - Completely remove profiler
|
||||
}, applyExecutor);
|
||||
}
|
||||
|
||||
- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler);
|
||||
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
|
||||
|
||||
- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler);
|
||||
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||
index de2ecc7c69fb870f843f60596115866214267ee4..05a731dec4aec1d3cf61a761bda018cc8c46afde 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
||||
@@ -26,7 +26,7 @@ public class SimpleReloadInstance<S> implements ReloadInstance {
|
||||
|
||||
public static SimpleReloadInstance<Void> of(ResourceManager manager, List<PreparableReloadListener> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) {
|
||||
return new SimpleReloadInstance<>(prepareExecutor, applyExecutor, manager, reloaders, (synchronizer, resourceManager, reloader, prepare, apply) -> {
|
||||
- return reloader.reload(synchronizer, resourceManager, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, prepareExecutor, apply);
|
||||
+ return reloader.reload(synchronizer, resourceManager/*, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE*/, prepareExecutor, apply); // Plazma - Completely remove Profiler
|
||||
}, initialStage);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/tags/TagManager.java b/src/main/java/net/minecraft/tags/TagManager.java
|
||||
index 60ed9413c32d91ce33583cc24998d08869d07a23..67c0d8f7294e18c7b2107b82219bc106608a21f0 100644
|
||||
--- a/src/main/java/net/minecraft/tags/TagManager.java
|
||||
+++ b/src/main/java/net/minecraft/tags/TagManager.java
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
|
||||
public class TagManager implements PreparableReloadListener {
|
||||
private static final Map<ResourceKey<? extends Registry<?>>, String> CUSTOM_REGISTRY_DIRECTORIES = Map.of(Registries.BLOCK, "tags/blocks", Registries.ENTITY_TYPE, "tags/entity_types", Registries.FLUID, "tags/fluids", Registries.GAME_EVENT, "tags/game_events", Registries.ITEM, "tags/items");
|
||||
@@ -35,7 +35,7 @@ public class TagManager implements PreparableReloadListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||
List<? extends CompletableFuture<? extends TagManager.LoadResult<?>>> list = this.registryAccess.registries().map((registry) -> {
|
||||
return this.createLoader(manager, prepareExecutor, registry);
|
||||
}).toList();
|
||||
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||
deleted file mode 100644
|
||||
index c6c30d99399c5cde2b0ec2f320d81d952b422d78..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||
+++ /dev/null
|
||||
@@ -1,208 +0,0 @@
|
||||
-package net.minecraft.util.profiling;
|
||||
-
|
||||
-import com.google.common.collect.Lists;
|
||||
-import com.google.common.collect.Maps;
|
||||
-import com.mojang.logging.LogUtils;
|
||||
-import it.unimi.dsi.fastutil.longs.LongArrayList;
|
||||
-import it.unimi.dsi.fastutil.longs.LongList;
|
||||
-import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||
-import it.unimi.dsi.fastutil.objects.Object2LongMaps;
|
||||
-import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||
-import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||
-import java.time.Duration;
|
||||
-import java.util.List;
|
||||
-import java.util.Map;
|
||||
-import java.util.Set;
|
||||
-import java.util.function.IntSupplier;
|
||||
-import java.util.function.LongSupplier;
|
||||
-import java.util.function.Supplier;
|
||||
-import javax.annotation.Nullable;
|
||||
-import net.minecraft.Util;
|
||||
-import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||
-import org.apache.commons.lang3.tuple.Pair;
|
||||
-import org.slf4j.Logger;
|
||||
-
|
||||
-public class ActiveProfiler implements ProfileCollector {
|
||||
- private static final long WARNING_TIME_NANOS = Duration.ofMillis(100L).toNanos();
|
||||
- private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- private final List<String> paths = Lists.newArrayList();
|
||||
- private final LongList startTimes = new LongArrayList();
|
||||
- private final Map<String, ActiveProfiler.PathEntry> entries = Maps.newHashMap();
|
||||
- private final IntSupplier getTickTime;
|
||||
- private final LongSupplier getRealTime;
|
||||
- private final long startTimeNano;
|
||||
- private final int startTimeTicks;
|
||||
- private String path = "";
|
||||
- private boolean started;
|
||||
- @Nullable
|
||||
- private ActiveProfiler.PathEntry currentEntry;
|
||||
- private final boolean warn;
|
||||
- private final Set<Pair<String, MetricCategory>> chartedPaths = new ObjectArraySet<>();
|
||||
-
|
||||
- public ActiveProfiler(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout) {
|
||||
- this.startTimeNano = timeGetter.getAsLong();
|
||||
- this.getRealTime = timeGetter;
|
||||
- this.startTimeTicks = tickGetter.getAsInt();
|
||||
- this.getTickTime = tickGetter;
|
||||
- this.warn = checkTimeout;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void startTick() {
|
||||
- if (this.started) {
|
||||
- LOGGER.error("Profiler tick already started - missing endTick()?");
|
||||
- } else {
|
||||
- this.started = true;
|
||||
- this.path = "";
|
||||
- this.paths.clear();
|
||||
- //this.push("root"); // Purpur
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void endTick() {
|
||||
- if (!this.started) {
|
||||
- LOGGER.error("Profiler tick already ended - missing startTick()?");
|
||||
- } else {
|
||||
- //this.pop(); // Purpur
|
||||
- this.started = false;
|
||||
- if (!this.path.isEmpty()) {
|
||||
- LOGGER.error("Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", LogUtils.defer(() -> {
|
||||
- return ProfileResults.demanglePath(this.path);
|
||||
- }));
|
||||
- }
|
||||
-
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(String location) {
|
||||
- if (!this.started) {
|
||||
- LOGGER.error("Cannot push '{}' to profiler if profiler tick hasn't started - missing startTick()?", (Object)location);
|
||||
- } else {
|
||||
- if (!this.path.isEmpty()) {
|
||||
- this.path = this.path + "\u001e";
|
||||
- }
|
||||
-
|
||||
- this.path = this.path + location;
|
||||
- this.paths.add(this.path);
|
||||
- this.startTimes.add(Util.getNanos());
|
||||
- this.currentEntry = null;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(Supplier<String> locationGetter) {
|
||||
- //this.push(locationGetter.get()); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void markForCharting(MetricCategory type) {
|
||||
- this.chartedPaths.add(Pair.of(this.path, type));
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void pop() {
|
||||
- if (!this.started) {
|
||||
- LOGGER.error("Cannot pop from profiler if profiler tick hasn't started - missing startTick()?");
|
||||
- } else if (this.startTimes.isEmpty()) {
|
||||
- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?");
|
||||
- } else {
|
||||
- long l = Util.getNanos();
|
||||
- long m = this.startTimes.removeLong(this.startTimes.size() - 1);
|
||||
- this.paths.remove(this.paths.size() - 1);
|
||||
- long n = l - m;
|
||||
- ActiveProfiler.PathEntry pathEntry = this.getCurrentEntry();
|
||||
- pathEntry.accumulatedDuration += n;
|
||||
- ++pathEntry.count;
|
||||
- pathEntry.maxDuration = Math.max(pathEntry.maxDuration, n);
|
||||
- pathEntry.minDuration = Math.min(pathEntry.minDuration, n);
|
||||
- if (this.warn && n > WARNING_TIME_NANOS) {
|
||||
- LOGGER.warn("Something's taking too long! '{}' took aprox {} ms", LogUtils.defer(() -> {
|
||||
- return ProfileResults.demanglePath(this.path);
|
||||
- }), LogUtils.defer(() -> {
|
||||
- return (double)n / 1000000.0D;
|
||||
- }));
|
||||
- }
|
||||
-
|
||||
- this.path = this.paths.isEmpty() ? "" : this.paths.get(this.paths.size() - 1);
|
||||
- this.currentEntry = null;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(String location) {
|
||||
- //this.pop(); // Purpur
|
||||
- //this.push(location); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(Supplier<String> locationGetter) {
|
||||
- //this.pop(); // Purpur
|
||||
- //this.push(locationGetter); // Purpur
|
||||
- }
|
||||
-
|
||||
- private ActiveProfiler.PathEntry getCurrentEntry() {
|
||||
- if (this.currentEntry == null) {
|
||||
- this.currentEntry = this.entries.computeIfAbsent(this.path, (k) -> {
|
||||
- return new ActiveProfiler.PathEntry();
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- return this.currentEntry;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(String marker, int num) {
|
||||
- this.getCurrentEntry().counters.addTo(marker, (long)num);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
||||
- this.getCurrentEntry().counters.addTo(markerGetter.get(), (long)num);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public ProfileResults getResults() {
|
||||
- return new FilledProfileResults(this.entries, this.startTimeNano, this.startTimeTicks, this.getRealTime.getAsLong(), this.getTickTime.getAsInt());
|
||||
- }
|
||||
-
|
||||
- @Nullable
|
||||
- @Override
|
||||
- public ActiveProfiler.PathEntry getEntry(String name) {
|
||||
- return this.entries.get(name);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public Set<Pair<String, MetricCategory>> getChartedPaths() {
|
||||
- return this.chartedPaths;
|
||||
- }
|
||||
-
|
||||
- public static class PathEntry implements ProfilerPathEntry {
|
||||
- long maxDuration = Long.MIN_VALUE;
|
||||
- long minDuration = Long.MAX_VALUE;
|
||||
- long accumulatedDuration;
|
||||
- long count;
|
||||
- final Object2LongOpenHashMap<String> counters = new Object2LongOpenHashMap<>();
|
||||
-
|
||||
- @Override
|
||||
- public long getDuration() {
|
||||
- return this.accumulatedDuration;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public long getMaxDuration() {
|
||||
- return this.maxDuration;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public long getCount() {
|
||||
- return this.count;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public Object2LongMap<String> getCounters() {
|
||||
- return Object2LongMaps.unmodifiable(this.counters);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||
deleted file mode 100644
|
||||
index 863343a87fe34d72f04af89d75268b477b2adc7a..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||
+++ /dev/null
|
||||
@@ -1,116 +0,0 @@
|
||||
-package net.minecraft.util.profiling;
|
||||
-
|
||||
-import java.util.function.Supplier;
|
||||
-import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||
-
|
||||
-public interface ProfilerFiller {
|
||||
- String ROOT = "root";
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void startTick();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void endTick();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void push(String location);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void push(Supplier<String> locationGetter);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void pop();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void popPush(String location);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void popPush(Supplier<String> locationGetter);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void markForCharting(MetricCategory type);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void incrementCounter(String marker) {
|
||||
- //this.incrementCounter(marker, 1); // Purpur
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void incrementCounter(String marker, int num);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void incrementCounter(Supplier<String> markerGetter) {
|
||||
- //this.incrementCounter(markerGetter, 1); // Purpur
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void incrementCounter(Supplier<String> markerGetter, int num);
|
||||
-
|
||||
- static ProfilerFiller tee(final ProfilerFiller a, final ProfilerFiller b) {
|
||||
- if (a == InactiveProfiler.INSTANCE) {
|
||||
- return b;
|
||||
- } else {
|
||||
- return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() {
|
||||
- @Override
|
||||
- public void startTick() {
|
||||
- //a.startTick(); // Purpur
|
||||
- //b.startTick(); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void endTick() {
|
||||
- //a.endTick(); // Purpur
|
||||
- //b.endTick(); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(String location) {
|
||||
- //a.push(location); // Purpur
|
||||
- //b.push(location); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(Supplier<String> locationGetter) {
|
||||
- //a.push(locationGetter); // Purpur
|
||||
- //b.push(locationGetter); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void markForCharting(MetricCategory type) {
|
||||
- //a.markForCharting(type); // Purpur
|
||||
- //b.markForCharting(type); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void pop() {
|
||||
- //a.pop(); // Purpur
|
||||
- //b.pop(); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(String location) {
|
||||
- //a.popPush(location); // Purpur
|
||||
- //b.popPush(location); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(Supplier<String> locationGetter) {
|
||||
- //a.popPush(locationGetter); // Purpur
|
||||
- //b.popPush(locationGetter); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(String marker, int num) {
|
||||
- //a.incrementCounter(marker, num); // Purpur
|
||||
- //b.incrementCounter(marker, num); // Purpur
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
||||
- //a.incrementCounter(markerGetter, num); // Purpur
|
||||
- //b.incrementCounter(markerGetter, num); // Purpur
|
||||
- }
|
||||
- };
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
||||
deleted file mode 100644
|
||||
index 729ebd1b2433327de243d0168289e180a841f47c..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
||||
+++ /dev/null
|
||||
@@ -1,24 +0,0 @@
|
||||
-package net.minecraft.util.profiling.metrics.profiling;
|
||||
-
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
-
|
||||
-@Deprecated(forRemoval = true)
|
||||
-public interface MetricsRecorder {
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void end();
|
||||
-
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void cancel();
|
||||
-
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void startTick();
|
||||
-
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- boolean isRecording();
|
||||
-
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- ProfilerFiller getProfiler();
|
||||
-
|
||||
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void endTick();
|
||||
-}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index d35afa8f8648bbcbfc044323bcda1b1182d7dce4..fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -147,8 +147,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.pathfindingMalus = Maps.newEnumMap(BlockPathTypes.class);
|
||||
this.restrictCenter = BlockPos.ZERO;
|
||||
this.restrictRadius = -1.0F;
|
||||
- this.goalSelector = new GoalSelector(world.getProfilerSupplier());
|
||||
- this.targetSelector = new GoalSelector(world.getProfilerSupplier());
|
||||
+ this.goalSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||
+ this.targetSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
||||
this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur
|
||||
this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur
|
||||
this.jumpControl = new JumpControl(this);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
index 02978315bc2b828cc603ce7478408f3f82c249c2..4f9b19c45afd6b26833ba892a90d3a9559d5d859 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
@@ -11,7 +11,7 @@ import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class GoalSelector {
|
||||
@@ -29,7 +29,7 @@ public class GoalSelector {
|
||||
};
|
||||
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
|
||||
private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
|
||||
- private final Supplier<ProfilerFiller> profiler;
|
||||
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
|
||||
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
|
||||
private int tickCount;
|
||||
@@ -37,9 +37,11 @@ public class GoalSelector {
|
||||
private int curRate;
|
||||
private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector
|
||||
|
||||
+ /* // Plazma - Completely remove profiler
|
||||
public GoalSelector(Supplier<ProfilerFiller> profiler) {
|
||||
this.profiler = profiler;
|
||||
}
|
||||
+ */ // Plazma - Completely remove profiler
|
||||
|
||||
public void addGoal(int priority, Goal goal) {
|
||||
this.availableGoals.add(new WrappedGoal(priority, goal));
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
index 666fc85bc2079cb367b340f2605f29fe002f4d22..36c60716c6aaa446ff7123a3babafb2edd2266ac 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -51,7 +51,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
super(RecipeManager.GSON, "recipes");
|
||||
}
|
||||
|
||||
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
||||
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Profiler
|
||||
this.hasErrors = false;
|
||||
// CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
|
||||
Map<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>> map1 = Maps.newHashMap();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e5619c08ec20 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -39,7 +39,7 @@ import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.util.AbortableIterationConsumer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.RandomSource;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.damagesource.DamageSources;
|
||||
@@ -137,7 +137,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
private final ResourceKey<DimensionType> dimensionTypeId;
|
||||
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||
public final WritableLevelData levelData;
|
||||
- private final Supplier<ProfilerFiller> profiler;
|
||||
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||
public final boolean isClientSide;
|
||||
private final WorldBorder worldBorder;
|
||||
private final BiomeManager biomeManager;
|
||||
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma
|
||||
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder/*, Supplier<ProfilerFiller> supplier*/, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||
this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma
|
||||
@@ -276,7 +276,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
// CraftBukkit end
|
||||
- this.profiler = supplier;
|
||||
+ //this.profiler = supplier; // Plazma - Completely remove profiler
|
||||
this.levelData = worlddatamutable;
|
||||
this.dimensionTypeRegistration = holder;
|
||||
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
|
||||
@@ -1830,6 +1830,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ /* // Plazma - Completely remove profiler
|
||||
public ProfilerFiller getProfiler() {
|
||||
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
|
||||
return (ProfilerFiller) this.profiler.get();
|
||||
@@ -1838,6 +1839,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public Supplier<ProfilerFiller> getProfilerSupplier() {
|
||||
return this.profiler;
|
||||
}
|
||||
+ */ // Plazma - Completely remove profiler
|
||||
|
||||
@Override
|
||||
public BiomeManager getBiomeManager() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||
index 0f1025495237aebe30132ace0832aa5718d6f9bb..0226280bbdb9d63831d93f980ee117da1eac08aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.SectionPos;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
@@ -155,7 +155,9 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
|
||||
return this.level.getHeight();
|
||||
}
|
||||
|
||||
+ /* // Plazma - Completely remove profiler
|
||||
public ProfilerFiller getProfiler() {
|
||||
return this.level.getProfiler();
|
||||
}
|
||||
+ */ // Plazma - Completely remove profiler
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 8d385708df97d47881929d4352f1b90286aad1a2..a25b93f98b2c525b146c979df2a95a9a749300a8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
|
||||
import net.minecraft.server.level.FullChunkStatus;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -445,7 +445,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
}
|
||||
|
||||
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
|
||||
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove profiler
|
||||
|
||||
//gameprofilerfiller.push("updateSkyLightSources"); // Purpur
|
||||
this.skyLightSources.update(this, j, i, l);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..b9689131a7a46b46c0b75b86f2bb163d7de74921 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
@@ -12,7 +12,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.core.BlockPos;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.level.PathNavigationRegion;
|
||||
@@ -44,7 +44,7 @@ public class PathFinder {
|
||||
map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
|
||||
}
|
||||
// Paper end
|
||||
- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier);
|
||||
+ Path path = this.findPath(/*world.getProfiler(), */node, map, followRange, distance, rangeMultiplier); // Plazma - Completely remove profiler
|
||||
this.nodeEvaluator.done();
|
||||
return path;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class PathFinder {
|
||||
|
||||
@Nullable
|
||||
// Paper start - optimize collection
|
||||
- private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
||||
+ private Path findPath(/*ProfilerFiller profiler, */Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) { // Plazma - Completely remove profiler
|
||||
//profiler.push("find_path"); // Purpur
|
||||
//profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
||||
// Set<Target> set = positions.keySet();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||
index dd375fffa727db76fa989248b9b836960974c372..45161f960a29395538c67461ebf864e595f6737f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
||||
@@ -19,7 +19,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
|
||||
public LootDataManager() {}
|
||||
|
||||
@Override
|
||||
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
||||
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
||||
Map<LootDataType<?>, Map<ResourceLocation, ?>> map = new HashMap();
|
||||
CompletableFuture<?>[] acompletablefuture = (CompletableFuture[]) LootDataType.values().map((lootdatatype) -> {
|
||||
return LootDataManager.scheduleElementParse(lootdatatype, manager, prepareExecutor, map);
|
||||
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||
index 0043c0087896a6df6910b0500da37d84b287c901..17a5928afade7e477cda34365dc8c72c52a6b758 100644
|
||||
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.SectionPos;
|
||||
import net.minecraft.core.Vec3i;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||
return ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek());
|
||||
};
|
||||
private final LongPredicate tickCheck;
|
||||
- private final Supplier<ProfilerFiller> profiler;
|
||||
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
||||
private final Long2ObjectMap<LevelChunkTicks<T>> allContainers = new Long2ObjectOpenHashMap<>();
|
||||
private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), (map) -> {
|
||||
map.defaultReturnValue(Long.MAX_VALUE);
|
||||
@@ -48,9 +48,9 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||
|
||||
};
|
||||
|
||||
- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier<ProfilerFiller> profilerGetter) {
|
||||
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) { // Plazma - Completely remove profiler
|
||||
this.tickCheck = tickingFutureReadyPredicate;
|
||||
- this.profiler = profilerGetter;
|
||||
+ //this.profiler = profilerGetter; // Plazma - Completely remove profiler
|
||||
}
|
||||
|
||||
public void addContainer(ChunkPos pos, LevelChunkTicks<T> scheduler) {
|
||||
@@ -88,7 +88,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
|
||||
//ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
|
||||
//profilerFiller.push("collect"); // Purpur
|
||||
- this.collectTicks(time, maxTicks, null); // Purpur
|
||||
+ this.collectTicks(time, maxTicks); // Purpur // Plazma - Completely remove profiler
|
||||
//profilerFiller.popPush("run"); // Purpur
|
||||
//profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur
|
||||
this.runCollectedTicks(ticker);
|
||||
@@ -97,7 +97,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
||||
//profilerFiller.pop(); // Purpur
|
||||
}
|
||||
|
||||
- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) {
|
||||
+ private void collectTicks(long time, int maxTicks/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
||||
this.sortContainersToTick(time);
|
||||
//profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur
|
||||
this.drainContainers(time, maxTicks);
|
||||
@@ -1,27 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 16:55:12 +0900
|
||||
Subject: [PATCH] Console logging tweaks
|
||||
Date: Sun, 5 Nov 2023 10:40:49 +0900
|
||||
Subject: [PATCH] Tweak console logging
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index e4fd372a1d585887287253a02531cd192929377b..dae0b0e1288afe0d8eb70d0e8e2db152aad42bf4 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -355,7 +355,7 @@ public final class ChatProcessor {
|
||||
|
||||
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
|
||||
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
|
||||
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
|
||||
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage)) ? null : "Not Secure"); // Plazma
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb171834d940 100644
|
||||
index 743ef664a84da93751feaa06e3522515cf9831f8..4e583dde426f8345fb931be6135a1427ed635ab2 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
|
||||
@@ -194,16 +194,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
}
|
||||
|
||||
@@ -33,64 +20,64 @@ index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb17
|
||||
- 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();
|
||||
|
||||
@@ -318,6 +308,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.offlineWarnings) // Plazma - Console logging tweaks
|
||||
if (!this.usesAuthentication()) {
|
||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
@@ -331,9 +322,21 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||
}
|
||||
// Spigot end
|
||||
- DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
+ DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file or set \"console-logs.offline-warning\" to \"false\" in the config/plazma-global.yml file."); // Plazma
|
||||
}
|
||||
|
||||
+ // Plazma start - Console logging tweaks
|
||||
+ // Moved down
|
||||
+ // Paper start - detect running as root
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
@@ -235,6 +225,15 @@ 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
|
||||
+ // Paper start - detect running as root // Plazma - Tweak console logging (moved down)
|
||||
+ if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
+ DedicatedServer.LOGGER.warn("****************************");
|
||||
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||
+ DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
|
||||
+ DedicatedServer.LOGGER.warn("****************************");
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ // Plazma end
|
||||
+ // Paper end - detect running as root
|
||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
@@ -332,6 +331,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.");
|
||||
@@ -345,7 +345,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 5c38df8170033dbfee267520991a3cc3285d219e..58cc1bed851994fb591e9b832b98d25eda153b47 100644
|
||||
index a32ab50f74ee75141d1d61b8052aa149121a3670..62a6fec0f4bf0f2a70740ba5cfd386857abe9531 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1440,7 +1440,7 @@ public abstract class PlayerList {
|
||||
@@ -1420,6 +1420,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix) return true; // Plazma - Tweak console logging
|
||||
return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||
}
|
||||
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||
// Paper end
|
||||
- boolean flag = this.verifyChatTrusted(message);
|
||||
+ boolean flag = !org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || this.verifyChatTrusted(message); // Plazma
|
||||
|
||||
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
|
||||
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d506e0c2b37f91e46e682652bd134ad91db28f84..44df2c0a1ed3d006b455ba2a47d6bc9059d804e1 100644
|
||||
index aff5c68bc715c6ea9b5b808e5a94cbac9a3725ba..a8586f1bd161ad3470ae7f0590f1bba0cf627bd0 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,4 +40,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Player extends ConfigurationPart {
|
||||
@@ -69,4 +69,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
+
|
||||
|
||||
+ public ConsoleLogs consoleLogs;
|
||||
+ public class ConsoleLogs extends ConfigurationPart {
|
||||
+
|
||||
@@ -99,4 +86,5 @@ index d506e0c2b37f91e46e682652bd134ad91db28f84..44df2c0a1ed3d006b455ba2a47d6bc90
|
||||
+ 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 c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1ab5c51aae 100644
|
||||
index f60961bd5fdf6d1417e458b92e311c1a0a62463d..026cd57df33476841ed3a8f9fdc4d17a77e037b0 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
|
||||
@@ -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
|
||||
@@ -160,6 +160,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.allayMaxHealth);
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale);
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.allayTakeDamageFromWater;
|
||||
@@ -23,25 +23,20 @@ index c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1a
|
||||
+ public boolean isAlwaysExperienceDropper() {
|
||||
+ return level().purpurConfig.allayAlwaysDropExp;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ 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 1d84135c709a90843b1ee34fb47508e78a7ce95d..c97ef420581803b569d130b58a97f67d1fee54f2 100644
|
||||
index 56d97225a909fd55f0d8aec992d5b6d42687c948..39cdecc382a71ef643d382ac506249bbb8df3d34 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
|
||||
@@ -95,6 +95,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||
@@ -96,6 +96,18 @@ public class Camel extends AbstractHorse {
|
||||
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 +46,20 @@ index 1d84135c709a90843b1ee34fb47508e78a7ce95d..c97ef420581803b569d130b58a97f67d
|
||||
+ 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 9417ce67cc231d5bfa6813f78ec27196eed423c8..4e471e4a259a64c44da5ab450f0137691428ff6a 100644
|
||||
index 501a12398c56fe0df4e76a3bbce0f98c6c5aa6cb..94ca735513901a180d42ac1cfd48d841142a6ef5 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
|
||||
@@ -136,6 +136,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
@@ -163,6 +163,23 @@ public class Frog extends Animal implements VariantHolder<Holder<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 +74,20 @@ index 9417ce67cc231d5bfa6813f78ec27196eed423c8..4e471e4a259a64c44da5ab450f013769
|
||||
+ 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 071d14cc6697587ec14f02c69c78df364e7d8a8f..cc5c172b2fccc5fc59337203ed2b6edb2abc0c22 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 {
|
||||
@@ -93,6 +93,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 +102,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 dcb10e2ea1e0c7d0479adae5bc2ff57ece172aad..795c93352dfa69fad0e034a8377eceb6dc1e81da 100644
|
||||
index 3fb4f12095883ea4ec6e0d60e0600b9de6ed7be2..f853730cee4fad2f3a5711e38918c65dcb1dc038 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
|
||||
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
|
||||
public boolean isControllable() {
|
||||
return level().purpurConfig.snifferControllable;
|
||||
@@ -116,6 +116,18 @@ public class Sniffer extends Animal {
|
||||
public int getPurpurBreedTime() {
|
||||
return this.level().purpurConfig.snifferBreedingTicks;
|
||||
}
|
||||
+
|
||||
+ // Plazma start
|
||||
+ // Plazma start - Add missing purpur configuration options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
+ return level().purpurConfig.snifferTakeDamageFromWater;
|
||||
@@ -130,20 +125,20 @@ index dcb10e2ea1e0c7d0479adae5bc2ff57ece172aad..795c93352dfa69fad0e034a8377eceb6
|
||||
+ 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 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652c17fe240 100644
|
||||
index 692261880d05daa75fc53dde31d0f2b95dc52746..9f542e4f0077a6abc89fdec1a4bf3e8f40203b2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -146,6 +146,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -151,6 +151,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,89 +153,85 @@ index 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652
|
||||
+ 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
|
||||
--- 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
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
||||
index 1f4cc08e84a23213bb9786ea09ad77caeec2d336..f888f1dd2e3c228b0a370fe920b63d547bbba571 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
||||
@@ -46,7 +46,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
|
||||
|
||||
public ChestBoat(EntityType<? extends Boat> type, Level world) {
|
||||
super(type, world);
|
||||
public AbstractChestBoat(EntityType<? extends AbstractChestBoat> type, Level world, Supplier<Item> itemSupplier) {
|
||||
super(type, world, itemSupplier);
|
||||
- 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
|
||||
@Override
|
||||
@@ -142,7 +142,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
|
||||
|
||||
@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 5f0b10932f8dda09131ba68207cbfea4715e0f33..92cb442d9326b4fd47cd6ec0425192f751d3e538 100644
|
||||
index 097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc..3f4c94aada930e55dfe6a2dd6f3bfb51b2276b0d 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -329,6 +329,7 @@ public class PurpurConfig {
|
||||
@@ -331,6 +331,7 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static int barrelRows = 3;
|
||||
+ public static int chestBoatRows = 3; // Plazma
|
||||
+ 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;
|
||||
@@ -369,6 +370,7 @@ public class PurpurConfig {
|
||||
@@ -373,6 +374,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 d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724ab4f69a7 100644
|
||||
index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cda8cb0b0c 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1113,7 +1113,15 @@ public class PurpurWorldConfig {
|
||||
public boolean allayRidableInWater = true;
|
||||
@@ -1133,7 +1133,13 @@ public class PurpurWorldConfig {
|
||||
public boolean allayControllable = true;
|
||||
public List<String> allayRespectNBT = new ArrayList<>();
|
||||
public double allayMaxHealth = 20.0D;
|
||||
public double allayScale = 1.0D;
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+ public double allayMaxHealth = 20.0D;
|
||||
+ public boolean allayTakeDamageFromWater = false;
|
||||
+ public boolean allayAlwaysDropExp = false;
|
||||
private void allaySettings() {
|
||||
+ 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);
|
||||
@@ -1232,7 +1240,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1288,7 +1294,13 @@ public class PurpurWorldConfig {
|
||||
public double camelMovementSpeedMin = 0.09D;
|
||||
public double camelMovementSpeedMax = 0.09D;
|
||||
public int camelBreedingTicks = 6000;
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+ //public boolean camelRidableInWater = false;
|
||||
+ public boolean camelTakeDamageFromWater = false;
|
||||
+ public boolean camelAlwaysDropExp = false;
|
||||
private void camelSettings() {
|
||||
+ //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);
|
||||
@@ -1660,7 +1676,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1740,7 +1752,15 @@ public class PurpurWorldConfig {
|
||||
public boolean frogControllable = true;
|
||||
public float frogRidableJumpHeight = 0.65F;
|
||||
public int frogBreedingTicks = 6000;
|
||||
@@ -252,13 +243,13 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
|
||||
+ 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);
|
||||
@@ -2613,7 +2637,13 @@ public class PurpurWorldConfig {
|
||||
public boolean snifferControllable = true;
|
||||
@@ -2752,7 +2772,13 @@ public class PurpurWorldConfig {
|
||||
public double snifferMaxHealth = 14.0D;
|
||||
public double snifferScale = 1.0D;
|
||||
public int snifferBreedingTicks = 6000;
|
||||
+ // Plazma start - Add missing purpur config options
|
||||
+ public boolean snifferTakeDamageFromWater = false;
|
||||
@@ -266,11 +257,11 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
|
||||
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);
|
||||
@@ -2712,7 +2742,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2860,7 +2886,15 @@ public class PurpurWorldConfig {
|
||||
public boolean tadpoleRidable = false;
|
||||
public boolean tadpoleRidableInWater = true;
|
||||
public boolean tadpoleControllable = true;
|
||||
@@ -282,11 +273,11 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
|
||||
+ 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);
|
||||
@@ -2922,7 +2960,15 @@ public class PurpurWorldConfig {
|
||||
@@ -3088,7 +3122,15 @@ public class PurpurWorldConfig {
|
||||
public boolean wardenRidable = false;
|
||||
public boolean wardenRidableInWater = true;
|
||||
public boolean wardenControllable = true;
|
||||
@@ -298,7 +289,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
|
||||
+ 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);
|
||||
@@ -0,0 +1,90 @@
|
||||
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 acdff7b4a00d563739fd301c3633a266875296fa..1266aaf4bfcf53aa16d7b9bd697a0c483d3218a9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
@@ -113,7 +113,7 @@ public class PortalShape {
|
||||
private static int calculateWidth(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockStateListPopulator blocks) { // CraftBukkit
|
||||
int i = PortalShape.getDistanceUntilEdgeAboveFrame(iblockaccess, blockposition, enumdirection, blocks); // CraftBukkit
|
||||
|
||||
- return i >= 2 && i <= 21 ? i : 0;
|
||||
+ return i >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.min() && i <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.max() ? i : 0; // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
private static int getDistanceUntilEdgeAboveFrame(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockStateListPopulator blocks) { // CraftBukkit
|
||||
@@ -146,7 +146,7 @@ public class PortalShape {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
int j = PortalShape.getDistanceUntilTop(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, mutableint, blocks); // CraftBukkit
|
||||
|
||||
- return j >= 3 && j <= 21 && PortalShape.hasTopFrame(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, j, blocks) ? j : 0; // CraftBukkit
|
||||
+ return j >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.min() && j <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.max() && PortalShape.hasTopFrame(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, j, blocks) ? j : 0; // Craftbukkit // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
private static boolean hasTopFrame(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockPos.MutableBlockPos blockposition_mutableblockposition, int i, int j, BlockStateListPopulator blocks) { // CraftBukkit
|
||||
@@ -200,7 +200,7 @@ public class PortalShape {
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
- return this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
+ return this.width >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.min() && this.width <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.max() && this.height >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.min() && this.height <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.max(); // Plazma - Configurable nether portal size
|
||||
}
|
||||
|
||||
// CraftBukkit start - return boolean, add entity
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index a8586f1bd161ad3470ae7f0590f1bba0cf627bd0..b3fccda131e51b03b1617b028f8d7488db342f24 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -60,6 +60,26 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Structure structure;
|
||||
public class Structure 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); }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 8dce68cf7769fcd5ea03be32621ccb6bab174697..e50118ec7a4c00bd367ca6c740214c53b0d60fc9 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -36,17 +36,6 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
- public Structure structure;
|
||||
- public class Structure extends ConfigurationPart {
|
||||
-
|
||||
- public NetherPortal netherPortal;
|
||||
- public class NetherPortal extends ConfigurationPart {
|
||||
-
|
||||
-
|
||||
- }
|
||||
-
|
||||
- }
|
||||
-
|
||||
public Block block;
|
||||
public class Block extends ConfigurationPart {
|
||||
|
||||
@@ -1,70 +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
|
||||
|
||||
Configurable nether portal size
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
index e7554ec800f321e4e34c926c53f2375a8c3aa979..c7f974e0b614afa1ced716ff7b6c67ee037a4071 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||
@@ -100,7 +100,7 @@ public class PortalShape {
|
||||
private int calculateWidth() {
|
||||
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
|
||||
|
||||
- return i >= 2 && i <= 21 ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() ? i : 0; // Plazma
|
||||
}
|
||||
|
||||
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
|
||||
@@ -133,7 +133,7 @@ public class PortalShape {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
|
||||
|
||||
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
|
||||
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma
|
||||
}
|
||||
|
||||
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
|
||||
@@ -187,7 +187,7 @@ public class PortalShape {
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && this.width <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() && this.height >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && this.height <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max(); // Plazma
|
||||
}
|
||||
|
||||
// CraftBukkit start - return boolean
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index d990c031255daf0d43541efe175c5b52736a6990..36c367c577e61422e51ab08c5aaa2a88c94e1636 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -39,6 +39,27 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public NetherPortal netherPortal;
|
||||
public class NetherPortal extends ConfigurationPart {
|
||||
|
||||
+ public Size size;
|
||||
+ public class Size extends ConfigurationPart {
|
||||
+
|
||||
+ public Width width;
|
||||
+ public class Width extends ConfigurationPart {
|
||||
+
|
||||
+ int min; public int min() { return Math.max(this.min, 1); }
|
||||
+ int max; public int max() { return Math.max(this.min, this.max); }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Height height;
|
||||
+ public class Height extends ConfigurationPart {
|
||||
+
|
||||
+ int min; public int min() { return Math.max(this.min, 2); }
|
||||
+ int max; public int max() { return Math.max(this.min, this.max); }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,26 +7,27 @@ Subject: [PATCH] Apply various optimizations
|
||||
Akarin - Swaps the predicate order of collision
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 1ca91631b03c9690b4f661ecfb4d500d23cb47ec..4461dc1b76cc2939130680f8039b69af902aa050 100644
|
||||
index 6b32cd1391f39b6fe61c3c8c00249d1d4278cbd0..b94f3e2071e71b2b038e875b25c985b0c7c00fc0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2105,8 +2105,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2341,8 +2341,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void playerTouch(Player player) {}
|
||||
|
||||
public void push(Entity entity) {
|
||||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
|
||||
+ 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 - moved up
|
||||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
|
||||
+ //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();
|
||||
@@ -2135,7 +2136,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2370,8 +2371,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
entity.push(d0, 0.0D, d1);
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
- }
|
||||
+ //} // Plazma
|
||||
+ //} // Plazma - Swaps the predicate order of collision
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,394 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 21:18:22 +0900
|
||||
Subject: [PATCH] Reduce create random instance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 44248dc470d0882b7287debd1993cedf0f238aca..ee571f465ca1e83e760a4d57b3d11accb53c6cfe 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -228,7 +228,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private ServerStatus status;
|
||||
@Nullable
|
||||
private ServerStatus.Favicon statusIcon;
|
||||
- private final RandomSource random;
|
||||
+ private final RandomSource random; public RandomSource getRandom() { return this.random; } // Plazma
|
||||
public final DataFixer fixerUpper;
|
||||
private String localIp;
|
||||
private int port;
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..7834700eb0e1d789f7b338b535a0a9f8965201ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
|
||||
@@ -65,7 +65,7 @@ public class SpreadPlayersCommand {
|
||||
if (maxY < j) {
|
||||
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
|
||||
} else {
|
||||
- RandomSource randomsource = RandomSource.create();
|
||||
+ RandomSource randomsource = worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
double d0 = (double) (center.x - maxRange);
|
||||
double d1 = (double) (center.y - maxRange);
|
||||
double d2 = (double) (center.x + maxRange);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 99cf8ce63316e127a5ee84cdd96df80d440dc0c3..c3bb82793ecd5333d8dbef7a90729d80616ea4ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -448,7 +448,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (worldserver.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
@@ -485,7 +485,7 @@ public class ServerPlayer extends Player {
|
||||
long l = k * k;
|
||||
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
||||
int j1 = this.getCoprime(i1);
|
||||
- int k1 = RandomSource.create().nextInt(i1);
|
||||
+ int k1 = (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
|
||||
|
||||
for (int l1 = 0; l1 < i1; ++l1) {
|
||||
int i2 = (k1 + j1 * l1) % i1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index d38685f82d2e6c4e71179bf3a85a8b183aa6c44b..1265e6a521222be0c957065f5b788d68cb3d863f 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -70,7 +70,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
this.serverId = "";
|
||||
this.server = server;
|
||||
this.connection = connection;
|
||||
- this.challenge = Ints.toByteArray(RandomSource.create().nextInt());
|
||||
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? server.getRandom() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
index 1ef089dbf83de35d875c00efdf468c397be56978..7f4c0827d2269baa032dac4798fe6c2a740ba7fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
|
||||
@@ -349,7 +349,7 @@ public class QueryThreadGs4 extends GenericThread {
|
||||
this.identBytes[2] = bs[5];
|
||||
this.identBytes[3] = bs[6];
|
||||
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
|
||||
- this.challenge = RandomSource.create().nextInt(16777216);
|
||||
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
|
||||
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java b/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||
index 8311073e44ca8a2c8ac6f6864a875d6c90338664..8e488389b41c63809993262183204b77f73c0e55 100644
|
||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/EntityZombieVillagerTypeFix.java
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.util.RandomSource;
|
||||
|
||||
public class EntityZombieVillagerTypeFix extends NamedEntityFix {
|
||||
private static final int PROFESSION_MAX = 6;
|
||||
- private static final RandomSource RANDOM = RandomSource.create();
|
||||
+ private static final RandomSource RANDOM = org.plazmamc.plazma.PlazmaOptions.createNewRandom() ? RandomSource.create() : net.minecraft.server.MinecraftServer.getServer().getRandom(); // Plazma - Reduce create random source
|
||||
|
||||
public EntityZombieVillagerTypeFix(Schema outputSchema, boolean changesType) {
|
||||
super(outputSchema, changesType, "EntityZombieVillagerTypeFix", References.ENTITY, "Zombie");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
index fe3ab3d388f0481fb0db06b7f730f868dbf8e8a5..265d8479b5c02994dba4288060b842789ebc7179 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.util.RandomSource;
|
||||
|
||||
public class ShufflingList<U> implements Iterable<U> {
|
||||
public final List<ShufflingList.WeightedEntry<U>> entries; // Paper - public
|
||||
- private final RandomSource random = RandomSource.create();
|
||||
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma
|
||||
private final boolean isUnsafe; // Paper
|
||||
|
||||
public ShufflingList() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
index 7094701d213c73ba47ace806962244c10fdf4dda..288ae299240c9626e576a7ae1c45c53d83f7f097 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
|
||||
public abstract class Sensor<E extends LivingEntity> {
|
||||
- private static final RandomSource RANDOM = RandomSource.createThreadSafe();
|
||||
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.suppressThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
|
||||
private static final int DEFAULT_SCAN_RATE = 20;
|
||||
protected static final int TARGETING_RANGE = 16;
|
||||
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.0D);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
index ece82743df21f0b776382821ad75dee96d0a0748..c25affe40eea32e1964aa4c62fdd27faa37baf28 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
|
||||
@@ -32,7 +32,7 @@ public class AngerManagement {
|
||||
@VisibleForTesting
|
||||
protected static final int MAX_ANGER = 150;
|
||||
private static final int DEFAULT_ANGER_DECREASE = 1;
|
||||
- private int conversionDelay = Mth.randomBetweenInclusive(RandomSource.create(), 0, 2);
|
||||
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
|
||||
int highestAnger;
|
||||
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create((instance) -> {
|
||||
return instance.group(UUIDUtil.CODEC.fieldOf("uuid").forGetter(Pair::getFirst), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("anger").forGetter(Pair::getSecond)).apply(instance, Pair::of);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
index a5443f92786427c42092aec8350e7ab37704db7a..b1a44e460175b974e8830030ce61e523533bef8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
@@ -32,7 +32,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
||||
private static final int SPAWN_CHANCE_INCREASE = 25;
|
||||
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
|
||||
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
|
||||
- private final RandomSource random = RandomSource.create();
|
||||
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - reduce create random instace
|
||||
private final ServerLevelData serverLevelData;
|
||||
private int tickDelay;
|
||||
private int spawnDelay;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319..f1b0b8fd1042f2ce8a514000d95df5123223cc27 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -86,7 +86,7 @@ public class FishingHook extends Projectile {
|
||||
|
||||
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
|
||||
super(type, world);
|
||||
- this.syncronizedRandom = RandomSource.create();
|
||||
+ this.syncronizedRandom = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
this.openWater = true;
|
||||
this.currentState = FishingHook.FishHookState.FLYING;
|
||||
this.noCulling = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index eaa2943b667967f93f28d9d794d702fdaeb670ec..75ba586277ece1aa56186679d3a8ebf0b3f7a0cb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -109,7 +109,7 @@ public class Raid {
|
||||
|
||||
public Raid(int id, ServerLevel world, BlockPos pos) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.id = id;
|
||||
this.level = world;
|
||||
@@ -123,7 +123,7 @@ public class Raid {
|
||||
|
||||
public Raid(ServerLevel world, CompoundTag nbt) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.waveSpawnPos = Optional.empty();
|
||||
this.level = world;
|
||||
this.id = nbt.getInt("Id");
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
index d604b7ec46f08993647979ed220a84842e3fe325..f2a3049252a37ca6d6d5cb1cc51d512c7ebf5679 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||
@@ -97,7 +97,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||
}
|
||||
// Purpur end
|
||||
};
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = playerInventory.player.level().plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? playerInventory.player.level().random : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.enchantmentSeed = DataSlot.standalone();
|
||||
this.costs = new int[3];
|
||||
this.enchantClue = new int[]{-1, -1, -1};
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index ef9b1687dd2dfda5398523140aecc678b4690642..66a1db10249995144490dac292e09fd0aa30f168 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -82,7 +82,7 @@ public class Explosion {
|
||||
}
|
||||
|
||||
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
|
||||
- this.random = RandomSource.create();
|
||||
+ this.random = world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
this.toBlow = new ObjectArrayList();
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 1a5880ae3c3b17d49f0b083dff66e5619c08ec20..e175cde654b36d8ffc98a36ef099d22e9f1d15e9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -124,16 +124,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public final Thread thread;
|
||||
private final boolean isDebug;
|
||||
private int skyDarken;
|
||||
- protected int randValue = RandomSource.create().nextInt();
|
||||
protected final int addend = 1013904223;
|
||||
protected float oRainLevel;
|
||||
public float rainLevel;
|
||||
protected float oThunderLevel;
|
||||
public float thunderLevel;
|
||||
public final RandomSource random = RandomSource.create();
|
||||
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? random.nextInt() : RandomSource.create().nextInt(); // Plazma - Reduce create random instace
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.suppressThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
|
||||
private final ResourceKey<DimensionType> dimensionTypeId;
|
||||
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||
public final WritableLevelData levelData;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..b8d2c91a343478d89a5242254f3379dfa2556348 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
@@ -22,7 +22,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
|
||||
public float rot;
|
||||
public float oRot;
|
||||
public float tRot;
|
||||
- private static final RandomSource RANDOM = RandomSource.create();
|
||||
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
private Component name;
|
||||
private int lapis = 0; // Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 7291e4056b8e46ab59b71818388ac55fbb12993f..22faea52bc54cdcb52ff18a9d5a8c1bd1a64fa73 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
}
|
||||
|
||||
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
|
||||
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instance
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..c85340232624529d4685bf34035bb62d294695c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
|
||||
@@ -221,7 +221,7 @@ public class ChunkGeneratorStructureState {
|
||||
List<CompletableFuture<ChunkPos>> list = new ArrayList(j);
|
||||
int k = placement.spread();
|
||||
HolderSet<Biome> holderset = placement.preferredBiomes();
|
||||
- RandomSource randomsource = RandomSource.create();
|
||||
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceCreateRandomInstance ? net.minecraft.server.MinecraftServer.getServer().getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
|
||||
|
||||
// Paper start
|
||||
if (this.conf.strongholdSeed != null && structureSetEntry.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
index 18fce94f0d4b9d28e3afec61c7578f672973a71f..2dfb801ec15a372bcb997942969fec64aea9e49e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
|
||||
@@ -62,7 +62,7 @@ public enum DragonRespawnAnimation {
|
||||
|
||||
world.explode((Entity)null, (double)((float)endSpike.getCenterX() + 0.5F), (double)endSpike.getHeight(), (double)((float)endSpike.getCenterZ() + 0.5F), 5.0F, Level.ExplosionInteraction.BLOCK);
|
||||
SpikeConfiguration spikeConfiguration = new SpikeConfiguration(true, ImmutableList.of(endSpike), new BlockPos(0, 128, 0));
|
||||
- Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), RandomSource.create(), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ()));
|
||||
+ Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? world.getRandom() : RandomSource.create()), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ())); // Plazma - Reduce create random instance
|
||||
}
|
||||
} else if (bl) {
|
||||
fight.setRespawnStage(SUMMONING_DRAGON);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..67b4a65980059b0b2d4929c619c400c48e201e18 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -472,7 +472,7 @@ public class EndDragonFight {
|
||||
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
|
||||
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
|
||||
}).ifPresent((holder_c) -> {
|
||||
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
|
||||
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instace
|
||||
});
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class EndDragonFight {
|
||||
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
|
||||
}
|
||||
// Paper end
|
||||
- if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) {
|
||||
+ if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.level.getRandom() : RandomSource.create()), this.portalLocation)) { // Plazma - Reduce create random instace
|
||||
int i = Mth.positiveCeilDiv(4, 16);
|
||||
|
||||
this.level.getChunkSource().chunkMap.waitForLightBeforeSending(new ChunkPos(this.portalLocation), i);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java b/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||
index d38cabc9eeb45dd863e5f87b7df3b6327ea6a4a2..d4bcdbc6ea420bdb05c0a8859d368213d87dba67 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/WorldOptions.java
|
||||
@@ -77,6 +77,6 @@ public class WorldOptions {
|
||||
}
|
||||
|
||||
public static long randomSeed() {
|
||||
- return RandomSource.create().nextLong();
|
||||
+ return (org.plazmamc.plazma.PlazmaOptions.createNewRandom() ? RandomSource.create() : net.minecraft.server.MinecraftServer.getServer().getRandom()).nextLong(); // Plazma - Reduce create random instance
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..aabbf9ae1b772c9101e6f36236e5d34a5620a4d3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
||||
@@ -2,6 +2,8 @@ package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.Random;
|
||||
+
|
||||
+import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
@@ -14,11 +16,12 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
|
||||
public class CraftFirework extends CraftProjectile implements Firework {
|
||||
|
||||
- private final Random random = new Random();
|
||||
+ private final net.minecraft.util.RandomSource random; // Plazma - Reduce create random instance
|
||||
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
||||
|
||||
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|
||||
super(server, entity);
|
||||
+ this.random = this.getHandle().level().plazmaLevelConfiguration().misc.reduceCreateRandomInstance ? this.getHandle().level().getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
|
||||
|
||||
// Paper Start - Expose firework item directly
|
||||
// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4421110e20a006c3773e922eb0facc88174ffb43
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||
@@ -0,0 +1,10 @@
|
||||
+package org.plazmamc.plazma;
|
||||
+
|
||||
+public class PlazmaOptions {
|
||||
+
|
||||
+ static final boolean DONT_CREATE_NEW_RANDOM_INSTANCE = Boolean.getBoolean("Plazma.doNotCreateRandomInstance");
|
||||
+ public static boolean createNewRandom() {
|
||||
+ return !DONT_CREATE_NEW_RANDOM_INSTANCE;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 00c95194788d56f539d1c75e9a1ce48e950c096c..9e26e598d7c381368de422ab0c3cc7936e3bbb6d 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -18,7 +18,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
static void set(@NotNull GlobalConfiguration instance, boolean test) {
|
||||
GlobalConfiguration.instance = instance;
|
||||
if (test) {
|
||||
-
|
||||
+ instance.misc.reduceCreateRandomInstance = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
+ public boolean suppressThreadSafeRandom = DO_OPTIMIZE;
|
||||
+
|
||||
}
|
||||
|
||||
public Player player;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 36c367c577e61422e51ab08c5aaa2a88c94e1636..146af5bb54da67c134485dc67e8d9a569889434a 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -26,6 +26,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
+ public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
+
|
||||
}
|
||||
|
||||
public Entity entity;
|
||||
@@ -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 27eb9a365006884c85603dc6d9dd8eee009c98b3..958a48d05aba8e500c7b19a466dcca6fea8a8bcc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
@@ -70,6 +70,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 7bd566d6e15385850930a6c0b44d1d495a671e81..d5e7d74b0e203c9f2c03c9b4f8d1b9c57168e61f 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -31,6 +31,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
+ public boolean loadChunksToSpawn = !OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
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 61b19f52aeb371abdd29f41291099f35a9b4c258..dcb0a4461a2fca964e4d8390401e463648ed3351 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1694,7 +1694,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
||||
+ // Plazma start - Add option to bypass moved to quickly check
|
||||
private boolean shouldCheckPlayerMovement(boolean elytra) {
|
||||
+ return (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) && shouldCheckPlayerMovement0(elytra);
|
||||
+ }
|
||||
+
|
||||
+ private boolean shouldCheckPlayerMovement0(boolean elytra) {
|
||||
+ // Plazma end - Add option to bypass moved to quickly check
|
||||
if (this.isSingleplayerOwner()) {
|
||||
return false;
|
||||
} else if (this.player.isChangingDimension()) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 3ec9c947ac19412ad81d0cc85e0eff289a285d1e..af89ad0fcaebb5776ae3c18d02441c48f4227251 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,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:13:07 +0900
|
||||
Subject: [PATCH] Avoid double I/O operation on load player file
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
index 36af81f0957d17e170d229059c66f4eb4539dfeb..b4b74bff0579b919266e91464b36c9381342b677 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
@@ -56,7 +56,8 @@ public class PlayerDataStorage {
|
||||
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
|
||||
// Spigot Start
|
||||
boolean usingWrongFile = false;
|
||||
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
|
||||
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
|
||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
|
||||
{
|
||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
if ( file.exists() )
|
||||
@@ -67,7 +68,7 @@ public class PlayerDataStorage {
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
- if (file.exists() && file.isFile()) {
|
||||
+ if (isNormalFile) { // Plazma - Avoid double I/O operation
|
||||
nbttagcompound = NbtIo.readCompressed(file);
|
||||
}
|
||||
// Spigot Start
|
||||
63
patches/server/0018-Configurable-cave-lava-sea-level.patch
Normal file
63
patches/server/0018-Configurable-cave-lava-sea-level.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
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 3f39d6c786d9dfdd9ad591e08ff05fcbb41a1df6..0346fd4ab7095d66c0eef5a440afbc7a8ba52466 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
@@ -71,14 +71,14 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
}
|
||||
|
||||
private static Aquifer.FluidPicker createFluidPicker(NoiseGeneratorSettings settings) {
|
||||
- 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());
|
||||
- Aquifer.FluidStatus aquifer_b2 = new Aquifer.FluidStatus(DimensionType.MIN_Y * 2, Blocks.AIR.defaultBlockState());
|
||||
-
|
||||
- return (j, k, l) -> {
|
||||
- return k < Math.min(-54, i) ? aquifer_b : aquifer_b1;
|
||||
- };
|
||||
+ // Plazma start - Configurable default lava sea level
|
||||
+ int i = org.plazmamc.plazma.configurations.GlobalConfiguration.get().worldgen.lavaSea.startLevel;
|
||||
+ int j = settings.seaLevel();
|
||||
+ Aquifer.FluidStatus aquifer1 = new Aquifer.FluidStatus(i, org.plazmamc.plazma.configurations.GlobalConfiguration.get().worldgen.lavaSea.seaBlock());
|
||||
+ Aquifer.FluidStatus aquifer2 = new Aquifer.FluidStatus(j, settings.defaultFluid());
|
||||
+
|
||||
+ return (x, y, z) -> y < Math.min(i, j) ? aquifer1 : aquifer2;
|
||||
+ // Plazma end - Configurable default lava sea level
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index af89ad0fcaebb5776ae3c18d02441c48f4227251..aa8b0a9b3d98e2c2fb1bd3c374cd2e742e6e17cf 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -35,6 +35,24 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public WorldGeneration worldgen;
|
||||
public class WorldGeneration extends ConfigurationPart {
|
||||
|
||||
+ public LavaSea lavaSea;
|
||||
+ public class LavaSea extends ConfigurationPart {
|
||||
+
|
||||
+ public int startLevel = -54;
|
||||
+ String seaBlock = "default";
|
||||
+
|
||||
+ public net.minecraft.world.level.block.state.BlockState seaBlock() {
|
||||
+ if (this.seaBlock.equalsIgnoreCase("default")) return net.minecraft.world.level.block.Blocks.LAVA.defaultBlockState();
|
||||
+ return net.minecraft.core.registries.BuiltInRegistries.BLOCK
|
||||
+ .getOptional(net.minecraft.resources.ResourceLocation.tryParse(this.seaBlock))
|
||||
+ .orElseGet(() -> {
|
||||
+ PlazmaConfigurations.LOGGER.warn("Invalid custom sea level block: {}, defaulting to lava", this.seaBlock);
|
||||
+ return net.minecraft.world.level.block.Blocks.LAVA;
|
||||
+ })
|
||||
+ .defaultBlockState();
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:15:39 +0900
|
||||
Subject: [PATCH] Don't refresh LootTable for non player interaction
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
index 081691f9710ff1115e4308f79ed49fbc38941193..79a27755534384ab94e79e422c0a5e9ccecacd8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
||||
}
|
||||
|
||||
public void unpackLootTable(@Nullable Player player) {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.dontRefreshLootTableForNonPlayerInteraction && player == null) return; // Plazma
|
||||
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
|
||||
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
|
||||
if (player instanceof ServerPlayer) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 9e26e598d7c381368de422ab0c3cc7936e3bbb6d..5a62bffe495002b3bbf5fd995df135c5d174458a 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -36,6 +36,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
public boolean suppressThreadSafeRandom = DO_OPTIMIZE;
|
||||
+ public boolean dontRefreshLootTableForNonPlayerInteraction = DO_OPTIMIZE;
|
||||
|
||||
}
|
||||
|
||||
36
patches/server/0019-Configurable-entity-sensor-tick.patch
Normal file
36
patches/server/0019-Configurable-entity-sensor-tick.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
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 ff9d23aef4658922692b43a859bd83632fe23612..8e5ad4cd6c8f61661b87dc96ba914c0bcd199879 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -949,10 +949,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
//ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
|
||||
|
||||
//gameprofilerfiller.push("sensing"); // Purpur
|
||||
- this.sensing.tick();
|
||||
+ //this.sensing.tick(); // Plazma - moved down
|
||||
//gameprofilerfiller.pop(); // Purpur
|
||||
int i = this.tickCount + 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) {
|
||||
//gameprofilerfiller.push("targetSelector"); // Purpur
|
||||
this.targetSelector.tickRunningGoals(false);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 4d204a0dc976d96c98764092c8461b0e2b920fc1..33bcfec86f83ce6e0ec17436ad38da8aeced48be 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -28,6 +28,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ public int sensorTick = 1;
|
||||
+
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:17:11 +0900
|
||||
Subject: [PATCH] Don't load chunks to spawn phantom
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..e7a9683fe6bd72e9e7644770953506195567e03b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
|
||||
|
||||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
|
||||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
||||
+ if (world.plazmaLevelConfiguration().entity.phantom.dontLoadChunksToSpawn && world.hasChunkAt(blockposition1)) continue; // Plazma
|
||||
BlockState iblockdata = world.getBlockState(blockposition1);
|
||||
FluidState fluid = world.getFluidState(blockposition1);
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 146af5bb54da67c134485dc67e8d9a569889434a..0a23900b18ec46ce2a7d47160dff013c7c8a8533 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ public Phantom phantom;
|
||||
+ public class Phantom extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean dontLoadChunksToSpawn = DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
public Structure structure;
|
||||
@@ -1,37 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:21:47 +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 e001787e40cc0a843e65b36582e9d6593d0fff0e..1af44c18724b2d2dc1d910f5af49254eb845feaf 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1435,6 +1435,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||
|
||||
+ if (this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !this.player.level().plazmaLevelConfiguration().entity.player.checkSpectatorMovecToQuickly && this.player.isSpectator()) return; // Plazma
|
||||
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
// CraftBukkit end
|
||||
// Paper start - Add fail move event
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 0a23900b18ec46ce2a7d47160dff013c7c8a8533..414baade911fab3450430af9378feedc419868f3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ public Player player;
|
||||
+ public class Player extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean checkSpectatorMovecToQuickly = !DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
|
||||
@@ -1,76 +1,77 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 30 Sep 2023 21:56:32 +0900
|
||||
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/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 82975c1c92c84294740a411b4a351efb8a2e6769..cb21da3cff4dbb08c7786c09b39e381abdf45c33 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -51,6 +51,20 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 33bcfec86f83ce6e0ec17436ad38da8aeced48be..b047af738236be3400d07d46c663017ed39b6f96 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -37,6 +37,20 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public WakeUpDurationVariance wakeUpDurationVariance;
|
||||
+ public class WakeUpDurationVariance extends ConfigurationPart {
|
||||
+
|
||||
+ double defaultValue() {
|
||||
+ return DO_OPTIMIZE ? 0.2 : 0.0;
|
||||
+ private double defaultValue() {
|
||||
+ return OPTIMIZE ? 0.2 : 0.0;
|
||||
+ }
|
||||
+
|
||||
+ double animal = defaultValue(); public double animal() { return Math.max(0, this.animal); }
|
||||
+ double monster = defaultValue(); public double monster() { return Math.max(0, this.monster); }
|
||||
+ double flyingMonster = defaultValue(); public double flyingMonster() { return Math.max(0, this.flyingMonster); }
|
||||
+ double villager = defaultValue(); public double villager() { return Math.max(0, this.villager); }
|
||||
+ 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;
|
||||
public Block block;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 062a793a134f774ebf918aab10443527c06c4fd1..3a362fef29c6fa29c37eff539e343eb3a56bf122 100644
|
||||
index 813b8aeb7bf39e03346fd9ca63c4c6498e162965..9843f440d921a61c60df5ec5e6e7ffebc9444b71 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -68,6 +68,13 @@ public class ActivationRange
|
||||
Activity.PANIC
|
||||
@@ -61,29 +61,37 @@ public class ActivationRange
|
||||
net.minecraft.world.entity.schedule.Activity.PANIC
|
||||
};
|
||||
|
||||
+ // Plazma start - Variable entity wakeup duration
|
||||
+ private static final java.util.Random WAKEUP_DURATION_RANDOM = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new java.util.Random() : new org.plazmamc.plazma.Random();
|
||||
+ private static int getWakeupDurationWithVariance(int duration, double deviation) {
|
||||
+ 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 * WAKEUP_DURATION_RANDOM.nextGaussian(1, deviation))));
|
||||
+ return (int) Math.min(Integer.MAX_VALUE, Math.max(1, Math.round(duration * (1 + deviation * random.nextGaussian()))));
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+ // Plazma end - Variable entity wakeup duration
|
||||
+
|
||||
private static int checkInactiveWakeup(Entity entity) {
|
||||
Level world = entity.level();
|
||||
SpigotWorldConfig config = world.spigotConfig;
|
||||
@@ -75,22 +82,22 @@ public class ActivationRange
|
||||
+ 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 getWakeupDurationWithVariance(config.wakeUpInactiveVillagersFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.villager()); // Plazma - Variable entity wakeup duration
|
||||
+ 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 getWakeupDurationWithVariance(config.wakeUpInactiveAnimalsFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.animal()); // Plazma - Variable entity wakeup duration
|
||||
+ 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 getWakeupDurationWithVariance(config.wakeUpInactiveFlyingFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.flyingMonster()); // Plazma - Variable entity wakeup duration
|
||||
+ 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 getWakeupDurationWithVariance(config.wakeUpInactiveMonstersFor, world.plazmaLevelConfiguration().entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
|
||||
+ return getWakeUpDuration(world.getRandom(), config.wakeUpInactiveMonstersFor, plazmaConfig.entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@@ -1,29 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 30 Sep 2023 22:10:59 +0900
|
||||
Date: Mon, 4 Dec 2023 23:17:15 +0900
|
||||
Subject: [PATCH] Skip event if no listeners
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..6016c304ddbeb6ffbd591f30914c85fcb6371e80 100644
|
||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..23594fb7eb4b2f33146592866608c2858ef23937 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -26,7 +26,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
-class PaperEventManager {
|
||||
+public class PaperEventManager { // Plazma - package -> public
|
||||
|
||||
private final Server server;
|
||||
|
||||
@@ -36,15 +36,17 @@ class PaperEventManager {
|
||||
@@ -36,15 +36,16 @@ class PaperEventManager {
|
||||
|
||||
// SimplePluginManager
|
||||
public void callEvent(@NotNull Event event) {
|
||||
+ // Plazma start - Skip event if no listeners
|
||||
+ HandlerList handlers = event.getHandlers();
|
||||
+ RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
+ RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
|
||||
+ if (listeners.length == 0) return;
|
||||
+ // Plazma end
|
||||
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
@@ -38,15 +28,3 @@ index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..6016c304ddbeb6ffbd591f30914c85fc
|
||||
for (RegisteredListener registration : listeners) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
continue;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d17df5621717b1c8d1d9a5549feb73c3600ecf3d..ddbc37857bd2706844074925bc27b7a84efa5832 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -31,7 +31,6 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@Override
|
||||
public void postProcess() {
|
||||
|
||||
-
|
||||
}
|
||||
|
||||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
|
||||
@@ -1,471 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 27 Sep 2023 22:30:49 +0900
|
||||
Subject: [PATCH] Use faster random
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
index 5408cbc21fc7577a6100b5a1ca0463e899d2df8b..f17b42176e9e5148b98baf4a6a7e7528242406d9 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 = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||
|
||||
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 ee571f465ca1e83e760a4d57b3d11accb53c6cfe..1a92a7f6391df6395c11d11efdbf2f4eda5c6651 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -680,7 +680,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 = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random(world.getSeed()) : new org.plazmamc.plazma.Random((int) world.getSeed()); // Plazma - use faster random
|
||||
org.bukkit.Location spawn = world.generator.getFixedSpawnLocation(world.getWorld(), rand);
|
||||
|
||||
if (spawn != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 52b48e40c3ee5f483c6cb04409459cf25abc3f0d..5ca738739507a4cb1c3b17502fa82462079cbc87 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -228,7 +228,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- private static final Random rand = new Random();
|
||||
+ private static final Random rand = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||
|
||||
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
||||
this.world = world;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
index d46ccc3b3aaacf937631a44a7e0f91b793a83c86..0be5ab95612dc21561ffc0051880baae75117bc6 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 = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new Random() : new org.plazmamc.plazma.Random(); // Plazma - use faster random
|
||||
private boolean newApi;
|
||||
private boolean implementBaseHeight = true;
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||
index 4421110e20a006c3773e922eb0facc88174ffb43..f0e6933a2bf06f2bcc343c0817ca414473be19d3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/PlazmaOptions.java
|
||||
@@ -7,4 +7,7 @@ public class PlazmaOptions {
|
||||
return !DONT_CREATE_NEW_RANDOM_INSTANCE;
|
||||
}
|
||||
|
||||
+ static final boolean USE_JAVA_RANDOM = Boolean.getBoolean("Plazma.useJavaRandom");
|
||||
+ public static boolean useJavaRandom() { return USE_JAVA_RANDOM; }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/Random.java b/src/main/java/org/plazmamc/plazma/Random.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d0aa8248c0f9dc6daab6eee6b77d3ef198d75fdb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/Random.java
|
||||
@@ -0,0 +1,395 @@
|
||||
+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() {
|
||||
+ this((int) System.currentTimeMillis());
|
||||
+ }
|
||||
+
|
||||
+ public Random(int value) {
|
||||
+ seed(value);
|
||||
+ }
|
||||
+
|
||||
+ @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;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
81
patches/server/0022-Add-entity-spawn-deadlock-timer.patch
Normal file
81
patches/server/0022-Add-entity-spawn-deadlock-timer.patch
Normal file
@@ -0,0 +1,81 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Tue, 5 Dec 2023 13:29:28 +0900
|
||||
Subject: [PATCH] Add entity spawn deadlock timer
|
||||
|
||||
[REFERENCE]
|
||||
- AbsolemJackdaw/FixMySpawnR
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index bb4411cfdf1bc7adc12c2f918d2eec830299f38b..357d484029fe338bea4f5770d13ccfc0dce4432e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -50,6 +50,8 @@ public abstract class BaseSpawner {
|
||||
public int requiredPlayerRange = 16;
|
||||
public int spawnRange = 4;
|
||||
private int tickDelay = 0; // Paper - Configurable mob spawner tick rate
|
||||
+ private int blockExistsTick = 0; // Plazma - Add entity spawn deadlock timer
|
||||
+ private boolean blockLockedByTime = false; // Plazma - Add entity spawn deadlock timer
|
||||
|
||||
public BaseSpawner() {}
|
||||
|
||||
@@ -85,6 +87,17 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
public void serverTick(ServerLevel world, BlockPos pos) {
|
||||
+ // Plazma start - Add entity spawn deadlock timer
|
||||
+ if (world.plazmaConfig().entity.spawnDeadlockTimer.enabled) {
|
||||
+ if (!this.blockLockedByTime) {
|
||||
+ if (this.blockExistsTick > world.plazmaConfig().entity.spawnDeadlockTimer.timerTimeout)
|
||||
+ blockLockedByTime = true;
|
||||
+ else blockExistsTick++;
|
||||
+ }
|
||||
+
|
||||
+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return;
|
||||
+ }
|
||||
+ // Plazma end - Add entity spawn deadlock timer
|
||||
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
||||
// Paper start - Configurable mob spawner tick rate
|
||||
if (spawnDelay > 0 && --tickDelay > 0) return;
|
||||
@@ -290,6 +303,13 @@ public abstract class BaseSpawner {
|
||||
this.spawnRange = nbt.getShort("SpawnRange");
|
||||
}
|
||||
|
||||
+ // Plazma start - Add entity spawn deadlock timer
|
||||
+ if (nbt.contains("Plazma.SpawnerTicks", 99)) {
|
||||
+ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks");
|
||||
+ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked");
|
||||
+ }
|
||||
+ // Plazma end - Add entity spawn deadlock timer
|
||||
+
|
||||
this.displayEntity = null;
|
||||
}
|
||||
|
||||
@@ -318,6 +338,8 @@ public abstract class BaseSpawner {
|
||||
}));
|
||||
}
|
||||
|
||||
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Add entity spawn deadlock timer
|
||||
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Add entity spawn deadlock timer
|
||||
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).getOrThrow());
|
||||
return nbt;
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index b047af738236be3400d07d46c663017ed39b6f96..6c9c28ae5fbe62ba647e7790acccb377d1e62490 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -51,6 +51,14 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public SpawnDeadlockTimer spawnDeadlockTimer;
|
||||
+ public class SpawnDeadlockTimer extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = OPTIMIZE;
|
||||
+ public int timerTimeout = 0;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
public Block block;
|
||||
@@ -1,151 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 28 Sep 2023 11:47:50 +0900
|
||||
Subject: [PATCH] Implement No Chat Reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 40f51062624161892c780ddae05e22859e2cd021..b0b515b8ebeffe25a760d7d6faa87cbc1a585b2d 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -139,9 +139,13 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
|
||||
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
|
||||
|
||||
- this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
|
||||
- return new EncoderException("Failed to encode: " + s + " " + value);
|
||||
- })));
|
||||
+ // Plazma start - Implement No Chat Reports
|
||||
+ JsonElement element = Util.getOrThrow(dataresult, s -> new EncoderException("Failed to encode: " + s + " " + value));
|
||||
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC
|
||||
+ && org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.queryData())
|
||||
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
|
||||
+ this.writeUtf(GSON.toJson(element));
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <T> void writeId(IdMap<T> registry, T value) {
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
index b8c1f3b9afddc87d56541c8af63cffecfcdd2653..4f0d6ac849dda74c9180fa03d97d389cc4554b46 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
@@ -24,4 +24,13 @@ public record ServerboundChatCommandPacket(String command, Instant timeStamp, lo
|
||||
public void handle(ServerGamePacketListener listener) {
|
||||
listener.handleChatCommand(this);
|
||||
}
|
||||
+
|
||||
+ // Plazma start - Implement No Chat Reports
|
||||
+ @Override
|
||||
+ public ArgumentSignatures argumentSignatures() {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled)
|
||||
+ return ArgumentSignatures.EMPTY;
|
||||
+ return this.argumentSignatures;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
index d1d2fc0c57523c1abf1e8bfec913c78927c3dafc..b32e17ef1d7d65f2e3cf4fb5471d8182b3ba892f 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
|
||||
@@ -25,4 +25,12 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
|
||||
public void handle(ServerGamePacketListener listener) {
|
||||
listener.handleChat(this);
|
||||
}
|
||||
+
|
||||
+ // Plazma start - Implement No Chat Reports
|
||||
+ @Override
|
||||
+ public @Nullable MessageSignature signature() {
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return null;
|
||||
+ return this.signature;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||
index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..4d9f73add791cef03cc7aeaf1598a73c2195809a 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
|
||||
@@ -16,6 +16,15 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess
|
||||
|
||||
@Override
|
||||
public void handle(ServerGamePacketListener listener) {
|
||||
+ // Plazma start - Implement No Chat Reports
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation()) {
|
||||
+ ((net.minecraft.server.network.ServerGamePacketListenerImpl) listener).disconnect(
|
||||
+ net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation.message),
|
||||
+ org.bukkit.event.player.PlayerKickEvent.Cause.NCR_NOT_INSTALLED
|
||||
+ );
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
listener.handleChatSessionUpdate(this);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 879c090d9c4574a2cd45a0eb1bf9cb171834d940..d6e8d96372d4212c72a50602207075ccd3f5062d 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -683,6 +683,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
public boolean enforceSecureProfile() {
|
||||
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
|
||||
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return false; // Plazma - Implement No Chat Reports
|
||||
return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.profileKeySignatureValidator() != null;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 6f6228edfe77668552a40a814ab3cebd74c4cb5a..22f26761965d3c03b109939585ff528d382eab21 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -270,6 +270,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
}
|
||||
|
||||
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
||||
+ // Plazma start - Implement No Chat Reports
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToSystemMessage()
|
||||
+ && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket p) {
|
||||
+ this.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(null, Component.Serializer.toJson(p.chatType().resolve(this.player.level().registryAccess()).get().decorate(p.unsignedContent() != null ? p.unsignedContent() : Component.literal(p.body().content()))), false), null);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
// CraftBukkit start
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 58cc1bed851994fb591e9b832b98d25eda153b47..4fbe96813067d3ccf1d8f29151ac3fac0840d76f 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1471,6 +1471,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return true; // Plazma - Implement No Chat Reports
|
||||
return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 5a62bffe495002b3bbf5fd995df135c5d174458a..989aa0aeb05a878945849adc6fb6663027e15927 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -55,4 +55,22 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean notSecurePrefix = true;
|
||||
|
||||
}
|
||||
+
|
||||
+ public NoChatReports noChatReports;
|
||||
+ public class NoChatReports extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = false;
|
||||
+ boolean queryData = true; public boolean queryData() { return this.enabled && this.queryData; }
|
||||
+ boolean convertToSystemMessage = true; public boolean convertToSystemMessage() { return this.enabled && this.convertToSystemMessage; }
|
||||
+ public boolean requireModInstallation() { return this.enabled && this.requireModInstallation.enabled; }
|
||||
+
|
||||
+ public RequireModInstallation requireModInstallation;
|
||||
+ public class RequireModInstallation extends ConfigurationPart {
|
||||
+
|
||||
+ boolean enabled = false;
|
||||
+ public String message = "You do not have No Chat Reports, and this server is configured to require it on client!";
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
}
|
||||
306
patches/server/0023-Lithium-HashedList.patch
Normal file
306
patches/server/0023-Lithium-HashedList.patch
Normal file
@@ -0,0 +1,306 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 10 Jan 2024 18:08:59 +0900
|
||||
Subject: [PATCH] Lithium - HashedList
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedReferenceList.java b/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedReferenceList.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d11579075e653868a43fe826bdf9b41ddc031b85
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedReferenceList.java
|
||||
@@ -0,0 +1,277 @@
|
||||
+package me.jellysquid.mods.lithium.common.util.collections;
|
||||
+
|
||||
+import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
|
||||
+import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
|
||||
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.*;
|
||||
+
|
||||
+/**
|
||||
+ * Wraps a {@link List} with a hash table which provides O(1) lookups for {@link Collection#contains(Object)}. The type
|
||||
+ * contained by this list must use reference-equality semantics.
|
||||
+ */
|
||||
+@SuppressWarnings("SuspiciousMethodCalls")
|
||||
+public class HashedReferenceList<T> implements List<T> {
|
||||
+ private final ReferenceArrayList<T> list;
|
||||
+ private final Reference2IntOpenHashMap<T> counter;
|
||||
+
|
||||
+ public HashedReferenceList(List<T> list) {
|
||||
+ this.list = new ReferenceArrayList<>();
|
||||
+ this.list.addAll(list);
|
||||
+
|
||||
+ this.counter = new Reference2IntOpenHashMap<>();
|
||||
+ this.counter.defaultReturnValue(0);
|
||||
+
|
||||
+ for (T obj : this.list) {
|
||||
+ this.counter.addTo(obj, 1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int size() {
|
||||
+ return this.list.size();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isEmpty() {
|
||||
+ return this.list.isEmpty();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean contains(Object o) {
|
||||
+ return this.counter.containsKey(o);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull Iterator<T> iterator() {
|
||||
+ return this.listIterator();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Object @NotNull [] toArray() {
|
||||
+ return this.list.toArray();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public <T1> T1 @NotNull [] toArray(T1 @NotNull [] a) {
|
||||
+ return this.list.toArray(a);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean add(T t) {
|
||||
+ this.trackReferenceAdded(t);
|
||||
+
|
||||
+ return this.list.add(t);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean remove(Object o) {
|
||||
+ this.trackReferenceRemoved(o);
|
||||
+
|
||||
+ return this.list.remove(o);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean containsAll(Collection<?> c) {
|
||||
+ for (Object obj : c) {
|
||||
+ if (!this.counter.containsKey(obj)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean addAll(Collection<? extends T> c) {
|
||||
+ for (T obj : c) {
|
||||
+ this.trackReferenceAdded(obj);
|
||||
+ }
|
||||
+
|
||||
+ return this.list.addAll(c);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean addAll(int index, Collection<? extends T> c) {
|
||||
+ for (T obj : c) {
|
||||
+ this.trackReferenceAdded(obj);
|
||||
+ }
|
||||
+
|
||||
+ return this.list.addAll(index, c);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean removeAll(@NotNull Collection<?> c) {
|
||||
+ if (this.size() >= 2 && c.size() > 4 && c instanceof List) {
|
||||
+ //HashReferenceList uses reference equality, so using ReferenceOpenHashSet is fine
|
||||
+ c = new ReferenceOpenHashSet<>(c);
|
||||
+ }
|
||||
+ this.counter.keySet().removeAll(c);
|
||||
+ return this.list.removeAll(c);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean retainAll(@NotNull Collection<?> c) {
|
||||
+ this.counter.keySet().retainAll(c);
|
||||
+ return this.list.retainAll(c);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void clear() {
|
||||
+ this.counter.clear();
|
||||
+ this.list.clear();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public T get(int index) {
|
||||
+ return this.list.get(index);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public T set(int index, T element) {
|
||||
+ T prev = this.list.set(index, element);
|
||||
+
|
||||
+ if (prev != element) {
|
||||
+ if (prev != null) {
|
||||
+ this.trackReferenceRemoved(prev);
|
||||
+ }
|
||||
+
|
||||
+ this.trackReferenceAdded(element);
|
||||
+ }
|
||||
+
|
||||
+ return prev;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void add(int index, T element) {
|
||||
+ this.trackReferenceAdded(element);
|
||||
+
|
||||
+ this.list.add(index, element);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public T remove(int index) {
|
||||
+ T prev = this.list.remove(index);
|
||||
+
|
||||
+ if (prev != null) {
|
||||
+ this.trackReferenceRemoved(prev);
|
||||
+ }
|
||||
+
|
||||
+ return prev;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int indexOf(Object o) {
|
||||
+ return this.list.indexOf(o);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int lastIndexOf(Object o) {
|
||||
+ return this.list.lastIndexOf(o);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull ListIterator<T> listIterator() {
|
||||
+ return this.listIterator(0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull ListIterator<T> listIterator(int index) {
|
||||
+ return new ListIterator<>() {
|
||||
+ private final ListIterator<T> inner = HashedReferenceList.this.list.listIterator(index);
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasNext() {
|
||||
+ return this.inner.hasNext();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public T next() {
|
||||
+ return this.inner.next();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasPrevious() {
|
||||
+ return this.inner.hasPrevious();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public T previous() {
|
||||
+ return this.inner.previous();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextIndex() {
|
||||
+ return this.inner.nextIndex();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int previousIndex() {
|
||||
+ return this.inner.previousIndex();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void remove() {
|
||||
+ int last = this.previousIndex();
|
||||
+
|
||||
+ if (last == -1) {
|
||||
+ throw new NoSuchElementException();
|
||||
+ }
|
||||
+
|
||||
+ T prev = HashedReferenceList.this.get(last);
|
||||
+
|
||||
+ if (prev != null) {
|
||||
+ HashedReferenceList.this.trackReferenceRemoved(prev);
|
||||
+ }
|
||||
+
|
||||
+ this.inner.remove();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void set(T t) {
|
||||
+ int last = this.previousIndex();
|
||||
+
|
||||
+ if (last == -1) {
|
||||
+ throw new NoSuchElementException();
|
||||
+ }
|
||||
+
|
||||
+ T prev = HashedReferenceList.this.get(last);
|
||||
+
|
||||
+ if (prev != t) {
|
||||
+ if (prev != null) {
|
||||
+ HashedReferenceList.this.trackReferenceRemoved(prev);
|
||||
+ }
|
||||
+
|
||||
+ HashedReferenceList.this.trackReferenceAdded(t);
|
||||
+ }
|
||||
+
|
||||
+ this.inner.remove();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void add(T t) {
|
||||
+ HashedReferenceList.this.trackReferenceAdded(t);
|
||||
+
|
||||
+ this.inner.add(t);
|
||||
+ }
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull List<T> subList(int fromIndex, int toIndex) {
|
||||
+ return this.list.subList(fromIndex, toIndex);
|
||||
+ }
|
||||
+
|
||||
+ private void trackReferenceAdded(T t) {
|
||||
+ this.counter.addTo(t, 1);
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ private void trackReferenceRemoved(Object o) {
|
||||
+ if (this.counter.addTo((T) o, -1) <= 1) {
|
||||
+ this.counter.removeInt(o);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/util/random/WeightedRandomList.java b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
|
||||
index ef44047c3ea850fe52370b8176efbdf0515d20d6..30efa8704c1ae94027272602687cbc4a2bc8a772 100644
|
||||
--- a/src/main/java/net/minecraft/util/random/WeightedRandomList.java
|
||||
+++ b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
|
||||
@@ -10,10 +10,10 @@ import net.minecraft.util.RandomSource;
|
||||
|
||||
public class WeightedRandomList<E extends WeightedEntry> {
|
||||
private final int totalWeight;
|
||||
- private final ImmutableList<E> items;
|
||||
+ private final List<E> items; // Plazma - Lithium: collections.mob_spawning
|
||||
|
||||
WeightedRandomList(List<? extends E> entries) {
|
||||
- this.items = ImmutableList.copyOf(entries);
|
||||
+ this.items = entries.size() > 4 ? ImmutableList.copyOf(entries) : java.util.Collections.unmodifiableList(new me.jellysquid.mods.lithium.common.util.collections.HashedReferenceList<>(entries)); // Plazma - Lithium: collections.mob_spawning
|
||||
this.totalWeight = WeightedRandom.getTotalWeight(entries);
|
||||
}
|
||||
|
||||
18
patches/server/0024-Improve-SwingTime-ticking.patch
Normal file
18
patches/server/0024-Improve-SwingTime-ticking.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 10 Jan 2024 18:11:03 +0900
|
||||
Subject: [PATCH] Improve SwingTime ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 18648eed57dca05d89692064dcf4aa3172cd5914..bf5633f387e268191e2a33be2dcec6c514c0766f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2771,6 +2771,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
+ if (!this.swinging && this.swingTime == 0) return; // Plazma - Improve SwingTime ticking
|
||||
int i = this.getCurrentSwingDuration();
|
||||
|
||||
if (this.swinging) {
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 28 Sep 2023 12:33:14 +0900
|
||||
Subject: [PATCH] Improve biome temperature cache
|
||||
|
||||
|
||||
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..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
@@ -67,7 +67,7 @@ public final class Biome {
|
||||
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 - Improve BiomeTemperatureCache
|
||||
return Util.make(() -> {
|
||||
/*
|
||||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||
@@ -125,7 +125,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 - Improve BiomeTemperatureCache
|
||||
float f = cache.getValue(l);
|
||||
if (!Float.isNaN(f)) {
|
||||
return f;
|
||||
@@ -1,91 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 29 Sep 2023 21:10:26 +0900
|
||||
Subject: [PATCH] Implement FixMySpawnR
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7494d8477 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -46,6 +46,8 @@ public abstract class BaseSpawner {
|
||||
public int requiredPlayerRange = 16;
|
||||
public int spawnRange = 4;
|
||||
private int tickDelay = 0; // Paper
|
||||
+ private int blockExistsTick = 0; // Plazma - Implement FixMySpawnR
|
||||
+ private boolean blockLockedByTime = false; // Plazma - Implement FixMySpawnR
|
||||
|
||||
public BaseSpawner() {}
|
||||
|
||||
@@ -81,6 +83,17 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
public void serverTick(ServerLevel world, BlockPos pos) {
|
||||
+ // Plazma start - Implement FixMySpawnR
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.enabled) {
|
||||
+ if (!this.blockLockedByTime) {
|
||||
+ if (this.blockExistsTick > org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.timerTimeout)
|
||||
+ blockLockedByTime = true;
|
||||
+ else blockExistsTick++;
|
||||
+ }
|
||||
+
|
||||
+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
||||
// Paper start - Configurable mob spawner tick rate
|
||||
if (spawnDelay > 0 && --tickDelay > 0) return;
|
||||
@@ -286,6 +299,14 @@ public abstract class BaseSpawner {
|
||||
this.spawnRange = nbt.getShort("SpawnRange");
|
||||
}
|
||||
|
||||
+ // Plazma start - Implement FixMySpawnR
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.enabled
|
||||
+ && nbt.contains("Plazma.SpawnerTicks", 99)) {
|
||||
+ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks");
|
||||
+ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked");
|
||||
+ }
|
||||
+ // Plazma end
|
||||
+
|
||||
this.displayEntity = null;
|
||||
}
|
||||
|
||||
@@ -314,6 +335,9 @@ public abstract class BaseSpawner {
|
||||
}));
|
||||
}
|
||||
|
||||
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Implement FixMySpawnR
|
||||
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Implement FixMySpawnR
|
||||
+
|
||||
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
|
||||
return nbt;
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 989aa0aeb05a878945849adc6fb6663027e15927..d17df5621717b1c8d1d9a5549feb73c3600ecf3d 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -40,6 +40,24 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public GameMechanics gameMechanics;
|
||||
+ public class GameMechanics extends ConfigurationPart {
|
||||
+
|
||||
+ public Spawning spawning;
|
||||
+ public class Spawning extends ConfigurationPart {
|
||||
+
|
||||
+ public DeadlockTimer deadlockTimer;
|
||||
+ public class DeadlockTimer extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+ public int timerTimeout = 0;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
public Player player;
|
||||
public class Player extends ConfigurationPart {
|
||||
|
||||
152
patches/server/0025-Save-Json-list-asynchronously.patch
Normal file
152
patches/server/0025-Save-Json-list-asynchronously.patch
Normal file
@@ -0,0 +1,152 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 11 Jan 2024 13:40:41 +0900
|
||||
Subject: [PATCH] Save Json list asynchronously
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
||||
index 22c4f8dea99f92a1eb3da2baf0a15bf9d2ca0462..20c531f11b310dab0a867e589c769393ed835df5 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
||||
@@ -58,21 +58,23 @@ public class DedicatedPlayerList extends PlayerList {
|
||||
this.loadWhiteList();
|
||||
}
|
||||
|
||||
+ // Plazma start - Save JSON list asynchronously
|
||||
private void saveIpBanList() {
|
||||
- try {
|
||||
- this.getIpBans().save();
|
||||
- } catch (IOException var2) {
|
||||
- LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
|
||||
- }
|
||||
+ this.getIpBans().save();
|
||||
}
|
||||
|
||||
private void saveUserBanList() {
|
||||
- try {
|
||||
- this.getBans().save();
|
||||
- } catch (IOException var2) {
|
||||
- LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
|
||||
- }
|
||||
+ this.getBans().save();
|
||||
+ }
|
||||
+
|
||||
+ private void saveOps() {
|
||||
+ this.getOps().save();
|
||||
+ }
|
||||
+
|
||||
+ private void saveWhiteList() {
|
||||
+ this.getWhiteList().save();
|
||||
}
|
||||
+ // Plazma end - Save JSON list asynchronously
|
||||
|
||||
private void loadIpBanList() {
|
||||
try {
|
||||
@@ -98,14 +100,6 @@ public class DedicatedPlayerList extends PlayerList {
|
||||
}
|
||||
}
|
||||
|
||||
- private void saveOps() {
|
||||
- try {
|
||||
- this.getOps().save();
|
||||
- } catch (Exception var2) {
|
||||
- LOGGER.warn("Failed to save operators list: ", (Throwable)var2);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
private void loadWhiteList() {
|
||||
try {
|
||||
this.getWhiteList().load();
|
||||
@@ -114,14 +108,6 @@ public class DedicatedPlayerList extends PlayerList {
|
||||
}
|
||||
}
|
||||
|
||||
- private void saveWhiteList() {
|
||||
- try {
|
||||
- this.getWhiteList().save();
|
||||
- } catch (Exception var2) {
|
||||
- LOGGER.warn("Failed to save white-list: ", (Throwable)var2);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
@Override
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
return !this.isUsingWhitelist() || this.isOp(profile) || this.getWhiteList().isWhiteListed(profile);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
index c038da20b76c0b7b1c18471b20be01e849d29f3a..0735a0bd182635e1969d19336b46bc72b14e555f 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
@@ -42,13 +42,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
|
||||
public void add(V entry) {
|
||||
this.map.put(this.getKeyForUser(entry.getUser()), entry);
|
||||
-
|
||||
- try {
|
||||
- this.save();
|
||||
- } catch (IOException ioexception) {
|
||||
- StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
|
||||
- }
|
||||
-
|
||||
+ this.save(); // Plazma - Save Json list asynchronously
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -62,13 +56,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
|
||||
public void remove(K key) {
|
||||
this.map.remove(this.getKeyForUser(key));
|
||||
-
|
||||
- try {
|
||||
- this.save();
|
||||
- } catch (IOException ioexception) {
|
||||
- StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
|
||||
- }
|
||||
-
|
||||
+ this.save(); // Plazma - Save Json list asynchronously
|
||||
}
|
||||
|
||||
public void remove(StoredUserEntry<K> entry) {
|
||||
@@ -102,7 +90,9 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
return this.map.values();
|
||||
}
|
||||
|
||||
- public void save() throws IOException {
|
||||
+ // Plazma start - Save Json list asynchronously
|
||||
+ public void save()/* throws IOException*/ {
|
||||
+ io.papermc.paper.util.MCUtil.scheduleAsyncTask(() -> {
|
||||
this.removeExpired(); // Paper - remove expired values before saving
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
|
||||
@@ -114,27 +104,16 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
|
||||
Objects.requireNonNull(jsonarray);
|
||||
stream.forEach(jsonarray::add);
|
||||
- BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
|
||||
|
||||
- try {
|
||||
+ try (BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8)) {
|
||||
StoredUserList.GSON.toJson(jsonarray, StoredUserList.GSON.newJsonWriter(bufferedwriter));
|
||||
- } catch (Throwable throwable) {
|
||||
- if (bufferedwriter != null) {
|
||||
- try {
|
||||
- bufferedwriter.close();
|
||||
- } catch (Throwable throwable1) {
|
||||
- throwable.addSuppressed(throwable1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- throw throwable;
|
||||
- }
|
||||
-
|
||||
- if (bufferedwriter != null) {
|
||||
- bufferedwriter.close();
|
||||
+ } catch (IOException e) {
|
||||
+ StoredUserList.LOGGER.warn("Failed to asynchronously save file " + this.file, e);
|
||||
}
|
||||
|
||||
+ });
|
||||
}
|
||||
+ // Plazma end - Save Json list asynchronously
|
||||
|
||||
public void load() throws IOException {
|
||||
if (this.file.exists()) {
|
||||
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 29 Sep 2023 21:12:38 +0900
|
||||
Subject: [PATCH] Configurable 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 fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f..4710f85197bc80e554cc1b2b84058c8dc8049c1f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -938,10 +938,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
// Paper end
|
||||
//this.level().getProfiler().push("sensing"); // Purpur
|
||||
- this.sensing.tick();
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
int i = this.level().getServer().getTickCount() + this.getId();
|
||||
|
||||
+ if (i % this.level().plazmaLevelConfiguration().entity.sensorTick == 0) this.sensing.tick(); // Plazma - moved down
|
||||
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/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index bb0f561f0b0d71697de52c834d2ed1798b2022df..6711b3d93eb5292314bcd89280d88f367eada9df 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ public int sensorTick = DO_OPTIMIZE ? 10 : 1;
|
||||
+
|
||||
public boolean ignoreUselessPackets = DO_OPTIMIZE;
|
||||
|
||||
public Player player;
|
||||
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 6 May 2024 12:25:59 +0900
|
||||
Subject: [PATCH] Use Akair's flag when running the test server with gradle
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index c45f40170cbdc03df31451d2c30a877f8d8f26af..c701448401cc12eeee3f097dc48d3ab1b36b2632 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -133,7 +133,7 @@ fun TaskContainer.registerRunTask(
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
vendor.set(JvmVendorSpec.JETBRAINS)
|
||||
})
|
||||
- jvmArgs("-DPlazma.DevelopmentEnvironment", "-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods") // Plazma - Always agree EULA on development mode
|
||||
+ jvmArgs("-DPlazma.DevelopmentEnvironment", "--add-modules=jdk.incubator.vector", "-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods", "-XX:+UseG1GC", "-XX:+ParallelRefProcEnabled", "-XX:MaxGCPauseMillis=200", "-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC", "-XX:+AlwaysPreTouch", "-XX:G1HeapWastePercent=5", "-XX:G1MixedGCCountTarget=4", "-XX:InitiatingHeapOccupancyPercent=15", "-XX:G1MixedGCLiveThresholdPercent=90", "-XX:G1RSetUpdatingPauseTimePercent=5", "-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem", "-XX:MaxTenuringThreshold=1", "-Dusing.aikars.flags=https://mcflags.emc.gs", "-Daikars.new.flags=true", "-XX:G1NewSizePercent=40", "-XX:G1MaxNewSizePercent=50", "-XX:G1HeapRegionSize=16M", "-XX:G1ReservePercent=15") // Plazma - Always agree EULA on development mode; Use Akair's flag when running the test server with gradle
|
||||
|
||||
if (rootProject.childProjects["test-plugin"] != null) {
|
||||
val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user