Compare commits

...

24 Commits

Author SHA1 Message Date
Alpha
66cc466648 Fix build (#81)
* Fix build, again

* real fix
2024-01-18 23:27:03 +09:00
Alpha
0309438d9f Add Upstream updaters in buildscript (#78)
* Use libs.versions.toml

* Use libs.versions.toml

* Add update upstream tasks

* Some cleanup
2024-01-18 18:22:48 +09:00
Alpha
e071249ed1 Cleanup (ver/1.20.2) (#77)
* Cleanup README.md

Signed-off-by: Alpha <dev@alpha93.kr>

* what

Signed-off-by: Alpha <dev@alpha93.kr>

* Remove unused files

---------

Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-15 18:48:48 +09:00
AlphaKR93
d4cbc57b49 oops 2024-01-11 18:11:39 +09:00
AlphaKR93
dc0856ca65 [CI-Skip] Cleanup patches 2024-01-11 18:10:40 +09:00
AlphaKR93
b009259293 Async PathProcessing 2024-01-11 18:07:18 +09:00
AlphaKR93
2008ba2d54 Fix build, again 2024-01-11 00:15:26 +09:00
AlphaKR93
fad453c120 Fix build 2024-01-11 00:09:25 +09:00
AlphaKR93
7b62b795ae More rebranding 2024-01-10 23:56:47 +09:00
AlphaKR93
e5292079fb Add option to disable startup warning 2024-01-10 18:23:20 +09:00
AlphaKR93
e9b2902304 Fix workflow 2024-01-10 18:18:56 +09:00
AlphaKR93
1b3cb0dc53 Add some optimizations 2024-01-10 18:14:57 +09:00
Alpha
d1572993db Improve Release script
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-10 14:53:52 +09:00
Alpha
1474b31ba5 [CI-Skip] Improve Gradle test action
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-10 14:51:38 +09:00
Alpha
11c340c828 [CI-Skip] [CheckSkip] Fix download lInk
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-10 14:46:04 +09:00
AlphaKR93
9502ebf684 Reduce allocations 2024-01-10 13:20:08 +09:00
Alpha
96ef8b9e4d Change JDK version
Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-30 18:54:48 +09:00
Alpha
9889ed9b5b Update build.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-09 15:49:36 +09:00
Alpha
db9b36463c Update build.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-09 15:44:26 +09:00
Alpha
1764af50d7 Fix workflow
Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-09 12:59:07 +09:00
Alpha
922c33171c Rewrite Configuration (#60)
* work

* work

* more work

* complete configuration base

* More work

* more work

* Configurable cave lava sea level, Fix MC-237017

* more more more work

* Updated Upstream (Paper, Pufferfish, Purpur)

* Rework, again

* Cleanup workflows, fix build

* typo

* more work

* more work

- Updated Upstream (Paper)
- [CI-Skip] Update Upstream CacheData (Pufferfish, Purpur)
- Update Dependencies (Paperweight)
- Fix build
- Update Wrapper

* more works

* more more works

* Fix build

* Fix test

* Implemented FixMySpawnR, Added more config optimize

* Fix build
2023-12-09 11:22:36 +09:00
github-actions[bot]
3c625b1141 [CI-Skip] Updated Dependencies ()
Dependency has released updates that appear to apply and compile correctly
2023-11-09 19:47:37 +00:00
Alpha
fa6429f5b6 [CI-Skip] Improve README.md
Signed-off-by: Alpha <dev@alpha93.kr>
2023-10-26 11:21:04 +09:00
github-actions[bot]
ddc4aeedc0 [CI-Skip] Updated Dependencies (Wrapper)
Dependency has released updates that appear to apply and compile correctly

Wrapper Changes:
gradle/gradle@6391363 Merge pull request #26166 docs: Update documentation to reflect actual plugin behavior
gradle/gradle@9030bdf Merge pull request #26172 Fix scheduling of finalizers after last finalized task
gradle/gradle@92be687 Merge pull request #26080 Fix always ignored tests
gradle/gradle@dbf63af Merge pull request #26171 Disable another shellcheck related to `ulimit` command
gradle/gradle@5d2baec Fix failing kotlin-dsl-tooling-builder
gradle/gradle@a84a3c4 Apply review comments for auto-discover of UpgradedProperty
gradle/gradle@d904025 Bump CC report to 1.3
gradle/gradle@d92f591 Update verification metadata
gradle/gradle@ac5d11f Merge pull request #26165 Auto-discover classes with UpgradedProperty annotation
gradle/gradle@a187850 Migrate some JVM language projects to JVM platform
gradle/gradle@a7e4e0c Remove unnecessary project entries from CODEOWNERS
gradle/gradle@975ecb5 Merge pull request #26187 Migrate some JVM language projects to JVM platform
gradle/gradle@6f04ab3 Refactor variant selection failure handing to route failures through a processor class
gradle/gradle@d5b6949 Refactor configuration selection failure exception hierarchy
gradle/gradle@548a400 Add documentation and rename type for clarity and consistency
gradle/gradle@84cf08b Route configuration selection failures through the failure processor as well
gradle/gradle@74db2fc Route no matching capabilities exception through the failure handler
gradle/gradle@7f25dc1 Clean test problems utility
gradle/gradle@4ba9786 Update imports to match new location
gradle/gradle@b0a3c26 Remove dead code and revert unnecessary changes from code review
gradle/gradle@e46cc5f Delete unused imports
gradle/gradle@25e2266 Commenting out usage of Problems API for now
gradle/gradle@dcabd52 Replace interface with static util class
gradle/gradle@dfd373b Merge pull request #26168 Refactor variant selection failure handing to route failures through a handler class
gradle/gradle@db7726d Moves tests for the groovy compiler toolchains into the language-groovy project
gradle/gradle@b1bc3f3 Merge pull request #26186 Moves test for the groovy compiler toolchains into the language-groovy project
gradle/gradle@265d7c3 Allow variant reselection to reselect variants referenced by dependencies with artifacts
gradle/gradle@91ceb6d Add integ test for new functionality
gradle/gradle@cc89d78 Attempt to tune for performance
gradle/gradle@5b16c11 Attempt to futher improve performance by reducing allocations
gradle/gradle@cdfa506 Fail when attempting to reselect variant with explicitly declared artifact
gradle/gradle@51d9f2c Add test to verify artifact tasks are not resolved if artifacts are not selected
gradle/gradle@62a0360 Resolve review comments
gradle/gradle@1aa4040 Make test CC compatible
gradle/gradle@b6ccddc Do not throw exception when explicit artifact dependencies are reselected
gradle/gradle@49ef618 Remove lenient from test since it is not necessary
gradle/gradle@f017f2b Add tests to verify existing root component behavior
gradle/gradle@aa879c9 Apply review comment fixes
gradle/gradle@d6ada79 Do not manually implement dyanmic Groovy support for ScriptHandler. Let code generation do it
gradle/gradle@94e1a4d Merge pull request #26003 Add tests to verify existing root component behavior
gradle/gradle@9c252a3 Merge pull request #25515 Allow variant reselection to reselect variants referenced by dependencies with artifacts
gradle/gradle@24f5059 Merge pull request #26193 Fix failing kotlin-dsl-tooling-builder
gradle/gradle@b9c6f6a issues/25044: fix Instrumented.filesReadString(Path, String)
gradle/gradle@06bba76 Rebaseline performance test
gradle/gradle@faba00f Merge pull request #26117 Fix file content reading within zip archive
gradle/gradle@2c8d549 Format deprecation entries in build operation trace
gradle/gradle@0c72142 Merge pull request #26101 Format deprecation entries in build operation trace
gradle/gradle@28d4baf Fix dependency verification metadata
gradle/gradle@fab4b5f Merge branch 'master' into issue-24575
gradle/gradle@4b96963 Make Isolated Projects setting part of the CC key
gradle/gradle@ef732e8 Migrate integration tests for language-groovy to new home in platforms
gradle/gradle@1b052f8 Remove unused import
gradle/gradle@392566d Merge pull request #26194 Bump Configuration Cache report to 1.3
gradle/gradle@19cf1a1 Extend AnnotationProcessorFixture for use with "*" annotation type
gradle/gradle@b880466 Add test demonstrating the issue
gradle/gradle@786f84a Filter ModuleElement top level elements instead of taking a 'null' value
gradle/gradle@afa625b Test that involves Java Modules needs Java 9+
gradle/gradle@9f4ddea Add integ test for closure-based listeners in AbstractTestTask
gradle/gradle@de1752d Merge pull request #26205 Migrate integration tests for language-groovy to new home in platforms
gradle/gradle@1110e93 Clean up performance build directory at the beginning
gradle/gradle@e83fa0c Merge pull request #24592 Make scheduled executor service tasks robust against exceptions (#24575)
gradle/gradle@4161732 Merge pull request #26213 Clean up performance build directory at the beginning
gradle/gradle@24c59a1 Merge pull request #25644 Fix NPE in incremental compilation of projects with '*' annotation processor and 'module-info.java'
gradle/gradle@bfe8ccb Update foojay plugin version to 0.7.0
gradle/gradle@620bcf8 Update verification metadata
gradle/gradle@4d69f7b Revert "Update verification metadata"
gradle/gradle@1e95017 Beanify `DocLink`, so Kotlin/Groovy would use property accessors for them.
gradle/gradle@e512d34 Remove AGP 8.2.0-dev from test versions
gradle/gradle@e040897 Merge pull request #26184 Update foojay plugin version to 0.7.0
gradle/gradle@a390d39 Merge pull request #26216 Remove AGP 8.2.0-dev from test versions
gradle/gradle@937836a Cache default PgpSignatory when in-memory signing is used
gradle/gradle@96b18af Merge pull request #26210 Add integ test for closure-based listeners in AbstractTestTask
gradle/gradle@6275668 Don't fail TestLauncher execution when only tasks are configured
gradle/gradle@052634e Fix tests
gradle/gradle@eb89a9d Add a test for CC key equality depending on the Isolated Projects option
gradle/gradle@9ed6643 Add a javadoc to the CC start parameter
gradle/gradle@e4f9cd8 Merge pull request #26215 Beanify `DocLink`, so Kotlin/Groovy would use property accessors
gradle/gradle@6cbd12c Merge pull request #26204 Make Isolated Projects setting part of the Configuration Cache key
gradle/gradle@6293239 "Method can be static" inspection should be a weak warning in IntelliJ
gradle/gradle@399ccbc Print daemon log if it's not parse-able
gradle/gradle@5798918 Fix a typo in file permissions javadoc
gradle/gradle@c03e83f Merge pull request #26232 Fix a typo in file permissions javadoc
gradle/gradle@f525eb4 Make BuildLauncher and TestLauncher behavior more uniform
gradle/gradle@da3b134 Merge pull request #26230 from gradle/lptr/intellij/make-static-inspection-less-severe
gradle/gradle@5d56618 Merge pull request #24520 Don't fail TestLauncher execution when only tasks are configured
gradle/gradle@5019cf4 Initial spike of JDK 21 support
gradle/gradle@2716d33 Fix JavaVersionSpec
gradle/gradle@571df38 Update Scala cross-compile test
gradle/gradle@9ee92b9 Update test bucket json
gradle/gradle@c20204d Add 21 to JavaClassUtilTest
gradle/gradle@5b3ff6f Update Groovy 4 version for 21
gradle/gradle@91f6904 Revert change to KotlinTestFixturesIntegrationTest
gradle/gradle@a5f1aed Use java toolchain in generated convention plugin
gradle/gradle@a606fa6 Add test to verify toolchains are used in convention
gradle/gradle@ef6a429 Remove `@IgnoreIf`
gradle/gradle@d4fd9ab Merge pull request #26192 Remove `@IgnoreIf`
gradle/gradle@83c092e Merge pull request #26246 Update test bucket json
gradle/gradle@77e8234 Merge pull request #26231 Print daemon log if it's not parse-able
gradle/gradle@2ff00a5 Merge pull request #26200 Make BuildLauncher and TestLauncher behavior more uniform
gradle/gradle@a939d6c Locate java toolchain tests in language-java project
gradle/gradle@10608c2 Bump Kotlin to 1.9.10
gradle/gradle@103e642 Fix update versions tasks
gradle/gradle@c178d77 Update kotlin-dsl version
gradle/gradle@b913550 Update CC docs so EAR shows as compatible
gradle/gradle@3e9d4e6 Merge pull request #26259 Update CC docs so EAR shows as compatible
gradle/gradle@6356a4a Merge pull request #26254 Locate java toolchain tests in language-java project
gradle/gradle@7827a61 Merge pull request #26237 Bump Kotlin to 1.9.10
gradle/gradle@2eb3186 Re-ignore failing native test on macOS
gradle/gradle@b734d19 Merge pull request #26260 Re-ignore failing native test on macOS
gradle/gradle@4f4e22d Update wrapper with recent nightly
gradle/gradle@1fd0b63 Merge pull request #26262 Update wrapper with recent nightly
gradle/gradle@8711488 Use isolated daemons in AbstractCompilerContinuousIntegrationTest
gradle/gradle@14a5248 Merge commit '1fd0b632a437ae771718982ef2aa1c3b52ee2f0f' into release
gradle/gradle@76102ac Disable trace file for TD
gradle/gradle@81283b7 Merge pull request #26264 Use isolated daemons in AbstractCompilerContinuousIntegrationTest
gradle/gradle@cb8fc83 Fix hanging `JavaProcessStackTracesMonitor` issue
gradle/gradle@1556882 Bump IVY version and adapt the code
gradle/gradle@2cc3977 Fix incorrect storage of extra info
gradle/gradle@2e14287 Replace serialization with DataInputStream
gradle/gradle@f329b9a Fix failing tests
gradle/gradle@38aa64a Make lenient copy of Ivy helper
gradle/gradle@e9227a7 Bump Ivy version further, clean up revert some verification changes
gradle/gradle@4ed14a7 Fix closure control flow tracking when closure calls throw exceptions
gradle/gradle@b221b79 Improve readability of instrumentation code for closure exceptions and the test
gradle/gradle@53d49e1 Add documentation to utility class
gradle/gradle@e2c5e7e Introduce `Path.takeFirstSegments`
gradle/gradle@04c9749 Introduce `TestLauncherCompositeBuildCrossVersionTest`
gradle/gradle@0a467e3 Adjust `TestLauncherCompositeBuildCrossVersionTest`
gradle/gradle@c684bed Let `TestLauncher` correctly find and configure included builds
gradle/gradle@4be993e Adjust `TestLauncherCompositeBuildCrossVersionTest`
gradle/gradle@8f6f4e8 Merge pull request #24506 Use java toolchain in generated convention plugin
gradle/gradle@4326d59 Polish `DefaultBuildLifecycleController`
gradle/gradle@01b9fbc Ensure `TestLauncher` can run tests from an included build subproject
gradle/gradle@2e1beea Merge pull request #26214 Add JDK 21 compiling and testing support
gradle/gradle@5f81c11 Add newer Java versions to cross-compile test
gradle/gradle@1947877 Merge pull request #26279 Fix hanging `JavaProcessStackTracesMonitor` issue
gradle/gradle@fa9f4eb Merge pull request #26220 Cache default PgpSignatory when in-memory signing is used
gradle/gradle@e9746a1 Improve TODO message a bit
gradle/gradle@d6b7e15 Replace TODO with an issue link
gradle/gradle@f53a469 Move `TestLauncherCompositeBuildCrossVersionTest` to `r84` package
gradle/gradle@61f91c4 Polish `ConfigurationCacheState`
gradle/gradle@7ed8d86 Merge pull request #26243 Let `TestLauncher` correctly find and configure tasks from included builds
gradle/gradle@a0d10e7 Merge pull request #26295 Cherry-pick #26207 Fix closure control flow tracking when closure calls throw exceptions
gradle/gradle@5b05191 Merge pull request #26291 Add newer Java versions to cross-compile test
gradle/gradle@2675622 Improve deprecated configuration role warning URL
gradle/gradle@329382c Merge pull request #26150 Bump IVY version and adapt the code
gradle/gradle@e8b3e67 Update versions of smoke tested plugins
gradle/gradle@c363b85 Merge pull request #26275 Update versions of smoke tested plugins
gradle/gradle@554ae52 Revise wording based on review
gradle/gradle@253a519 Merge pull request #26304 Improve deprecated configuration role warning URL
gradle/gradle@3a4bb33 Iterate through attribute keys added by attributeProvider in insertion order
gradle/gradle@f0bb13e Add test that reproduces similar behavior as #26298
gradle/gradle@6155cbb Allow attribute values to cause the realization of other attribute values
gradle/gradle@0afdf33 Do not allow Providers of attribute values to add new attributes to the container
gradle/gradle@c4d82b5 Fix missing spread operator on wrapped call to files(Object...) in Kotlin scripts
gradle/gradle@fe37524 Revise tests based on feedback
gradle/gradle@1272f0f Merge pull request #26317 Fix missing spread operator on wrapped call to files(Object...) in Kotlin scripts
gradle/gradle@eb5aa20 Merge pull request #26315 Avoid side effect of evaluating Provider values in an attribute container causing the container to become inconsistent
gradle/gradle@cf29286 Fix CODEOWNERS for renamed Configuration Cache team
gradle/gradle@39223a2 Merge pull request #26326 Fix CODEOWNERS for CC team
gradle/gradle@255e5a4 Fix permissions for a file copied from symlink
gradle/gradle@bed09fb minor CopyPermissionsIntegrationTest reading improvements
gradle/gradle@7bbd5f0 Merge pull request #26273 Fix permissions for file copied from symlink
gradle/gradle@8acbb1b Remove release-specific information from TestKit documentation
gradle/gradle@f2ee3af Merge pull request #26331 Remove release-specific information from TestKit documentation
gradle/gradle@d48e817 Fix Gradle version in CC docs mentioning an inputs tracking change
gradle/gradle@3a00c9c Merge pull request #26335 (minor) Fix Gradle version in CC docs mentioning an inputs tracking change
gradle/gradle@eca0a92 Update to GE plugin 3.15
gradle/gradle@7654519 Fix sanityCheck
gradle/gradle@ca73763 Prepare release notes for 8.4 RC1
gradle/gradle@efa7fe9 Replace absolute link with a relative one
gradle/gradle@3fe2b62 Implement review changes
gradle/gradle@0d1bc90 Merge pull request #26364 Update to GE plugin 3.15
gradle/gradle@bbc9532 Remove incorrect incubating flag
gradle/gradle@ac4bc05 Add comment about property filter
gradle/gradle@f8eda9a Enable secure XML processing for Ivy descriptors
gradle/gradle@50ef055 Enable secure XML processing for Maven POM files
gradle/gradle@5930695 Enable secure XML processing for Maven toolchains.xml files
gradle/gradle@8c8bcfa Enable secure XML processing for Dependency Verification metadata files
gradle/gradle@6d85ddc Enable secure XML processing for XmlTransformer
gradle/gradle@127137b Extract all XML factories creation into XmlFactories
gradle/gradle@525a050 Add ArchUnit XmlFactoriesTest to prevent any new direct usage of XML factories
gradle/gradle@345ff6b Adjust XmlTransformerTest for not supporting external entities anymore
gradle/gradle@a45b6ba Add failure test case for Ivy descriptor with external entities
gradle/gradle@315ca74 Add failure test case for Maven POM with external entities
gradle/gradle@ef5601a Add failure test case for Maven toochains.xml with external entities
gradle/gradle@8570416 Add failure test case for Dependency Verification metadata file with external entities
gradle/gradle@3cd1376 Add failure test case for EAR descriptor DSL customized as DOM node with external entities
gradle/gradle@ffa4003 Mention EAR JEE 1.3 withXml { asElement() } potential breaking change in the upgrade guide
gradle/gradle@b7591e7 Apply improvements from Google Docs
gradle/gradle@cc15864 Merge pull request #26402 Enable secure processing of XML Files
gradle/gradle@ccc390e Update release features for 8.4
gradle/gradle@41be715 Update release notes following review
gradle/gradle@3e6f20d Merge pull request #26373 Prepare release notes for 8.4 RC1
gradle/gradle@3bb3217 Further release notes refinements
gradle/gradle@e338803 Do small renamings
gradle/gradle@af93d8f Do not warn about EAR plugin's incompatibility with CC on its doc page
gradle/gradle@f083e3a Add contributors to release notes
gradle/gradle@42422d2 Merge pull request #26432 Add 8.4 contributors to release notes
gradle/gradle@ebdfd04 Merge pull request #26431 Do not warn about EAR plugin's incompatibility with CC on its doc page
gradle/gradle@63c10ab Update wrapper after 8.4-rc-1 release
gradle/gradle@65e4a0b Merge pull request #26443 Update wrapper after 8.4-rc-1 release
gradle/gradle@63c3c2c Merge pull request #26411 Add build-level retry
gradle/gradle@9ae6124 Merge pull request #26444 Cherry-pick #26411 to release
gradle/gradle@78bb5db Increase docs distribution size limit
gradle/gradle@da3fe13 Merge pull request #26430 Rename a few elements of the Kotlin DSL Reference docs
gradle/gradle@bf04095 Add missing pattern for matching leaking java processes
gradle/gradle@c22e832 Update leaking Java process pattern and kill all Gradle processes when build is cancelled. (#26473)
gradle/gradle@32a53d4 Serialize `KotlinClosure*` instances to the configuration cache
gradle/gradle@430096d Merge pull request #26489 Serialize `KotlinClosure*` instances to the configuration cache
gradle/gradle@be0537c Add CLEAN_UP_PERFORMANCE_BUILD_DIR to performance test
gradle/gradle@f21cda2 Merge pull request #26497 Add CLEAN_UP_PERFORMANCE_BUILD_DIR to performance test
gradle/gradle@301d1cc Use `KillLeakingJavaProcesses` before performance tests
gradle/gradle@5f8dd10 Merge pull request #26450 Use `KillLeakingJavaProcesses` before performance tests
gradle/gradle@60e74c1 Add upgrade guide paragraph about XML failing parser configuration
gradle/gradle@b7d4565 Enhance XMLFactories error messages
gradle/gradle@ee868b7 Refine upgrade guide
gradle/gradle@3833711 Merge pull request #26508 Add upgrade guide paragraph about XML failing parser configuration
gradle/gradle@0890e9a Clarify configuration factory method release notes
gradle/gradle@21dd48a Merge pull request #26524 Clarify configuration factory method release notes
gradle/gradle@a90c31c Add missing coma in upgrade guide
gradle/gradle@f485d9f Update wrapper after 8.4-rc-2 release
gradle/gradle@af6859a Merge pull request #26545 Cobexer/release/wrapper update
gradle/gradle@a5870a2 Clean up version-control build dir on Windows
gradle/gradle@9caa7bf Ignore subproject directories that only have `build` subdirectories
gradle/gradle@db07f03 Update test bucket json
gradle/gradle@a743595 Update test bucket json
gradle/gradle@a555508 Merge pull request #26535 Refine upgrade guide
gradle/gradle@3a641a1 Restore deleted internal registerJvmLanguageSourceDirectory API
gradle/gradle@ce2e07c Restore integration test for registerJvmLanguageSourceDirectory
gradle/gradle@efa18f2 Merge pull request #26561 Restore deleted internal registerJvmLanguageSourceDirectory API
gradle/gradle@1383ade Merge pull request #26557 Refine KillLeakingJavaProcesses
gradle/gradle@b58d899 Merge pull request #26568 Cherry-pick #26557 to release
gradle/gradle@77b7b94 Release notes: Mention simpler property assignment in Kotlin dsl section
gradle/gradle@741c5dd Improve configuration role docs
gradle/gradle@c76bd3a Fix link to userguide to be relative
gradle/gradle@dabac9b Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@1af31be Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@1716aab Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@463c765 Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@dc67e5d Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@27fff57 Update subprojects/docs/src/docs/release/notes.md
gradle/gradle@fc5dd80 Merge pull request #26574 Release notes: Mention simpler property assignment in Kotlin dsl section
gradle/gradle@f1698ef Minor polishing of the configuration roles
gradle/gradle@805b516 Add details to compiler daemon section
gradle/gradle@7788100 Merge pull request #26576 Improve configuration role section in release notes
gradle/gradle@a26c047 Update wrapper to 8.4 rc3
gradle/gradle@36fe0e3 Merge pull request #26592 Update wrapper to 8.4 rc3
gradle/gradle@adbcd27 Final 8.4 release notes
gradle/gradle@e9251e5 Merge pull request #26625 Final 8.4 release notes
2023-10-04 21:16:11 +00:00
90 changed files with 7159 additions and 7105 deletions

40
.editorconfig Normal file
View File

@@ -0,0 +1,40 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=4
ij_any_block_comment_add_space = false
ij_any_block_comment_at_first_column = false
ij_any_line_comment_at_first_column = false
ij_any_line_comment_add_space = true
[*.tiny]
indent_style=tab
[*.bat]
end_of_line=crlf
[*.yml]
indent_size=2
[*.patch]
trim_trailing_whitespace=false
[*.java]
ij_continuation_indent_size = 4
ij_java_class_count_to_use_import_on_demand = 999999
ij_java_insert_inner_class_imports = false
ij_java_names_count_to_use_import_on_demand = 999999
ij_java_imports_layout = *,|,$*
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true
[test-plugin/**/*.java]
ij_java_use_fq_class_names = false
[Paper-Server/src/main/resources/data/**/*.json]
indent_size = 2
[paper-api-generator/generated/**/*.java]
ij_java_imports_layout = $*,|,*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

View File

@@ -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."

View File

@@ -2,15 +2,19 @@ name: Test Gradle build script
on:
push:
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
branches: [ "ver/*", "dev/*", "feat/**/*" ]
paths:
- "gradle-wrapper.*"
- "*.gradle.*"
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]')"

View File

@@ -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

View File

@@ -1,36 +1,39 @@
name: Build Plazma
name: Release Plazma (1.20.2)
on:
push:
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
branches: [ "ver/*", "dev/*", "feat/**/*" ]
paths:
- "**.patch"
workflow_dispatch:
env:
ORG_NAME: PlazmaMC
MC_VERSION: 1.20.2
MAIN_BRANCH: ver/1.20.1
DEBUG: 'false'
jobs:
release:
name: Release Plazma
strategy:
matrix:
base_jdk: [17]
graal: [latest]
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout pages
uses: actions/checkout@v3
- name: Checkout javadocs
uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: gh-pages
token: ${{ secrets.GH_PAT }}
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
@@ -38,9 +41,9 @@ jobs:
- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
with:
github-token: ${{ secrets.GH_PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }}
version: ${{ matrix.graal }}
version: latest
cache: 'gradle'
- name: Configure Git
@@ -71,11 +74,11 @@ jobs:
if: github.ref_name == env.MAIN_BRANCH
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GH_PAT }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace
- name: Upload Artifacts
if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/')
if: "!startsWith(github.ref_name, 'ver/')"
uses: actions/upload-artifact@v3
with:
name: Artifacts
@@ -85,34 +88,37 @@ jobs:
- name: Get Release Number
if: startsWith(github.ref_name, 'ver/')
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV
- name: Release Artifacts
if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v0.1.15
with:
title: "Release #${{ env.RELEASE }}"
automatic_release_tag: release-${{ env.RELEASE }}
repo_token: "${{ secrets.GH_PAT }}"
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: false
- name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v0.1.15
with:
title: "Release #${{ env.RELEASE }}"
automatic_release_tag: latest-${{ env.MC_VERSION }}
repo_token: "${{ secrets.GH_PAT }}"
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: false
- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v0.1.15
with:
title: "Development build for ${{ env.MC_VERSION }}"
automatic_release_tag: dev-${{ env.MC_VERSION }}
repo_token: "${{ secrets.GH_PAT }}"
name: "Development Build for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: true

View File

@@ -1,36 +0,0 @@
name: Test build with Normal JDK
on:
push:
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
workflow_dispatch:
jobs:
release:
strategy:
matrix:
jdk: [19.0.2+7]
java: ['temurin']
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.java }}
java-version: ${{ matrix.jdk }}
cache: 'gradle'
- name: Test build
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
./gradlew applyPatches --stacktrace
./gradlew build --stacktrace

1
.gitignore vendored
View File

@@ -33,7 +33,6 @@ target/
dependency-reduced-pom.xml
# various other potential build files
build/
bin/
dist/
manifest.mf

View File

@@ -1,2 +0,0 @@
purpurCommit = 6a6706d3b4f934845a44ecd7533bf53966e4857c
pufferfishCommit = 2c3f3fd4e1df97dc7ff8d770061138144847850e

View File

@@ -5,12 +5,11 @@
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
[![Discord](https://img.shields.io/discord/1083716853928558652?style=for-the-badge&logo=discord&logoColor=ffffff&label=DISCORD&color=5865F2&link=https%3A%2F%2Fdiscord.gg%2FMmfC52K8A8)](https://discord.gg/MmfC52K8A8)
[![Build Status](https://img.shields.io/github/actions/workflow/status/PlazmaMC/Plazma/build.yml?branch=ver/1.20.1&logo=GoogleAnalytics&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.1)
[![Upstream Status](https://img.shields.io/github/actions/workflow/status/PlazmaMC/AlwaysUpToDate/plazma.yml?label=Upstream&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2dW4hVVRiAl5OjCFoMlpYx2WXMXjShi5FFTxFhhmFlQxlRU0kEXQiJorKIMoIiIoJegiiK8pKWZBTUg0ZpaHYhslBL8TKVTWWO00x98XP%2BicNhzt5rnb3P2WvtWd%2FjzDl7r%2FX%2F6%2FrfjjGRSCQSiUQikUgkEolEIpGIJwDHAHOA24CngTXA18Bu4BDwN3AUOAh8D3wOrAOeBLqBWUB70f0ICuBE4E7gXaCP7PwBrARuAqYU3T8vAdqB64EPgSGaxz%2F6joUyu8xoBzgOWAbsofXs0ndPNKMNoA24EThA8ezTPWZ0zAjgIt1IfWMbMM%2BUfJ1f3uQ1Po894rnSnZyAU3WEhcInwGmmDMi0BnozCGMA2KT3ADlKXgycAnQAY4HxwAnA6fouWc%2BfBzYCgxne%2BwtwgQkZ4Fq9KLlyBHgDWARMyPD%2BDr2QvamXNlf%2BAuabENGOu47AvcD9wOQmtOck4FG9NbsgfbjBhARwneNm26eCn9CCtk0EHtdZ5qKE%2BSEdM12WndVifiignbKPvOfQzsPA%2BSaA006vw%2Fq6pOD2jgHucRgw0rfpxkeAccBWBzPAHOMJMrIdBs4q4yNqArbhG2Ca8QxgBrDTov0yW8YaD9d9m013O3C88RRgmoUS%2Fm3FYcHVafKVhfB%2FAk42ngOcCfyc0I9txieApZYb7mwTCMBc4M8R%2BiGz%2FHLjC8CxlhebHhMYVDZmcXEO8wOwwPgEcJ%2BF8FebgAGmAp3GU%2FPyjxZLj5%2Fn5tBRH24aDxTdztICfGBhzp1UdDtLiYR3WJz7Hyy6naUFuCNF%2BGJ7n1p0O0uLRp8l8bYpIcAkYAXwKfAl8EzLg700pETCApPoNiUD6KpjppCTYFczXjimzt%2FPThH%2BULVHS00VfhmvGhO%2BeOvqsTc3JWgw7AagXx3i7wBnVf2%2FJ0UBn%2BnnZgLr9RniUfoYOM%2BUT%2Fj5KUGFP5IN5Dexj%2BhnniKZF9WWIt%2BppT8kJWAv%2FHyUoCM%2FyW8rgl2V0oiXU6KaPzLlFH42JejmKiM0CRHsfrIx6HscJo0LP7MSXCIFGkWU3GbKK%2FzGlaAZKM1mnSm%2F8BtTAnBGnc0zL%2BTZM8zoEH7DSpibU2rQiJu48RAqUXPNTBLZ4xT71AQleCt8AXid5vOacSFHJfgu%2FLYWHT4O17MuNFMJXgu%2FKqBMEjOy8Kve%2BNNMNO4mmQxK8F74wwBbEvoxoCmzafGtC1KUsMU0SgNKCEb4AnBZnVkwoIJ9KaW%2FK%2FQ59ZQgz77UZMFBCUEJfxjgSg09qY7iu1D%2FlxbzenPVc%2BapryD%2FcBYLJQQp%2FJoNuVOOpTXu17Q9YnadMMfO3G%2F9CZbO%2Fy2mZQJYYhF80FZE%2FORbmuS8T3OwvLzhZkX9IUmsyfySyMhIMLFF9MfSOl%2BPZAV4zCL6w9tw%2B6ChEnicFnywvuh2lhbgEdJZXHQ7SwkwXW03aXluQUd7eIlmTko0Rxp3G5%2BQ4hZVR9M%2B7cQsExhUyqWlccCrQk%2BaH3ywTr22YC5nwDkWgQnCLcYngFcTGisJbzON51AZRDJ709jqXVCBhTtvp4%2B5wTWVGr%2B1DKnxb0YDOywav8vHmUDFYPYddiw3PgK8YtmBXp9GEHCu5i%2FbsNnbUmZ6bk5Kbq5N9b%2FX2T%2Baf5t7LDdcNBrQv0zJaqS8l2ZF2vJ%2BERmUamCzOecPc8SnWZsIcIVjlax%2B4IlWJPNpoaaH9WhsixjbrjIBOjBcS5X1quUx95OSerQeaqBIrAj%2FahMiOhNclqPqTq%2FUHOTJGUf7Yr2Z267z1ch3FpmQ0T1B3HWNMqT1O18AbtdylV06osdrpn6Hlqu8RG6nwLOSoZOxXOX%2B4MtV1tiHRIihsNn7044rWlzV95LFg5p%2BOs6UFY2X8bF88RfBHDNziru5xqLKSiuQi%2BNdvqdLNQU9pSzT34JpNbu1VKU%2F9vyioJLEvVArr2SNUE5b4zdoRd%2FoRqyjjClaHV3O7r%2FnIHQJGV%2BrNe1i6IjjzGjXn6DqVlPFWq3ftkM9b0f10nZIfQ3bNX9ZkshvlVhN75wmkUgkEolEIpFIJBKJRCIRM5r5D9WH9bFOGhrhAAAAAElFTkSuQmCC&style=for-the-badge)](https://github.com/PlazmaMC/AlwaysUpToDate/actions/workflows/plazma.yml)
[![MC Version](https://img.shields.io/badge/MC-1.20.1-6047ff?&logo=Webpack&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/releases/latest-1.20.1)
[![Build Status](https://img.shields.io/github/actions/workflow/status/PlazmaMC/Plazma/build.yml?branch=ver/1.20.2&logo=GoogleAnalytics&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.2)
[![MC Version](https://img.shields.io/badge/MC-1.20.2-6047ff?&logo=Webpack&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/releases/build/1.20.2/latest)
[![License](https://img.shields.io/github/license/PlazmaMC/Plazma?logo=github&style=flat-square&logoColor=ffffff)](LICENSE)
[![Downloads](https://img.shields.io/github/downloads/PlazmaMC/Plazma/total?label=Downloads&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAbvSURBVHhe7Z3vixVlFMf3jj9KLC0tqAgJlIoQSjOIIqggwohsCylxrYzU1BfZf7D1IvoLsiIqCwxXqQzCF722N0a+sEKo0BXXosLW1QpX3dvnzHOuuD9m5pm7M/Pc2Xs+cHhmnjnPr/Ode3Zm7o/tqRvNZjMaGxvbgH2L/at2EOuTY+pmlAEBnkug91EmMYDNVnejaAj+my7OqfSru1EkBH8Bdk6DnMYwfvO0WcdTp5y5qtFozNftNBZi97vNzqdOAizS0ofFWnY8tRGAs7+hm5nk8Q2NXbYFxgQIjAkQGBMgMCZAYEyAwJgAgTEBAmMCBMYECIwJEBgTIDAmQGBMgMCYAIExAQJjAgTGBAiMCRAYEyAwJkBgTIDAmACBMQECYwIExgQIjAkQGBMgMCZAYEyAwJgAgTEBAmMCBMYECIwJEJjSBWg2m7PHxsZWYs9gj2AL9FDHIXPDHsV6sRUydz1UT1jEauyX+Nu7CvtnKfqxOermBf5rpb0na7WZF/jPYV5vYP+45g6ZO/aEutULJr4Ou6RrmQTHvqDwFgHfUgTAV37+4EvXbDIcu4g9p+71gHnfxKTlTE8Fn88p5mqzVPArXADGvwpLDP4VDGM3aLNCKeVvAJNd12g0rtHdRPDpxXdAAqFVlcG4Ivwe5rDG1aSyEP8+3S6Usv4I36NlJhqAPSww19+E6SDBx/Z6Br/FCi0LpSMuQyUQBERE8EpH00FebYwzwJhPaVVQyhLgsJbeEJDS05EK7Jt2JvK9loVSlgC7Wew53fZGA1NKOtIzP2/aiaHdMMWnbq9YShEgiqI/KDYx8Uuuxh8JEO0KTUf6qpIzP3faYR4XKV5lTaddTY1g4RuxiywiN7Tbr4GLoaqty1C25Tpf7jlyI3PHXtau6oksAEu8IUuDdnKNHqcjytwCUKbeZKVBOwn+Rumn9rCQV2RBurZc0C6+WcNyCUA7uclq98y/gNX7zJ8IC5puOpKfpfQC3/VY96adJGRhWLvp6JRuZoLvkG7mgnYzJ+0kwQLbTkdlwpxmXtpJQs6yThJB5tI1wW8hC8baSkdFosGf2WknCRYeNB0xdveknSTk7AshgozZ9cFvIYHAKktHGvzOTDvMT94fnUdZ6aNqxqwkHTFG5WmHYeUn9yWmyQ8ZcZBPLuzD/sbkN/mPY2/R6Hp1KR3GKzUdSd8yhg5XOoy1iGHfphzEJKansb3YSnVxUPEiNuXCqZfGS9W1dBirlHSk63tJhykdiRk26EYfD/Wj2IaWo5z5F/TYlHD8MEVln5FhvELTkawPqyztMKQ8BDziRp8ajp/H7hZn+a8TmeD8rPZfCYxXSDqSPqQv7bYSGNb3weGALPQv3UkFv53af2Uw5rTSEW0rTTstJFZuBung96dc6fj+Ln+e3+8vhCiKPqTYwlxzv7NGG3kna3Oj0fjY1VSKb6wWR0zQ67f2ff2KBhE+oMj19qb6blEBKydPTCu91m8XAvkRxWZ51bqaZDT4m0IFPy+1EEDwSUcci9OOClYLaiOAQGAlHa3HzsQV45G6vrqc+S28BeDs6oj/y0KA5SMrS7HXsU+o2kW5g3KZHIudApMrVlwKjdIgE/y+1iZGBsTqgIYtFfzOyytAPvXlw21aGikQVzn7b3d7mQyLACfddibLUKxjv17UKSCAfI9gidvLZEgEOOq20+GSVT4qmOurP13KGmLl+9zsqAjwndv2YgcKz9JtYwIam9fcnheH5A+GfBvQG/y3a2NjAhIbDZMX+C8X1eRrpCdcVTb4yn80vVfHNBTich/2n4tSNvjKt0cb8ixI7h53uW6ywX8+DQ/QwSqt6nok+BQHiM3VrsaL3fg34y0CuoROUt+UmYiojW1j0/tmbqbB2mcRg+0SizgonmjsbtZuHFS8r8dzQbsjmDy3v5HdjrhbLhNZo6wVk3ftUt/1SoJ272l3PZcDRqUocpSXRVvX+vQrqWwQ+5k+4u8IxwdmCKypwZKuZVNuspaw29ZbtPQxQts7sN9lf9wZiwhbOfCO7holgABboyh6V3fHC8DBCNuPCE9qlVEgGtte7HJ2mJSzcboOO4jTXVplFAAx/YHiQc7+EVfjmHQFQ+Dl4dzjNDjmaozpQiyPU6yeGHxhyktIHE8ixMM0/EmrjDbRM/8hiamrGU/iNTwCnMAeoIOvtMrICbHbTyFpJ/GJc+pNFAKcwZ6mI7nhOqvVRgbEakRiRux6p0o7V+J946T3Cf3YC3Sc55a7ayDo5ynksU4/gf8trszAW4AWCHELxTbseYSo7EO7nQyB/5XiM2wngT8VV3qSW4AWDCp3hsvZfAyTB3N3YrdiCxGm9J+dCQHrHaWQq8QhTN7IOoR9w3p/xNq48+/p+R+4L+/7RtGOvAAAAABJRU5ErkJggg==&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/releases/tag/latest-1.20.1)
[![Downloads](https://img.shields.io/github/downloads/PlazmaMC/Plazma/total?label=Downloads&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAbvSURBVHhe7Z3vixVlFMf3jj9KLC0tqAgJlIoQSjOIIqggwohsCylxrYzU1BfZf7D1IvoLsiIqCwxXqQzCF722N0a+sEKo0BXXosLW1QpX3dvnzHOuuD9m5pm7M/Pc2Xs+cHhmnjnPr/Ode3Zm7o/tqRvNZjMaGxvbgH2L/at2EOuTY+pmlAEBnkug91EmMYDNVnejaAj+my7OqfSru1EkBH8Bdk6DnMYwfvO0WcdTp5y5qtFozNftNBZi97vNzqdOAizS0ofFWnY8tRGAs7+hm5nk8Q2NXbYFxgQIjAkQGBMgMCZAYEyAwJgAgTEBAmMCBMYECIwJEBgTIDAmQGBMgMCYAIExAQJjAgTGBAiMCRAYEyAwJkBgTIDAmACBMQECYwIExgQIjAkQGBMgMCZAYEyAwJgAgTEBAmMCBMYECIwJEJjSBWg2m7PHxsZWYs9gj2AL9FDHIXPDHsV6sRUydz1UT1jEauyX+Nu7CvtnKfqxOermBf5rpb0na7WZF/jPYV5vYP+45g6ZO/aEutULJr4Ou6RrmQTHvqDwFgHfUgTAV37+4EvXbDIcu4g9p+71gHnfxKTlTE8Fn88p5mqzVPArXADGvwpLDP4VDGM3aLNCKeVvAJNd12g0rtHdRPDpxXdAAqFVlcG4Ivwe5rDG1aSyEP8+3S6Usv4I36NlJhqAPSww19+E6SDBx/Z6Br/FCi0LpSMuQyUQBERE8EpH00FebYwzwJhPaVVQyhLgsJbeEJDS05EK7Jt2JvK9loVSlgC7Wew53fZGA1NKOtIzP2/aiaHdMMWnbq9YShEgiqI/KDYx8Uuuxh8JEO0KTUf6qpIzP3faYR4XKV5lTaddTY1g4RuxiywiN7Tbr4GLoaqty1C25Tpf7jlyI3PHXtau6oksAEu8IUuDdnKNHqcjytwCUKbeZKVBOwn+Rumn9rCQV2RBurZc0C6+WcNyCUA7uclq98y/gNX7zJ8IC5puOpKfpfQC3/VY96adJGRhWLvp6JRuZoLvkG7mgnYzJ+0kwQLbTkdlwpxmXtpJQs6yThJB5tI1wW8hC8baSkdFosGf2WknCRYeNB0xdveknSTk7AshgozZ9cFvIYHAKktHGvzOTDvMT94fnUdZ6aNqxqwkHTFG5WmHYeUn9yWmyQ8ZcZBPLuzD/sbkN/mPY2/R6Hp1KR3GKzUdSd8yhg5XOoy1iGHfphzEJKansb3YSnVxUPEiNuXCqZfGS9W1dBirlHSk63tJhykdiRk26EYfD/Wj2IaWo5z5F/TYlHD8MEVln5FhvELTkawPqyztMKQ8BDziRp8ajp/H7hZn+a8TmeD8rPZfCYxXSDqSPqQv7bYSGNb3weGALPQv3UkFv53af2Uw5rTSEW0rTTstJFZuBung96dc6fj+Ln+e3+8vhCiKPqTYwlxzv7NGG3kna3Oj0fjY1VSKb6wWR0zQ67f2ff2KBhE+oMj19qb6blEBKydPTCu91m8XAvkRxWZ51bqaZDT4m0IFPy+1EEDwSUcci9OOClYLaiOAQGAlHa3HzsQV45G6vrqc+S28BeDs6oj/y0KA5SMrS7HXsU+o2kW5g3KZHIudApMrVlwKjdIgE/y+1iZGBsTqgIYtFfzOyytAPvXlw21aGikQVzn7b3d7mQyLACfddibLUKxjv17UKSCAfI9gidvLZEgEOOq20+GSVT4qmOurP13KGmLl+9zsqAjwndv2YgcKz9JtYwIam9fcnheH5A+GfBvQG/y3a2NjAhIbDZMX+C8X1eRrpCdcVTb4yn80vVfHNBTich/2n4tSNvjKt0cb8ixI7h53uW6ywX8+DQ/QwSqt6nok+BQHiM3VrsaL3fg34y0CuoROUt+UmYiojW1j0/tmbqbB2mcRg+0SizgonmjsbtZuHFS8r8dzQbsjmDy3v5HdjrhbLhNZo6wVk3ftUt/1SoJ272l3PZcDRqUocpSXRVvX+vQrqWwQ+5k+4u8IxwdmCKypwZKuZVNuspaw29ZbtPQxQts7sN9lf9wZiwhbOfCO7holgABboyh6V3fHC8DBCNuPCE9qlVEgGtte7HJ2mJSzcboOO4jTXVplFAAx/YHiQc7+EVfjmHQFQ+Dl4dzjNDjmaozpQiyPU6yeGHxhyktIHE8ixMM0/EmrjDbRM/8hiamrGU/iNTwCnMAeoIOvtMrICbHbTyFpJ/GJc+pNFAKcwZ6mI7nhOqvVRgbEakRiRux6p0o7V+J946T3Cf3YC3Sc55a7ayDo5ynksU4/gf8trszAW4AWCHELxTbseYSo7EO7nQyB/5XiM2wngT8VV3qSW4AWDCp3hsvZfAyTB3N3YrdiCxGm9J+dCQHrHaWQq8QhTN7IOoR9w3p/xNq48+/p+R+4L+/7RtGOvAAAAABJRU5ErkJggg==&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/releases)
[![Stargazers](https://img.shields.io/github/stars/PlazmaMC/Plazma?label=stars&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNjtc7/hFAAABIElEQVQ4y62SzS5DURSFv6smXkAUCRU0UdKYGNTPyCsYYOYFGGi8Ao9QM0PxCh6CgQ4qfiLpBFEjdKCfySaXtDch1uScs9Ze62TvcyAD6o66zV+gjqpvalsd61XXl5GxBySx3/3t7UPqi1pTD9VXdaRbbZIyDQLTwBSwBqzGGaABnAInwCXQSJLk/tO4orb8jra6nwo/CC6NlrqMOq421Y5aVSfUXJe2cqFVo7b5NdwIuVaf1IWM2cyrD+qdOvlTLERIS53pYi6FdqMWet2wGP1tdNE2Q1vK+gfDsdbDlFfzwV3Ems8KmAXegcd4hSvgVq0Bz6GV0ob+HgF1YAA4Cn4LWA9tLusHnscTHavFFF8MrqOeZQVU1HKGXlYr/Cc+AKuOI2h/Jrf7AAAAAElFTkSuQmCC&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/stargazers)
[![Forks](https://img.shields.io/github/forks/PlazmaMC/Plazma?label=forks&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNCYN3/YeAAAA/UlEQVQ4y7WTQUoDQRBFf01czlJcxUyOINGjjAvFHMFzZGdygOwDwTtk6UZcqLlAxCAuMigug89FamIzdAIN+qGhq/6v6qrqbumvAJwBj8AHMAQs4DJgBHy65jSW4Bl4AaZsUAbcufumrnmquSzIcSzpTtLA7XbA1fuBa9qxCob8YgUUAdcFqoC/iSXIgLELOhG+49w4nM+2BTP7ljR3M4/MufbNzYxdN1E0Sm2ialZnsVIllZKOJF24eyLpXdKtmS1S3sYMmO3THOwJziUdbrbkZvaVcnILeAh6vweylAQ9D7z2BXCS0sJS0lrSpdtrSW+pn6sPLIFX4Er/hR9C0wl1FTBzNwAAAABJRU5ErkJggg==&style=flat-square&color=green)](https://github.com/PPlazmaMC/Plazma/network/members)
[![Watchers](https://img.shields.io/github/watchers/PlazmaMC/Plazma?label=watchers&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNw4TRw0nAAAA3UlEQVQ4y83SP04CURAG8I0lewHOwAFUaiwkdmAlp8CL4FHopfIvtOIJWE3opIBK489mQPKy6xYWOskkL9/MN/PNzMuyf2fIcYkZVuGzwPI68gle8Yl7jMIfAntBp4o8wAeecFgSP8I8cgZp8DwC12j8oLCBCd7R34ItbHCzT8ZZSC7QTYrcYo1WhjGWaCbdCt+2SGLN4IwPfnu07QjrkhG6oWKB0+TMd7sRAuzHYuqWmO8tsVd1xjmOS8htPEfORVWHTmweHnEVPg2sqPxIicxhFFjhLd7D2q/8J/YFHSJt9VSqQ08AAAAASUVORK5CYII=&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/watchers)
@@ -19,13 +18,21 @@
[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]를 확인해주세요.
> [!IMPORTANT]
This is the branch for Plazma 1.20.2. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
이곳은 플라즈마의 1.20.2용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 브랜치][main]** 를 확인해주세요.
## ⬇️ Downloads
### If you don't know about Mojmap or Bundler, download **Reobf Paperclip**
> [!NOTE]
If you don't know about Mojmap or Bundler, download **Reobf Paperclip**<br>
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) |
<!--- LINKS --->
[paperReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-paperclip-1.20.2-R0.1-SNAPSHOT-reobf.jar
[paperMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-paperclip-1.20.2-R0.1-SNAPSHOT-mojmap.jar
[bundlerReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-bundler-1.20.2-R0.1-SNAPSHOT-reobf.jar
[bundlerMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-bundler-1.20.2-R0.1-SNAPSHOT-mojmap.jar
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|:-----------------------------:|:-----------------------:|:------------------------:|:-------------------------:|
| [Download][paperReobf] | [Download][paperMojmap] | [Download][bundlerReobf] | [Download][bundlerMojmap] |

View File

@@ -0,0 +1,15 @@
# 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
#

View File

@@ -1,11 +1,18 @@
import io.papermc.paperweight.util.*
import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
group = "org.plazmamc.plazma"
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)
}
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
repositories {
@@ -18,20 +25,43 @@ repositories {
}
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(17))
publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/PlazmaMC/Plazma")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
publications.register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
subprojects {
apply(plugin = "java")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
tasks {
withType<JavaCompile>().configureEach {
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
options.encoding = "UTF-8"
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
@@ -80,28 +110,22 @@ paperweight {
}
}
val upstreamTask = tasks.register("updateUpstream") {
val tempDir = layout.cacheDir("updateUpstream");
val file = "gradle.properties";
alwaysUpToDate {
paperRepository.set("https://github.com/PaperMC/Paper")
paperBranch.set("master")
purpurRepository.set("https://github.com/PurpurMC/Purpur")
purpurBranch.set("ver/1.20.4")
pufferfishRepository.set("https://github.com/pufferfish-gg/Pufferfish")
pufferfishBranch.set("ver/1.20")
}
doFirst {
val apiResponse = layout.cache.resolve("apiResponse.json");
download.get().download("https://api.github.com/repos/PaperMC/Paper/commits/master", apiResponse);
val latestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(apiResponse)["sha"].asString;
copy {
from(file)
into(tempDir)
filter { line: String ->
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
}
}
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
}
tasks {
generateDevelopmentBundle {
apiCoordinates.set("org.plazmamc.plazma:plazma-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://papermc.io/repo/repository/maven-public/"
)
}
}

33
buildSrc/build.gradle.kts Normal file
View File

@@ -0,0 +1,33 @@
plugins {
java
`kotlin-dsl`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
}
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
dependencies {
shadow("io.papermc.paperweight:paperweight-patcher:1.5.11-SNAPSHOT")
}
tasks {
jar {
finalizedBy(shadowJar)
}
shadowJar {
archiveFileName.set("buildSrc.jar")
configurations = listOf(project.configurations["shadow"])
exclude("META-INF/gradle-plugins/io.papermc.paperweight.patcher.properties")
relocate("io.papermc.paperweight", "org.plazmamc.alwaysuptodate.internal.paperweight")
minimize()
}
}

View File

@@ -0,0 +1,15 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.plazmamc.alwaysuptodate.tasks.*
class AlwaysUpToDate : Plugin<Project> {
override fun apply(target: Project) {
target.extensions.create("alwaysUpToDate", AlwaysUpToDateExtension::class.java)
target.tasks.register("updatePaper", PaperUpdateTask::class.java)
target.tasks.register("updatePurpur", PurpurUpdateTask::class.java)
}
}

View File

@@ -0,0 +1,6 @@
package org.plazmamc.alwaysuptodate
class AlwaysUpToDateException : Exception {
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable?) : super(message, cause)
}

View File

@@ -0,0 +1,16 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.provider.Property
interface AlwaysUpToDateExtension {
val paperRepository: Property<String>
val paperBranch: Property<String>
val pufferfishRepository: Property<String>
val pufferfishBranch: Property<String>
val purpurRepository: Property<String>
val purpurBranch: Property<String>
}

View File

@@ -0,0 +1,44 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.Git
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.get
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
import org.plazmamc.alwaysuptodate.utils.pathIO
import java.io.File
abstract class PaperUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
private val regex = "[a-z0-9]{40}\trefs/heads/${property.paperBranch}".toRegex()
private val git = Git(project.pathIO)
override fun init() {
outputs.upToDateWhen { check() }
}
private fun check(): Boolean {
val latestCommit = git("ls-remote", property.paperRepository.get()).readText()?.lines()
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Paper commit")
val currentCommit = project.properties["paperCommit"] as String
return currentCommit == latestCommit
}
@TaskAction
fun update() {
if (check()) return
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
}
}
fun updatePaperCommit(repo: String, branch: String, properties: File) {
val latestCommit = Git(properties.parentFile.toPath())("ls-remote", repo).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/$branch".toRegex().matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Paper commit")
properties.writeText(properties.readText().replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit"))
}

View File

@@ -0,0 +1,169 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.*
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.get
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
import org.plazmamc.alwaysuptodate.utils.Gradle
import org.plazmamc.alwaysuptodate.utils.addCommit
import org.plazmamc.alwaysuptodate.utils.clone
import org.plazmamc.alwaysuptodate.utils.pathIO
import java.nio.file.Path
import kotlin.io.path.createDirectories
import kotlin.io.path.exists
abstract class PurpurUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
private val pufferfishCommit = """
Pufferfish
Copyright (C) 2024 Pufferfish Studios LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
""".trimIndent()
private val purpurCommit = """
PurpurMC
Copyright (C) 2024 PurpurMC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
""".trimIndent()
override fun init() {
outputs.upToDateWhen { check() }
}
private fun check(): Boolean {
val regex = "[a-z0-9]{40}\trefs/heads/${property.purpurBranch}".toRegex()
val latestCommit = Git(project.pathIO)("ls-remote", property.purpurRepository.get()).readText()?.lines()
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
val currentCommit = project.properties["purpurCommit"] as String
return currentCommit == latestCommit
}
@TaskAction
fun update() {
if (check()) return
Git.checkForGit()
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
if (dir.exists()) dir.toFile().deleteRecursively()
dir.createDirectories()
val git = Git(dir)
val pufferfish = git.clone("Pufferfish", property.pufferfishRepository.get(), property.pufferfishBranch.get(), dir)
val purpur = git.clone("Purpur", property.purpurRepository.get(), property.purpurBranch.get(), dir)
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), pufferfish.resolve("gradle.properties").toFile())
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), purpur.resolve("gradle.properties").toFile())
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
val purpurGradle = Gradle(purpur)
val purpurPatches = purpur.resolve("patches").also {
val puffefishPatches = pufferfish.resolve("patches").also { that -> that.toFile().deleteRecursively() }
copyPatch(it.resolve("server"), puffefishPatches.resolve("server"), "0001-Pufferfish-Server-Changes.patch")
copyPatch(it.resolve("api"), puffefishPatches.resolve("api"), "0001-Pufferfish-API-Changes.patch")
}
Gradle(pufferfish)("applyPatches").executeOut()
purpurGradle("applyPatches").executeOut()
pufferfish.resolve("pufferfish-server").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
copySource(it)
val paper = pufferfish.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
copySource(paper)
Git(paper)("add", ".").executeOut()
Git(paper)("commit", "-m", "Vanilla Sources", "--author=Vanilla <auto@mated.null>").executeOut()
Thread.sleep(1_000)
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).addCommit("Pufferfish Server Changes\n\n$pufferfishCommit", "--author=Kevin Raneri <kevin.raneri@gmail.com>")
val server = purpur.resolve("Purpur-Server")
copySource(server)
dotGit.copyRecursively(server.resolve(".git").toFile().also { that -> that.deleteRecursively() }, overwrite = true)
Git(server).addCommit("Purpur Server Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
with(purpur.resolve("Purpur-API")) {
pufferfish.resolve("pufferfish-api/.git").toFile()
.copyRecursively(resolve(".git").toFile().also { it.deleteRecursively() }, overwrite = true)
Git(this).addCommit("Purpur API Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
purpurGradle("rebuildPatches").executeOut()
project.layout.projectDirectory.path.resolve("patches").also {
with(purpurPatches.resolve("server")) {
val target = it.resolve("server")
copyPatch(this, target, "0001-Pufferfish-Server-Changes.patch")
copyPatch(this, target, "0002-Purpur-Server-Changes.patch")
}
with(purpurPatches.resolve("api")) {
val target = it.resolve("api")
copyPatch(this, target, "0001-Pufferfish-API-Changes.patch")
copyPatch(this, target, "0002-Purpur-API-Changes.patch")
}
}
}
private fun copySource(dir: Path) {
with(dir.resolve(".gradle/caches/paperweight/mc-dev-sources")) {
val target = dir.resolve("src/main")
resolve("net").toFile().copyRecursively(target.resolve("java/net").toFile(), overwrite = true)
resolve("data").toFile().copyRecursively(target.resolve("resources/data").toFile(), overwrite = true)
}
}
private fun copyPatch(from: Path, to: Path, name: String) {
with(from.resolve(name)) {
if (exists()) toFile().copyTo(to.resolve(name).toFile(), overwrite = true)
else from.toFile().walk().filter { it.name.endsWith(name.substring(4)) }.first().copyTo(to.resolve(name).toFile(), overwrite = true)
}
}
abstract class PurpurBuildTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
@TaskAction
fun build() {
}
}
}

View File

@@ -0,0 +1,14 @@
package org.plazmamc.alwaysuptodate.tasks
import org.gradle.api.DefaultTask
abstract class Task : DefaultTask() {
protected open fun init() {
}
init {
this.init()
}
}

View File

@@ -0,0 +1,18 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.Git
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import java.nio.file.Path
import kotlin.io.path.notExists
fun Git.clone(name: String, uri: String, branch: String, dir: Path): Path {
val target = dir.resolve(name)
this("clone", "--depth", "1", "--branch", branch, uri, target.toString()).executeSilently(silenceErr = true)
if (target.notExists()) throw AlwaysUpToDateException("Failed to clone repository")
return target
}
fun Git.addCommit(vararg args: String) {
this("add", ".").executeSilently(silenceErr = true)
this("commit", "-m", *args).executeSilently(silenceErr = true)
}

View File

@@ -0,0 +1,27 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.Command
import io.papermc.paperweight.util.directory
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import java.nio.file.Path
import kotlin.io.path.notExists
class Gradle(private val repo: Path) {
init {
if (repo.resolve("gradle").notExists())
throw AlwaysUpToDateException("Git repository does not exist: $repo")
}
operator fun invoke(vararg args: String): Command {
val builder = ProcessBuilder("java", "-cp", "gradle/wrapper/gradle-wrapper.jar", "org.gradle.wrapper.GradleWrapperMain", *args, "--no-daemon", "--stacktrace").directory(repo)
val command = builder.command().joinToString(" ") { if (it.codePoints().anyMatch(Character::isWhitespace)) "\"$it\"" else it }
return try {
Command(builder, command)
} catch (e: Exception) {
throw AlwaysUpToDateException("Failed to execute command: $command", e)
}
}
}

View File

@@ -0,0 +1,7 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.path
import org.gradle.api.Project
import java.nio.file.Path
val Project.pathIO: Path get() = layout.projectDirectory.path

View File

@@ -0,0 +1 @@
implementation-class=org.plazmamc.alwaysuptodate.AlwaysUpToDate

View File

View File

View File

@@ -1,7 +1,9 @@
group = org.plazmamc.plazma
version = 1.20.2-R0.1-SNAPSHOT
mcVersion = 1.20.2
paperCommit = 38376f43a0c268e5223746cab13910f55e5ecf41
paperCommit = 931781c220b98dde0159c9a3c8dce06c3b2b1e13
purpurCommit = c46cb7ef66675e00a48e20c40febed7ff914f35d
pufferfishCommit = bc89152d4cd4bb0f9644da2fe10774df4cc25661
org.gradle.caching = true
org.gradle.parallel = true

15
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,15 @@
[versions]
shadow = "8.1.1"
paperweight = "1.5.10"
paperclip = "3.0.3"
decompiler = "2.0.627.2"
remapper = "0.10.0"
[libraries]
remapper = { group = "net.fabricmc", name = "tiny-remapper", version.ref="remapper" }
decompiler = { group = "net.minecraftforge", name = "forgeflower", 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" }

Binary file not shown.

View File

@@ -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.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

22
gradlew vendored
View File

@@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \

29
libs/api.versions.toml Normal file
View File

@@ -0,0 +1,29 @@
[versions]
gson = "2.10.1"
joml = "1.10.5"
guava = "32.1.2-jre"
sentry = "5.4.0"
fastutil = "8.5.6"
findbugs = "1.3.9"
slf4j-api = "1.8.0-beta4"
bungeechat = "1.20-R0.1-deprecated+build.14"
json-simple = "1.1.1"
annotations = "24.0.1"
checkerqual = "3.21.0"
[libraries]
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
[bundles]
api = [ "guava", "gson", "bungeechat", "joml", "fastutil", "slf4j-api", "sentry" ]
annotations = [ "annotations", "checkerqual" ]

45
libs/common.versions.toml Normal file
View File

@@ -0,0 +1,45 @@
[versions]
asm = "9.6"
log4j = "2.19.0"
mockito = "5.5.0"
jupiter = "5.10.0"
hamcrest = "2.2"
snakeyaml = "2.2"
adventure = "4.14.0"
commons-lang2 = "2.6"
commons-lang3 = "3.12.0"
maven-provider = "3.8.5"
maven-resolver = "1.7.3"
[libraries]
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "jupiter" }
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
asm-head = { group = "org.ow2.asm", name = "asm", version.ref = "asm" }
asm-tree = { group = "org.ow2.asm", name = "asm-tree", version.ref = "asm" }
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
log4j-iostreams = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
maven-provider = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "maven-provider" }
maven-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "maven-resolver" }
maven-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "maven-resolver" }
commons-lang2 = { group = "commons-lang", name = "commons-lang", version.ref = "commons-lang2" }
commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" }
adventure-bom = { group = "net.kyori", name = "adventure-bom", version.ref = "adventure" }
adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
adventure-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
adventure-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
adventure-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventure" }
adventure-serializer-ansi = { group = "net.kyori", name = "adventure-text-serializer-ansi", version.ref = "adventure" }
adventure-serializer-plain = { group = "net.kyori", name = "adventure-text-serializer-plain", version.ref = "adventure" }
adventure-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" }
[bundles]
asm = [ "asm-head", "asm-commons" ]
test = [ "jupiter", "hamcrest", "mockito" ]
maven = [ "maven-connector", "maven-transport" ]
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]

35
libs/server.versions.toml Normal file
View File

@@ -0,0 +1,35 @@
[versions]
ansi = "1.0.3"
jansi = "3.21.0"
rhino = "1.7.14"
mysql = "8.1.0"
sqlite = "3.42.0.1"
haproxy = "4.1.97.Final"
velocity = "3.1.2-SNAPSHOT"
disruptor = "3.4.4"
simpleyaml = "1.8.4"
classgraph = "4.8.47"
mapping-io = "0.5.0"
configurate = "4.2.0-SNAPSHOT"
terminal-appender = "1.3.0"
[libraries]
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jansi" }
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
velocity = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
mappingio = { group = "net.fabricmc", name = "mapping-io", version.ref = "mapping-io" }
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
simpleyaml = { group = "com.github.carleslc.Simple-YAML", name = "Simple-Yaml", version.ref = "simpleyaml" }
configurate = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
terminal-appender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="terminal-appender" }
[bundles]
runtime = [ "sqlite", "mysql", "disruptor" ]
implementation = [ "jansi", "terminal-appender", "ansi", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime" ]

View File

View File

View File

@@ -1,6 +1,6 @@
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
Date: Sun, 26 Nov 2023 23:32:01 +0000
Subject: [PATCH] Pufferfish API Changes
Original: Kevin Raneri <kevin.raneri@gmail.com>
@@ -20,10 +20,10 @@ 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
index e827ee211e3c65dc68ac5867fd8476639df63645..b9c75a190dbd7a90ac5ef0fbc6e6fe34806acc4e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -46,6 +46,7 @@ dependencies {
@@ -47,6 +47,7 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
@@ -31,21 +31,26 @@ index 639651972fddce4dff63a0f0a7e566a15b9e2dd6..6c0df825238ca037abeb2ba619983b6f
implementation("org.ow2.asm:asm:9.4")
implementation("org.ow2.asm:asm-commons:9.4")
@@ -102,6 +103,8 @@ tasks.jar {
@@ -106,6 +107,13 @@ val generateApiVersioningFile by tasks.registering {
}
}
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
+// Pufferfish Start
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Pufferfish End
+
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b196a10948
index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
@@ -0,0 +1,162 @@
@@ -0,0 +1,161 @@
+package gg.pufferfish.pufferfish.sentry;
+
+import com.google.gson.Gson;
@@ -61,7 +66,6 @@ index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b1
+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 {
@@ -94,7 +98,7 @@ index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b1
+ ThreadContext.remove("pufferfishsentry_playerid");
+ }
+
+ public static void setEventContext(@NotNull Event event, @NotNull RegisteredListener registration) {
+ public static void setEventContext(Event event, RegisteredListener registration) {
+ setPluginContext(registration.getPlugin());
+
+ try {
@@ -167,43 +171,43 @@ index 0000000000000000000000000000000000000000..ff42019da93c365ea1365e2e0f7c51b1
+ private Event event;
+ private RegisteredListener registeredListener;
+
+ public @Nullable Plugin getPlugin() {
+ public Plugin getPlugin() {
+ return plugin;
+ }
+
+ public void setPlugin(@Nullable Plugin plugin) {
+ public void setPlugin(Plugin plugin) {
+ this.plugin = plugin;
+ }
+
+ public @Nullable Command getCommand() {
+ public Command getCommand() {
+ return command;
+ }
+
+ public void setCommand(@Nullable Command command) {
+ public void setCommand(Command command) {
+ this.command = command;
+ }
+
+ public @Nullable String getCommandLine() {
+ public String getCommandLine() {
+ return commandLine;
+ }
+
+ public void setCommandLine(@Nullable String commandLine) {
+ public void setCommandLine(String commandLine) {
+ this.commandLine = commandLine;
+ }
+
+ public @Nullable Event getEvent() {
+ public Event getEvent() {
+ return event;
+ }
+
+ public void setEvent(@Nullable Event event) {
+ public void setEvent(Event event) {
+ this.event = event;
+ }
+
+ public @Nullable RegisteredListener getRegisteredListener() {
+ public RegisteredListener getRegisteredListener() {
+ return registeredListener;
+ }
+
+ public void setRegisteredListener(@Nullable RegisteredListener registeredListener) {
+ public void setRegisteredListener(RegisteredListener registeredListener) {
+ this.registeredListener = registeredListener;
+ }
+ }
@@ -385,7 +389,7 @@ index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be
+
+}
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9584e245144b561b4f6745b2f26a4f69a6f92891 100644
index c80faa079eca1564847070f0338fc98024639829..e632d51d3487eb4807243b6705999ad124466bf5 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -1,6 +1,7 @@
@@ -476,10 +480,10 @@ index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bac
if (cloader instanceof PluginClassLoader) {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee1b8df621 100644
index f9b57b872780aa6b9b959494874b57c7a8ff0c53..90953bfc81168068a281be4d2d3942d5e7dd69ff 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -48,6 +48,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -50,6 +50,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
private io.papermc.paper.plugin.provider.classloader.PluginClassLoaderGroup classLoaderGroup; // Paper
public io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext; // Paper
@@ -488,7 +492,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
static {
ClassLoader.registerAsParallelCapable();
}
@@ -183,6 +185,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -197,6 +199,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
throw new ClassNotFoundException(name);
}
@@ -496,7 +500,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
@@ -190,7 +193,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -204,7 +207,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
}
Class<?> result = classes.get(name);
@@ -505,7 +509,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
String path = name.replace('.', '/').concat(".class");
JarEntry entry = jar.getJarEntry(path);
@@ -237,6 +240,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -251,6 +254,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
this.setClass(name, result); // Paper
}
@@ -513,7 +517,7 @@ index 13da387d3b59bc67c0d73e3fbd3a4034b1281527..7572a0bf6614b02be3cbccc7b86e52ee
return result;
}
@@ -251,6 +255,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -265,6 +269,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
// Paper end
super.close();
} finally {

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 30 Sep 2023 09:53:53 +0000
Date: Sun, 26 Nov 2023 23:37:25 +0000
Subject: [PATCH] Purpur API Changes
Original: PurpurMC
@@ -24,6 +24,19 @@ 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/build.gradle.kts b/build.gradle.kts
index b9c75a190dbd7a90ac5ef0fbc6e6fe34806acc4e..41d7b75e904b94073dfcd12b776a7759a963b66f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -126,6 +126,8 @@ tasks.jar {
}
tasks.withType<Javadoc> {
+ (options as StandardJavadocDocletOptions).addStringOption("-add-modules", "jdk.incubator.vector") // Purpur - our javadocs need this for pufferfish's SIMD patch
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Paper's bajillion javadoc warnings
val options = options as StandardJavadocDocletOptions
options.overview = "src/main/javadoc/overview.html"
options.use()
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72 100644
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
@@ -196,10 +209,10 @@ index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48c
@Override
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index f78b5fd3c3347d28da58777bff88903d2eb140f6..584e3b08935f43beb27f478cc72229b6a5f40689 100644
index 4863d9f21f0a0f11974be85360edc587ffd7eab3..8ea42a1f07df756bf504609d2bbff578f20bb808 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2756,4 +2756,127 @@ public final class Bukkit {
@@ -2832,4 +2832,127 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
@@ -418,10 +431,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index da6e36a16e609272b60fc41ff69a6fa3c34926c0..eba4e7ebe3530fd8cb3ecbe72f703932df8721c9 100644
index 7ca70b269e15e818e61a9329e2775789abb4bc73..aa9ca3e33903747a455ad0949387684ce4b917af 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -11050,4 +11050,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -11054,4 +11054,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
public boolean isEnabledByFeature(@NotNull World world) {
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
}
@@ -582,10 +595,10 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a32
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd3fbddddd 100644
index f1fa97d12f97baf97beb92ca0719cf3cf906b225..dd99f53e3d559685a4b3a454a9e607c310fc6aff 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2121,6 +2121,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2190,6 +2190,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end
@@ -604,7 +617,7 @@ index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd
/**
* Sends the component to the player
*
@@ -2404,4 +2416,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2473,4 +2485,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API
@@ -711,10 +724,10 @@ index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..aaef58468a3c31f35e5067ed4263e9dd
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index da524a71af74b02515b037f7fe09ba6988e2c8bf..3679c3b8d31ab8de08ecabd56bf92ffc062f971c 100644
index 567a36a4887da8994c9170e2885aa8cc357efa0c..405d60bd2c99ba741d2614b16f4bda5da48a0387 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4008,6 +4008,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4235,6 +4235,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -964,10 +977,10 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
// Paper start
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..98de85d1382fe84cdc2e2c9db04bf1b4f157291c 100644
index 9e3cb75536ae260dc898ab9dafbc1d98398782bc..ed9627dff9a33524da546c46e1d1be71ae1d1e0c 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1049,4 +1049,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -1063,4 +1063,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@NotNull String getScoreboardEntryName();
// Paper end - entity scoreboard name
@@ -1116,10 +1129,10 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 19e58e62ae442ef9be02ca7fa2f55e370a54afa4..994e026d68fcda9a4c34a8b161a06623f4437dff 100644
index a599ed2795ba1baf2cbb465d1c7145580c27e1ea..298acbfb93663e40e627f6a47d51fd87a1551feb 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1192,4 +1192,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1243,4 +1243,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end
@@ -1187,10 +1200,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 20fa1024f9ad8f478a347be5c554b5e45b398a1c..0df709ed758401f04b3f565dc1f6492a55f5363c 100644
index 47fcfa2a3358766dfda2efc9bbcf5b50e3f2f7c1..eea83040ff15ea7c9bf97a45f5557294b309b4c8 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3278,4 +3278,122 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3366,4 +3366,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
@@ -1219,6 +1232,7 @@ index 20fa1024f9ad8f478a347be5c554b5e45b398a1c..0df709ed758401f04b3f565dc1f6492a
+
+ /**
+ * Reset the idle timer back to 0
+ * @deprecated Use {@link #resetIdleDuration()} instead
+ */
+ void resetIdleTimer();
+
@@ -1454,10 +1468,29 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
+ boolean canDoUnsafeEnchants();
+
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 0217f98a74140bbae454d467de27c12b6060ca75..fba5b867ea9de36b45ef25c2a93fc436701bb3d9 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -355,4 +355,14 @@ public interface ItemFactory {
*/
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
// Paper end - enchantWithLevels API
+
+ // Purpur start
+ /**
+ * Returns the lines of text shown when hovering over an item
+ * @param itemStack The ItemStack
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ @NotNull java.util.List<net.kyori.adventure.text.@NotNull Component> getHoverLines(@NotNull ItemStack itemStack, boolean advanced);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 0af73cc04edb93b9772136d4d808f657ea40e733..c733206b769d7a55076d863757fcac1a129033b7 100644
index 36e3fbc727cd748aa138f52976154ba32954cd87..9ecfc504df089a74add168cd5a8376d7d6b8ea0e 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
@@ -1479,7 +1512,7 @@ index 0af73cc04edb93b9772136d4d808f657ea40e733..c733206b769d7a55076d863757fcac1a
/**
* Represents a stack of items.
@@ -1005,4 +1017,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -1005,4 +1017,635 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
return type.isAir() || amount <= 0;
}
// Paper end
@@ -2104,6 +2137,15 @@ index 0af73cc04edb93b9772136d4d808f657ea40e733..c733206b769d7a55076d863757fcac1a
+ }
+ return random.nextInt(unbreaking + 1) > 0;
+ }
+
+ /**
+ * Returns the lines of text shown when hovering over the item
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ public @NotNull List<net.kyori.adventure.text.@NotNull Component> getHoverLines(boolean advanced) {
+ return Bukkit.getItemFactory().getHoverLines(this, advanced);
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -4081,3 +4123,18 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6ce
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 88f1ca89fa640a686231b8eec87e70419b2d73ef..d6b91c49a267c89d7df2ddee7ccfe64675d117be 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -47,6 +47,10 @@ public class AnnotationTest {
"org/bukkit/plugin/java/PluginClassLoader",
// Generic functional interface
"org/bukkit/util/Consumer",
+ // Purpur start
+ "gg/pufferfish/pufferfish/sentry/SentryContext",
+ "gg/pufferfish/pufferfish/sentry/SentryContext$State",
+ // Purpur end
// Paper start
"io/papermc/paper/util/TransformingRandomAccessList",
"io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator",

View File

@@ -0,0 +1,115 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:50:29 +0900
Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 41d7b75e904b94073dfcd12b776a7759a963b66f..c37b8a63b050dcc2ad2b33955017df48120c4393 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,11 +9,13 @@ java {
withJavadocJar()
}
+/* // Plazma - Use libs.versions.toml
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val adventureVersion = "4.14.0"
val slf4jVersion = "1.8.0-beta4"
val log4jVersion = "2.17.1"
+ */ // Plazma - Use libs.versions.toml
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -28,15 +30,39 @@ configurations.api {
dependencies {
// api dependencies are listed transitively to API consumers
+ /* // Plazma - Use libs.versions.toml
api("com.google.guava:guava:32.1.2-jre")
api("com.google.code.gson:gson:2.10.1")
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
api("org.yaml:snakeyaml:2.2")
api("org.joml:joml:1.10.5")
+ */ // Plazma - Use libs.versions.toml
// Paper start
- api("com.googlecode.json-simple:json-simple:1.1.1") {
+ api(api.jsonsimple) { // Plazma - Use libs.versions.toml
isTransitive = false // includes junit
}
+ // Plazma start
+ implementation(common.bundles.asm)
+
+ compileOnly(api.findbugs)
+ compileOnly(common.bundles.maven)
+
+ compileOnly(api.annotations)
+ compileOnlyApi(api.checkerqual)
+ testCompileOnly(api.bundles.annotations)
+
+ testImplementation(common.asm.tree)
+ testImplementation(common.bundles.test)
+ testImplementation(common.commons.lang3)
+
+ api(api.bundles.api)
+ api(common.snakeyaml)
+ api(common.log4j.api)
+ api(common.maven.provider)
+ apiAndDocs(platform(common.adventure.bom))
+ apiAndDocs(common.bundles.adventure)
+ /*
+ // Plazma end
api("it.unimi.dsi:fastutil:8.5.6")
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
apiAndDocs("net.kyori:adventure-api")
@@ -73,6 +99,7 @@ dependencies {
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.ow2.asm:asm-tree:9.5")
+ */ // Plazma - Use libs.versions.toml
}
// Paper start
@@ -133,25 +160,27 @@ 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
+ // Plazma start - Use libs.versions.toml
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/", // Paper - we don't want Java 5 annotations
// "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
// Paper start - add missing javadoc links
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
// Paper end
// Paper start
- "https://jd.advntr.dev/api/$adventureVersion/",
- "https://jd.advntr.dev/text-minimessage/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-minimessage/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-gson/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-legacy/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-plain/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
// Paper end
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.transport.orNull?.version}", // Paper
+ // Plazma end
)
options.tags("apiNote:a:API Note:")

View File

@@ -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 dd99f53e3d559685a4b3a454a9e607c310fc6aff..3a3713573ba37530449f9254c0a7205530c9737a 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
@@ -2202,6 +2202,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end
// Purpur end
+ // Plazma start
+ @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
*

View File

@@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,78 @@
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 f083d422678f5fd21825439944af888fbdc9bf3c..e30b51ed329f0c66a2329da45996ef0fc0db8ffb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
exclude("io.papermc.paper", "paper-api")
}
// Purpur end
+ /* // Plazma - Use libs.versions.toml
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -46,9 +47,32 @@ dependencies {
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
// Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
+ // Plazma start - Use libs.versions.toml
+ */
+ implementation(common.snakeyaml)
+ implementation(common.bundles.asm)
+ implementation(common.commons.lang2)
+ implementation(common.adventure.serializer.ansi)
+ implementation(common.log4j.core)
+ implementation(common.log4j.iostreams)
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
+ runtimeOnly(log4jPlugins.output)
+ alsoShade(log4jPlugins.output)
+
+ implementation(server.ansi)
+ implementation(server.bundles.implementation)
+ implementation(server.velocity) {
+ // Plazma end
isTransitive = false
}
+
+ runtimeOnly(common.bundles.maven)
+ runtimeOnly(common.maven.provider)
+ runtimeOnly(server.bundles.runtime)
+
+ testImplementation(common.bundles.test)
+ testImplementation(server.classgraph)
+ /* // Plazma - Use libs.versions.toml
// Paper end
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
@@ -57,19 +81,22 @@ dependencies {
// Pufferfish start
implementation("org.yaml:snakeyaml:1.32")
- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
+ */ // Plazma - Use libs.versions.toml
+ implementation(server.simpleyaml) { // Plazma - Use libs.versions.toml
exclude(group="org.yaml", module="snakeyaml")
}
// Pufferfish end
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
+ //implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur // Plazma - Use libs.versions.toml
+ //implementation("org.mozilla:rhino-engine:1.7.14") // Purpur // Plazma - Use libs.versions.toml
implementation("dev.omega24:upnp4j:1.0") // Purpur
+ /* // Plazma - Use libs.versions.toml
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
+ */ // Plazma - Use libs.versions.toml
}
val craftbukkitPackageVersion = "1_20_R2" // Paper

View File

@@ -4,28 +4,8 @@ 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
index 733134401fcba393053c7a2dfa1d0d44f8f79ff5..79fba35fc74723529bff7d8fdcca7de6407fb5ad 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 {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index 393dab1ece76e0ca1e0b58c0b2c72d5c1c41a84d..cfb74b11743ce2f7a78a6a8085f9dd05b65a3152 100644
index e30b51ed329f0c66a2329da45996ef0fc0db8ffb..d91928799014596de519d1a1b3f1bb0a80ac925c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
@@ -17,7 +17,7 @@ index 393dab1ece76e0ca1e0b58c0b2c72d5c1c41a84d..cfb74b11743ce2f7a78a6a8085f9dd05
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
exclude("io.papermc.paper", "paper-api")
}
@@ -87,7 +87,7 @@ tasks.jar {
@@ -120,7 +120,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -153,7 +153,7 @@ index ed3527612315e6e0649182ce4e1ae2834b0918a9..ae02c029f0169d30a34d4a4e65ea6cb4
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
index ec268189b19b6fa5c4521f96ce211a531db35ec5..ce45a93fe835fd1ea4411c78df430aaa903c83c3 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 {
@@ -169,17 +169,17 @@ index 27a238cc56702297c88fde0f379178222ccf6c5b..30fc258faa6f087cf3c91411b48116a3
+ \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.");
+ if (org.plazmamc.plazma.Options.iKnowWhatIAmDoing)
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ // Plazma end
+
// 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
index b61c4d1ebb9c15a7ecd7bec5eb864851c053fb7e..b4d5bca6e3a39186a988098fb5d4cae97a776e79 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
@@ -913,7 +913,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
@@ -188,6 +188,19 @@ index 8c3942d9ce4f8a102a47bec74af5911760fda4e3..cf9f7d52b07cffd41293ba5a6fab3a7f
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index cda4544ae96a4fcb5c6c4483df67a59f1b53fd27..fe82a20efb2b130a568bc06aec5b86d3082062a3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -58,7 +58,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final boolean onlineMode = this.get("online-mode", true);
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
public final String serverIp = this.get("server-ip", "");
- public final String serverName = this.get("server-name", "Unknown Server"); // Purpur
+ public final String serverName = this.get("server-name", "Plazma Server"); // Purpur // Plazma
public final boolean spawnAnimals = this.get("spawn-animals", true);
public final boolean spawnNpcs = this.get("spawn-npcs", true);
public final boolean pvp = this.get("pvp", true);
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326fc57c32c 100644
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
@@ -220,11 +233,11 @@ index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326
servergui.runFinalizers();
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 75622ee77096d7eb311df0fd16b70c0f6dae3ccc..0325eada6271f021b4cc6e398b6e3e75b915f8aa 100644
index 25540a7f5631acd856726cdb44bace9be7dab401..36a1ac09bec7b4139d1cd44e6ecda72fc30fa8c4 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);
@@ -1323,7 +1323,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
// Spigot start
if (tickingblockentity == null) {
- this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
@@ -246,10 +259,10 @@ index db571f658f636cdda1dcdbaffa0c4da67fae11ad..0ba8a251bf1f5a7a6f27823686bf0d63
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
index a8a887236c68567816badc0620833755c84a4b03..09c292e22788fdf48b639265f24595e14aceba7a 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
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
@@ -258,8 +271,30 @@ index a7081f2ce7e001c9a75b620c55703a0218f6dc28..005c854a10f343cd7488b282de002249
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index d41f9c4a3c992b5dadacb4fcb1107235fff79fa8..49d0cd1275c6bf5165e4880dc322bc93ad3848f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -141,7 +141,7 @@ public class Main {
this.acceptsAll(Main.asList("noconsole"), "Disables the console");
- this.acceptsAll(Main.asList("v", "version"), "Show the CraftBukkit Version");
+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Rebranding
this.acceptsAll(Main.asList("demo"), "Demo mode");
@@ -192,7 +192,7 @@ public class Main {
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
.ofType(String.class)
- .defaultsTo("Unknown Server")
+ .defaultsTo("Plazma Server") // Plazma - Rebranding
.describedAs("Name");
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 465e63a5849e224d86e82ef6c31c99846245e63b..2a384f70d14189af1690caba35b8202da519caf9 100644
index 9c94fd78cbd0d3ef0c4dd3678262126b6ed2847b..653ba98a1b69f25b781f8794c7d2ae8c5445cfa6 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 {
@@ -272,7 +307,7 @@ index 465e63a5849e224d86e82ef6c31c99846245e63b..2a384f70d14189af1690caba35b8202d
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index a4567188e2fe3f922bb6aeb71a2845d1a1be536f..267555c309c44067ac0e011784870bad802bc292 100644
index 7902c649a54fccbb13531c01e052df87ec4a424a..e8f50fdd7791fa8acc6eccdef40349845696b357 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 {
@@ -321,6 +356,19 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
}
+ // Plazma end
}
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
new file mode 100644
index 0000000000000000000000000000000000000000..a858b7ddef7f6877c0b92f4150e0dd37bea121aa
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -0,0 +1,7 @@
+package org.plazmamc.plazma;
+
+public interface Options {
+
+ boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -335,7 +383,7 @@ index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa453
serverModName = getString("settings.server-mod-name", serverModName);
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index dbd502761ff6e6efb252bb41376a7ff028c73895..c765cb5dd8c3c1b668b7031e6c784ed9cf2d58e1 100644
index 5fc8cc40ab627eba0b2110c73d31af213a935733..969ac1b2f824af361beec4afa00b15f13f6868ce 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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
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 69c4d9cb0532621018f6cd99916c409fc150ab7e..5875aae8d7d0146ef9903d8b4bc2b673a615fd98 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -23,4 +23,23 @@ 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 Miscellaneous misc;
+ public class Miscellaneous extends ConfigurationPart {
+
+
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 842fb520a2d638aaa5bd0a7198190dbe3ecbe14c..a372b5be3b1da5868d3766a8ba58997a48118581 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -19,4 +19,32 @@ public class WorldConfigurations extends ConfigurationPart {
@Setting(Configuration.VERSION_FIELD)
int version = VERSION;
+ public Miscellaneous misc;
+ public class Miscellaneous extends ConfigurationPart {
+
+
+ }
+
+ public Entity entity;
+ public class Entity extends ConfigurationPart {
+
+ public Phantom phantom;
+ public class Phantom extends ConfigurationPart {
+
+
+ }
+
+ }
+
+ public Structure structure;
+ public class Structure extends ConfigurationPart {
+
+ public NetherPortal netherPortal;
+ public class NetherPortal extends ConfigurationPart {
+
+
+ }
+
+ }
+
}

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:13:14 +0900
Subject: [PATCH] Always agree EULA on development mode
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index ce45a93fe835fd1ea4411c78df430aaa903c83c3..9b8bdffbbfe45c6712d0f4da3643424fa94fc69e 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -178,6 +178,7 @@ public class Main {
// Spigot Start
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev"); // Plazma
if ( eulaAgreed )
{
System.err.println( "You have used the Spigot command line EULA agreement flag." );

View File

@@ -1,18 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 16:02:29 +0900
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 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..fa88d48adc3aefcd823f431f099e46c94fd071a1 100644
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..f006c867ad0765e0f52a629729ab131acec5c2fc 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 {
@@ -636,16 +636,52 @@ public class Metrics {
return map;
}));
+ // Plazma start - Add more metrics
+ // Plazma start
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
@@ -22,7 +22,7 @@ index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..fa88d48adc3aefcd823f431f099e46c9
+ 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);
+ else return Collections.singletonMap("50+", entry);
+ }));
+
+ List<Plugin> plugins = Arrays.stream(Bukkit.getPluginManager().getPlugins()).toList();
@@ -36,19 +36,20 @@ index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..fa88d48adc3aefcd823f431f099e46c9
+ 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);
+ else 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);
+ 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);
+ return Collections.singletonMap("50+ \uD83D\uDE2D", entry);
+ else if (disabled <= 100) return Collections.singletonMap("50-100 \uD83D\uDE2D", entry); // :cry:
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
+ }));
+ // Plazma end
+

View File

@@ -3,149 +3,266 @@ 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
index 9ca1494497ae53e56b1f81fda51b0b8bd02a6d03..97b1366d25537d68469e95ac101b1b8cf9fdc997 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 {
@@ -64,7 +64,7 @@ public class PufferfishConfig {
getString("info.version", "1.0");
setComment("info",
"Pufferfish Configuration",
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - no advertisement
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Nope
"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 {
@@ -211,7 +211,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
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
@@ -233,7 +233,7 @@ public class PufferfishConfig {
@@ -225,7 +225,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
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -241,7 +241,7 @@ public class PufferfishConfig {
@@ -233,7 +233,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
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how much distance modifies an entity's",
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.",
@@ -253,8 +253,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() {
// Set some defaults
+ // Plazma start - Optimize default configurations
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
+ getInt("entity_timeouts.ARROW", 200);
+ getInt("entity_timeouts.EGG", 200);
+ getInt("entity_timeouts.ENDER_PEARL", 200);
+ getInt("entity_timeouts.SNOWBALL", 200);
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
+ } else {
+ // Plazma end
getInt("entity_timeouts.SNOWBALL", -1);
getInt("entity_timeouts.LLAMA_SPIT", -1);
+ } // Plazma
setComment("entity_timeouts",
"These values define a entity's maximum lifespan. If an",
"entity is in this list and it has survived for longer than",
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index c69892a5f31895b85e530beadd8864ac32470ba7..5f652268dadaca96a98203ad12d7a0ba0b19563b 100644
index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3ec767e36d 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 {
@@ -155,7 +155,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;
@@ -193,7 +193,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;
}
@@ -242,7 +242,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public BookSize bookSize;
public class BookSize extends ConfigurationPart {
- public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above
+ public int pageMax = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize default configurations
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
}
public boolean resolveSelectorsInBooks = false;
@@ -253,7 +253,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) {
@@ -321,7 +329,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 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced85101f6e 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 {
@@ -96,12 +96,32 @@ public class WorldConfiguration extends ConfigurationPart {
public class AntiXray extends ConfigurationPart {
public boolean enabled = false;
- public EngineMode engineMode = EngineMode.HIDE;
+ public EngineMode engineMode = org.plazmamc.plazma.configurations.PlazmaConfigurations.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,
@@ -128,7 +148,28 @@ public class WorldConfiguration extends ConfigurationPart {
Blocks.ENDER_CHEST
//</editor-fold>
);
- public List<Block> replacementBlocks = List.of(Blocks.STONE, Blocks.OAK_PLANKS, Blocks.DEEPSLATE);
+ public List<Block> replacementBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? List.of(
+ //<editor-fold desc="Anti-Xray Hidden 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 {
@@ -152,14 +193,14 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart {
- public boolean doCollisionEntityLookups = true;
- public boolean tick = true;
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean tick = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
}
public Markers markers;
public class Markers extends ConfigurationPart {
- public boolean tick = true;
+ public boolean tick = !org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
}
public Sniffer sniffer;
@@ -182,7 +223,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
@ConfigSerializable
public record DespawnRange(@Required int soft, @Required int hard) {
@@ -375,7 +387,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -381,7 +422,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 {
@@ -433,7 +474,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 {
@@ -460,9 +501,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 {
@@ -470,18 +511,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 +270,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,44 +301,44 @@ index ec5e23136423e42e4f55e6ea646b8285c1ca14e2..a1d22ad65fc751fa93384f59853434ab
});
public boolean flushRegionsOnSave = false;
}
@@ -491,9 +525,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -496,9 +560,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 {
@@ -525,9 +589,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.aggressiveOptimize; // 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 boolean disableEndCredits = false;
public float maxLeashDistance = 10f;
public boolean disableSprintInterruptionOnAttack = false;
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
index 24763d3d270c29c95e0b3e85111145234f660a62..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 9b8bdffbbfe45c6712d0f4da3643424fa94fc69e..84eca01450db5b737c676cab2439d041141c323d 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 {
@@ -229,41 +346,30 @@ index 30fc258faa6f087cf3c91411b48116a3ac416031..a32a1787cbcacb0d3ed6f0d751a04e8f
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 fe82a20efb2b130a568bc06aec5b86d3082062a3..8dddcacec38bf2d5d79ce7fc0f26a2cced5d271d 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);
@@ -131,14 +131,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);
@@ -277,33 +383,31 @@ index cda4544ae96a4fcb5c6c4483df67a59f1b53fd27..54f2c5187322c6dea70c4e0e63cce2e6
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 6537ae98dc4086f2b6668810425f80c19ef57734..da483bdf81efa62b36b6a10dacc7821b43dd18b7 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 {
@@ -433,7 +433,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/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
index 39db772735d57e12bbb26a6505ca7a5e360cdd78..eabd643bf096786285ee21e898b2bf8460cd5a26 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -302,7 +302,7 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Le
}
}
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index a858b7ddef7f6877c0b92f4150e0dd37bea121aa..eab5ea835a524482f8cc043c7be190a835335ed2 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -3,5 +3,6 @@ package org.plazmamc.plazma;
public interface Options {
- public static boolean optimizeConfig() {
+ public static boolean doOptimize() {
return OPTIMIZE_CONFIG;
}
boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean aggressiveOptimize = Boolean.getBoolean("Plazma.aggressiveOptimize");
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index d0d31002562e728fa1a6c9bc81baa4534f11d365..5f0b10932f8dda09131ba68207cbfea4715e0f33 100644
index d0d31002562e728fa1a6c9bc81baa4534f11d365..f9f7664e4a6a4e24dcb3b8da0a807a984a698429 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 {
@@ -319,34 +423,43 @@ index d0d31002562e728fa1a6c9bc81baa4534f11d365..5f0b10932f8dda09131ba68207cbfea4
}
- 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);
}
@@ -481,7 +482,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 b9d1117885a8dd15f207e55ce5e402d8cefe0226..9cb79d203b6ec345d719cd488d2cce8f877fe2bd 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 {
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
public boolean idleTimeoutTargetPlayer = true;
public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100;
- public boolean teleportIfOutsideBorder = false;
+ public boolean teleportIfOutsideBorder = org.plazmamc.plazma.configurations.PlazmaConfigurations.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 {
@@ -3070,7 +3070,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true;
- public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = 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 f9b8e2bc039f1a37e47f84909c8785f3ef530284..576e82d2cf933b307b7374b60d864e98be4afcb2 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -150,14 +150,14 @@ public class SpigotWorldConfig
@@ -354,7 +467,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
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", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations
this.log( "Item Merge Radius: " + this.itemMerge );
}
@@ -362,7 +475,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
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", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations
this.log( "Experience Merge Radius: " + this.expMerge );
}
@@ -371,7 +484,7 @@ 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 );
}
@@ -381,37 +494,37 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
- 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 animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32; // Plazma - Optimize default configurations
public int raiderActivationRange = 48;
- public int miscActivationRange = 16;
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 8 : 16; // Plazma - Optimize default configurations
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
// Paper start
- public int flyingMonsterActivationRange = 32;
- public int waterActivationRange = 16;
- public int villagerActivationRange = 32;
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.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 flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32; // Plazma - Optimize default configurations
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
public int wakeUpInactiveAnimals = 4;
public int wakeUpInactiveAnimalsEvery = 60*20;
- public int wakeUpInactiveAnimalsFor = 5*20;
- public int wakeUpInactiveMonsters = 8;
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 40 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 4 : 8; // Plazma - Optimize default configurations
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveMonstersEvery = 20*20;
- public int wakeUpInactiveMonstersFor = 5*20;
- public int wakeUpInactiveVillagers = 4;
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 4; // Plazma - Optimize default configurations
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4; // Plazma - Optimize default configurations
public int wakeUpInactiveVillagersEvery = 30*20;
- public int wakeUpInactiveVillagersFor = 5*20;
- public int wakeUpInactiveFlying = 8;
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 20 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 1 : 8; // Plazma - Optimize default configurations
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveFlyingEvery = 10*20;
- public int wakeUpInactiveFlyingFor = 5*20;
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.doOptimize() ? 60 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
public int villagersWorkImmunityAfter = 5*20;
public int villagersWorkImmunityFor = 20;
public boolean villagersActiveForPanic = true;
@@ -420,7 +533,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
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 );
@@ -429,7 +542,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
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 );
}

View File

@@ -1,11 +1,11 @@
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
index e4fd372a1d585887287253a02531cd192929377b..6624fb97404c3032d60167e3fb108dcfcd066784 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 {
@@ -13,12 +13,12 @@ index e4fd372a1d585887287253a02531cd192929377b..dae0b0e1288afe0d8eb70d0e8e2db152
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
+ 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 - Tweak console logging
}
}
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 00fbcb941fe393197619762722eb51d62fb073c2..770b959d9e51ef0645415d5a0d7d79b7031abd66 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
@@ -38,24 +38,19 @@ index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb17
DedicatedServer.LOGGER.info("Loading properties");
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
@@ -318,6 +308,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -319,6 +309,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 (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.offlineWarnings) // 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.");
@@ -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
@@ -335,6 +326,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
}
+ // Plazma start - Console logging tweaks
+ // Moved down
+ // Plazma - Moved down - Tweak console logging
+ // Paper start - detect running as root
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
+ DedicatedServer.LOGGER.warn("****************************");
@@ -70,27 +65,25 @@ index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb17
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 182acaad79e14e5e120094916a0d295a4584de7a..e8de78f8b7c90a719e10c483991f45a7886256be 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 {
}
@@ -1462,6 +1462,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
// Paper end
- boolean flag = this.verifyChatTrusted(message);
+ boolean flag = !org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || this.verifyChatTrusted(message); // Plazma
boolean flag = this.verifyChatTrusted(message);
+ flag = flag || org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix; // Plazma - Tweak console logging
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index d506e0c2b37f91e46e682652bd134ad91db28f84..44df2c0a1ed3d006b455ba2a47d6bc9059d804e1 100644
index 5875aae8d7d0146ef9903d8b4bc2b673a615fd98..51413e828500792cc493b836bb1460a394ff4f75 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 {
@@ -42,4 +42,13 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+
+ public ConsoleLogs consoleLogs;
+ public class ConsoleLogs extends ConfigurationPart {
+
@@ -99,4 +92,5 @@ index d506e0c2b37f91e46e682652bd134ad91db28f84..44df2c0a1ed3d006b455ba2a47d6bc90
+ public boolean notSecurePrefix = true;
+
+ }
+
}

View File

@@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 16:59:14 +0900
Date: Sun, 5 Nov 2023 10:49:05 +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
index 3dcccca8ede9b203c24ba29b2020a583297b895c..dd707019fb9b2c46d706311862fea91b84793ff9 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,
@@ -160,6 +160,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]);
@@ -17,15 +17,14 @@ index b875f4af9dcb45bcad0ee59a958442ba673268fe..d38685f82d2e6c4e71179bf3a85a8b18
// 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
index 51413e828500792cc493b836bb1460a394ff4f75..c85f1a01c951f85c2347eba18a896e87c4c8b368 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 {
@@ -26,6 +26,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Player player;
public class Player extends ConfigurationPart {
+ public boolean allowAnyUsername = false;
+
}
public ConsoleLogs consoleLogs;

View File

@@ -33,7 +33,7 @@ index c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1a
@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 cd9129bb5049c13f08c58b8581d511b59a5bb1b5..bcc3458afac5ece9637df63b9d02c445aa0a4ef9 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
@@ -163,7 +163,7 @@ index 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652
@Override
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
index e88c39d405fc7068db64ad34a03dec8d559e749e..bb5d42ca73722f3a02154ed889625ded2ac63e6f 100644
index d70c1206df96b03c031399049a65e6a765d80347..e885d2f21cfbf1fd1c61b29e34f3f51a9decfe88 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
@@ -185,7 +185,7 @@ index e88c39d405fc7068db64ad34a03dec8d559e749e..bb5d42ca73722f3a02154ed889625ded
@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 f9f7664e4a6a4e24dcb3b8da0a807a984a698429..22e74b716d29ecfe75bd49234bef861cd97cb79e 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 {
@@ -205,10 +205,10 @@ index 5f0b10932f8dda09131ba68207cbfea4715e0f33..92cb442d9326b4fd47cd6ec0425192f7
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 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73e18405c6 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 {
@@ -1115,7 +1115,15 @@ public class PurpurWorldConfig {
public boolean allayRidableInWater = true;
public boolean allayControllable = true;
public List<String> allayRespectNBT = new ArrayList<>();
@@ -224,7 +224,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
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 {
@@ -1234,7 +1242,15 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
@@ -240,7 +240,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
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 {
@@ -1662,7 +1678,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
@@ -256,7 +256,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
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 {
@@ -2617,7 +2641,13 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
public double snifferMaxHealth = 14.0D;
public int snifferBreedingTicks = 6000;
@@ -270,7 +270,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
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 {
@@ -2716,7 +2746,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
@@ -286,7 +286,7 @@ index d65d3fd4572a4f5c9b3d2d4e2c0a907aae824cde..1ea0fe11fd9e9a8f300efc85926b9724
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 {
@@ -2926,7 +2964,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;

View File

@@ -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); }
+
+ }
+
+ }
+
}
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add some missing Pufferfish configurations
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index c97ef420581803b569d130b58a97f67d1fee54f2..e562dffdf84612b50c5d464f9913cfe8ec5c6279 100644
index bcc3458afac5ece9637df63b9d02c445aa0a4ef9..0ee7a663988bbcc37d72da690fa9372ca1d14425 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -168,10 +168,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl

View File

@@ -5,7 +5,7 @@ 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
index 389322d3ca9b1f3789271936a7e6c60bd7c27893..6ca87960654becdc7fd7d9b8465a140c0db2b8b9 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;
@@ -49,21 +49,37 @@ index 11de2f237e6dd950b8ddba3d5cfe9066d09f0903..44248dc470d0882b7287debd1993cedf
@Nullable
private MinecraftServer.TimeProfiler debugCommandProfiler;
private boolean debugCommandProfilerDelayStart;
@@ -2309,10 +2309,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2302,10 +2302,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
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
return this.profiler;
}
+ */ // Plazma - Completely remove profiler
public abstract boolean isSingleplayerOwner(GameProfile profile);
@@ -2542,6 +2544,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// CraftBukkit end
+ /* // Plazma - Completely remove profiler
private void startMetricsRecordingTick() {
if (false && this.willStartRecordingMetrics) { // Purpur
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
@@ -2557,6 +2560,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//this.metricsRecorder.startTick(); // Purpur
//this.profiler.startTick(); // Purpur
}
+ */ // Plazma - Completely remove profiler
private void endMetricsRecordingTick() {
//this.profiler.endTick(); // Purpur
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
index ebcd2bbcf8f25c52de3deaff32a8522dbf662141..0ff246c5f7c6f02c12a55b1d9c7b35ad3fd4c1c0 100644
index 8189c549edd14a351fc5e75be23da7378bbd3532..8c44b54aa6b3db4f52d0d6ad7f3d341f11b293f7 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;
@@ -120,7 +136,7 @@ index 097ac55028d66ef9ab430ff5dd103db6e3b99fc7..2993e9f326c43ef3f06d5e332899f9fa
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
index 3771caa73b0b41428f3d629aca1f562df7bcfaff..a88f6bbed191b6fd3ef2da625df45520331cf7d7 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;
@@ -133,7 +149,7 @@ index 3f4df62773dfe1045914325ce5bc13162192679c..0f27bdc25dc5246d98358a26e1d01e17
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
index 43a46feb5fb4bf23d71bc4f6c08caa93b1959ffc..16c2db8fbfcaf15efb94c04e1bb2508e85812690 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;
@@ -146,7 +162,7 @@ index 6255960ae70e14eb11da5043eb003575e300ddf6..999f57366cad34f92a1f80437bf7bd84
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
index e46207a250a5456589da06fd5fad2a385ef7d4a5..9301ec8142fbf5c5112cac75aef1b8e35737ce43 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;
@@ -162,8 +178,8 @@ index e7efdd572716e50ecca217898b8a368e5829f925..72c2af8638d71b92a9762dedb0efec53
// 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
- 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, minecraftserver.registryAccess())), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), 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, minecraftserver.registryAccess())), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), 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());
@@ -172,8 +188,8 @@ index e7efdd572716e50ecca217898b8a368e5829f925..72c2af8638d71b92a9762dedb0efec53
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.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);
@@ -635,38 +651,8 @@ index 863343a87fe34d72f04af89d75268b477b2adc7a..00000000000000000000000000000000
- }
- }
-}
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
index 80c03bd4e5d7e20bb8a4e14af5620f5c57a05fd4..aeae6117b398b84d5c8ecaa175a72867416ff166 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 {
@@ -675,8 +661,8 @@ index d35afa8f8648bbcbfc044323bcda1b1182d7dce4..fb5c21ba15995d00da87ee6ef9e4ab8f
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.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);
@@ -715,7 +701,7 @@ index 02978315bc2b828cc603ce7478408f3f82c249c2..4f9b19c45afd6b26833ba892a90d3a95
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
index 388363948595247471fa4c3c6801fc493d61c0d0..6851ee45b5b41cf549a8aed14d95545b0d120414 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;
@@ -737,7 +723,7 @@ index 666fc85bc2079cb367b340f2605f29fe002f4d22..36c60716c6aaa446ff7123a3babafb2e
// 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
index af4eb54d99b67d059534e5e55e952aa41bb87bc7..412dd103bad498c3c93b7a3ab98f834944d514eb 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;
@@ -758,16 +744,16 @@ index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e561
public final boolean isClientSide;
private final WorldBorder worldBorder;
private final BiomeManager biomeManager;
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -262,7 +262,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
//protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI
- 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
- 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.WorldConfigurations> plazmaWorldConfigurationCreator, 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.WorldConfigurations> plazmaWorldConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // 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 {
this.plazmaConfig = plazmaWorldConfigurationCreator.apply(this.spigotConfig); // Plazma
@@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
// CraftBukkit end
@@ -776,7 +762,7 @@ index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e561
this.levelData = worlddatamutable;
this.dimensionTypeRegistration = holder;
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
@@ -1830,6 +1830,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1833,6 +1833,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false;
}
@@ -784,7 +770,7 @@ index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e561
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 {
@@ -1841,6 +1842,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public Supplier<ProfilerFiller> getProfilerSupplier() {
return this.profiler;
}
@@ -816,7 +802,7 @@ index 0f1025495237aebe30132ace0832aa5718d6f9bb..0226280bbdb9d63831d93f980ee117da
+ */ // 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
index 66656c4cf157228c9f52b33b358713ef0172f9ff..a8a360b794cec35b9f7ab137aaf35fba1d610f26 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;
@@ -828,7 +814,7 @@ index 8d385708df97d47881929d4352f1b90286aad1a2..a25b93f98b2c525b146c979df2a95a9a
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 {
@@ -455,7 +455,7 @@ public class LevelChunk extends ChunkAccess {
}
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
@@ -836,7 +822,7 @@ index 8d385708df97d47881929d4352f1b90286aad1a2..a25b93f98b2c525b146c979df2a95a9a
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove profiler
//gameprofilerfiller.push("updateSkyLightSources"); // Purpur
this.skyLightSources.update(this, j, i, l);
// Paper - starlight - remove skyLightSources
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
@@ -869,7 +855,7 @@ index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..b9689131a7a46b46c0b75b86f2bb163d
//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
index 08f5239d5eea9133340ec9e1a3a7d8d5e792ced0..ad306d5d69b2bd6ac4ddbdd13dd0a34c9c4cc4f5 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;
@@ -877,16 +863,16 @@ index dd375fffa727db76fa989248b9b836960974c372..45161f960a29395538c67461ebf864e5
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.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler // 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
import org.bukkit.craftbukkit.CraftLootTable;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -36,7 +36,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
+ 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);

View File

@@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 11:27:51 +0900
Subject: [PATCH] Add option to change nether portal size
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
index e7554ec800f321e4e34c926c53f2375a8c3aa979..fc3c0ea41563995b1b115271cda4e9ca76245c4e 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().plazmaConfig().structure.netherPortal.width.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() ? i : 0; // Plazma - Configurable nether portal size
}
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
@@ -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().plazmaConfig().structure.netherPortal.height.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma - Configurable nether portal size
}
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
@@ -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().plazmaConfig().structure.netherPortal.width.min() && this.width <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() && this.height >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.min() && this.height <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max(); // Plazma - Configurable nether portal size
}
// CraftBukkit start - return boolean
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index a372b5be3b1da5868d3766a8ba58997a48118581..d79410cc8b6054e5d3297b3e768fb232f97062e4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -42,6 +42,21 @@ public class WorldConfigurations extends ConfigurationPart {
public NetherPortal netherPortal;
public class NetherPortal extends ConfigurationPart {
+ public Width width;
+ public class Width extends ConfigurationPart {
+
+ int min = 2; public int min() { return Math.max(this.min, 1); }
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
+
+ }
+
+ public Height height;
+ public class Height extends ConfigurationPart {
+
+ int min = 3; public int min() { return Math.max(this.min, 2); }
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
+
+ }
}

View File

@@ -5,7 +5,7 @@ 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
index 6ca87960654becdc7fd7d9b8465a140c0db2b8b9..cda99102949ae9d722c347e0dd610dfff625b5b8 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
@@ -13,12 +13,12 @@ index 44248dc470d0882b7287debd1993cedf0f238aca..ee571f465ca1e83e760a4d57b3d11acc
@Nullable
private ServerStatus.Favicon statusIcon;
- private final RandomSource random;
+ private final RandomSource random; public RandomSource getRandom() { return this.random; } // Plazma
+ private final RandomSource random; public RandomSource random() { return this.random; } // Plazma - expose random
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
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..e27867a95d49531507de63be09604d476a0e43e5 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 {
@@ -26,34 +26,34 @@ index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..7834700eb0e1d789f7b338b535a0a9f8
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
+ RandomSource randomsource = worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
double d0 = (double) (center.x - maxRange);
double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 99cf8ce63316e127a5ee84cdd96df80d440dc0c3..c3bb82793ecd5333d8dbef7a90729d80616ea4ce 100644
index 7b72be8dcaf3fc5c7151c847faa2dfc75ef9eeb7..9a818c8f1450d31d29fd72cda45a14eec9034615 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 {
@@ -449,7 +449,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
+ int k1 = (worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
@@ -485,7 +485,7 @@ public class ServerPlayer extends Player {
@@ -486,7 +486,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
+ int k1 = (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index d38685f82d2e6c4e71179bf3a85a8b183aa6c44b..1265e6a521222be0c957065f5b788d68cb3d863f 100644
index dd707019fb9b2c46d706311862fea91b84793ff9..05ef30ecdb68d1d254246431e7d5cecf9a38427e 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,
@@ -61,12 +61,12 @@ index d38685f82d2e6c4e71179bf3a85a8b183aa6c44b..1265e6a521222be0c957065f5b788d68
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
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? server.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
}
@Override
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
index 1ef089dbf83de35d875c00efdf468c397be56978..7f4c0827d2269baa032dac4798fe6c2a740ba7fa 100644
index 1ef089dbf83de35d875c00efdf468c397be56978..832c3fa9f6f6706c48d5744e15d3c748edafe8a4 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 {
@@ -74,25 +74,12 @@ index 1ef089dbf83de35d875c00efdf468c397be56978..7f4c0827d2269baa032dac4798fe6c2a
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.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
}
diff --git a/src/main/java/net/minecraft/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
index fe3ab3d388f0481fb0db06b7f730f868dbf8e8a5..57d4eec19146f2ec36c8f99a4c77f2a20aa7cd09 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;
@@ -100,12 +87,12 @@ index fe3ab3d388f0481fb0db06b7f730f868dbf8e8a5..265d8479b5c02994dba4288060b84278
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 RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : 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
index 7094701d213c73ba47ace806962244c10fdf4dda..590c26307374edd65a2e22de18d12f34addcef64 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;
@@ -113,12 +100,12 @@ index 7094701d213c73ba47ace806962244c10fdf4dda..288ae299240c9626e576a7ae1c45c53d
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 RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
private static final int DEFAULT_SCAN_RATE = 20;
protected static final int TARGETING_RANGE = 16;
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.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
index ece82743df21f0b776382821ad75dee96d0a0748..44db438185d1ffb1adea09ba5f1cf4515a113700 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 {
@@ -126,12 +113,12 @@ index ece82743df21f0b776382821ad75dee96d0a0748..c25affe40eea32e1964aa4c62fdd27fa
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
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
int highestAnger;
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create((instance) -> {
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
index a5443f92786427c42092aec8350e7ab37704db7a..0383c9e75a12c5832cf69daf14b8037365c43cfb 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 {
@@ -139,12 +126,12 @@ index a5443f92786427c42092aec8350e7ab37704db7a..b1a44e460175b974e8830030ce61e523
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 RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - reduce create random instace
private final ServerLevelData serverLevelData;
private int tickDelay;
private int spawnDelay;
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319..f1b0b8fd1042f2ce8a514000d95df5123223cc27 100644
index a2093158e57d5f43c4afa66386481b82b3c4c3c4..2b75115caf82b9c4ccdd813b98af569e80ac2629 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 {
@@ -152,12 +139,12 @@ index a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319..f1b0b8fd1042f2ce8a514000d95df512
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.syncronizedRandom = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
this.openWater = true;
this.currentState = FishingHook.FishHookState.FLYING;
this.noCulling = true;
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index eaa2943b667967f93f28d9d794d702fdaeb670ec..75ba586277ece1aa56186679d3a8ebf0b3f7a0cb 100644
index eaa2943b667967f93f28d9d794d702fdaeb670ec..689a4ee7b3f136b14e8e56709cac7d2da89c8efd 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 {
@@ -165,7 +152,7 @@ index eaa2943b667967f93f28d9d794d702fdaeb670ec..75ba586277ece1aa56186679d3a8ebf0
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.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.waveSpawnPos = Optional.empty();
this.id = id;
this.level = world;
@@ -174,12 +161,12 @@ index eaa2943b667967f93f28d9d794d702fdaeb670ec..75ba586277ece1aa56186679d3a8ebf0
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.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.waveSpawnPos = Optional.empty();
this.level = world;
this.id = nbt.getInt("Id");
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
index d604b7ec46f08993647979ed220a84842e3fe325..f2a3049252a37ca6d6d5cb1cc51d512c7ebf5679 100644
index d604b7ec46f08993647979ed220a84842e3fe325..b0b6580a08b15dbfc542ee1fd9e5b6737f8af004 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 {
@@ -187,12 +174,12 @@ index d604b7ec46f08993647979ed220a84842e3fe325..f2a3049252a37ca6d6d5cb1cc51d512c
// 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.random = playerInventory.player.level().plazmaConfig().misc.reduceRandom ? playerInventory.player.level().random : RandomSource.create(); // Plazma - Reduce create random instace
this.enchantmentSeed = DataSlot.standalone();
this.costs = new int[3];
this.enchantClue = new int[]{-1, -1, -1};
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index ef9b1687dd2dfda5398523140aecc678b4690642..66a1db10249995144490dac292e09fd0aa30f168 100644
index ef9b1687dd2dfda5398523140aecc678b4690642..130a41387a2546b31019ad918849b2c283ed09d9 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 {
@@ -200,12 +187,12 @@ index ef9b1687dd2dfda5398523140aecc678b4690642..66a1db10249995144490dac292e09fd0
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.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.toBlow = new ObjectArrayList();
this.hitPlayers = Maps.newHashMap();
this.level = world;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 1a5880ae3c3b17d49f0b083dff66e5619c08ec20..e175cde654b36d8ffc98a36ef099d22e9f1d15e9 100644
index 412dd103bad498c3c93b7a3ab98f834944d514eb..7a7f417c2a0af73a35297274b8ddd6ac581901ae 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 {
@@ -219,16 +206,16 @@ index 1a5880ae3c3b17d49f0b083dff66e5619c08ec20..e175cde654b36d8ffc98a36ef099d22e
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
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? random.nextInt() : RandomSource.create().nextInt(); // Plazma - Reduce create random instace
/** @deprecated */
@Deprecated
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.suppressThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
private final ResourceKey<DimensionType> dimensionTypeId;
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..b8d2c91a343478d89a5242254f3379dfa2556348 100644
index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..9ec2a60c8240f7a3e4cd7944d070156dbf55ac2c 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
@@ -236,12 +223,12 @@ index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..b8d2c91a343478d89a5242254f3379df
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 static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
private 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
index 7291e4056b8e46ab59b71818388ac55fbb12993f..b847f59c5d3e0d7ccb22eaa5d9068082db5ba9a4 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 {
@@ -249,12 +236,12 @@ index 7291e4056b8e46ab59b71818388ac55fbb12993f..22faea52bc54cdcb52ff18a9d5a8c1bd
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
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instance
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..c85340232624529d4685bf34035bb62d294695c9 100644
index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..3a4044271e23faf4c5271237aba700103f6df830 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 {
@@ -262,12 +249,12 @@ index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..c85340232624529d4685bf34035bb62d
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
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
// Paper start
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
index 18fce94f0d4b9d28e3afec61c7578f672973a71f..c98d65c146213bdf530916b8ec371e0b0b8f23e7 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 {
@@ -275,12 +262,12 @@ index 18fce94f0d4b9d28e3afec61c7578f672973a71f..2dfb801ec15a372bcb997942969fec64
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
+ Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? 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
index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..c8b29f79725bb9ccec5b48476e242609a452402c 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 {
@@ -288,7 +275,7 @@ index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..67b4a65980059b0b2d4929c619c400c4
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
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instace
});
}
@@ -297,36 +284,15 @@ index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..67b4a65980059b0b2d4929c619c400c4
}
// 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
+ if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), this.portalLocation)) { // Plazma - Reduce create random instace
int i = Mth.positiveCeilDiv(4, 16);
this.level.getChunkSource().chunkMap.waitForLightBeforeSending(new ChunkPos(this.portalLocation), i);
diff --git a/src/main/java/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
index c13cdbaf7abdf120a3969f8e887b4c3b78989c9c..5bb9bfbad85a115bf32955c2abc89edc2e7a6e43 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;
@@ -14,11 +14,12 @@ import org.bukkit.inventory.meta.FireworkMeta;
public class CraftFirework extends CraftProjectile implements Firework {
@@ -336,59 +302,32 @@ index 68c5af9b67a2834ee6e2f80ceefa19c3a982b8ed..aabbf9ae1b772c9101e6f36236e5d34a
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
+ this.random = this.getHandle().level().plazmaConfig().misc.reduceRandom ? this.getHandle().level().getRandom() : net.minecraft.util.RandomSource.create(); // Plazma - Reduce create random instance
// Paper Start - Expose firework item directly
// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM);
diff --git a/src/main/java/org/plazmamc/plazma/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
index c85f1a01c951f85c2347eba18a896e87c4c8b368..d88208cb454d1042440803c817d99c5dcb775330 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;
}
@@ -40,6 +40,8 @@ public class GlobalConfiguration extends ConfigurationPart {
public Miscellaneous misc;
public class Miscellaneous extends ConfigurationPart {
+ public boolean reduceRandom = OPTIMIZE;
+ public boolean ignoreThreadSafeRandom = false;
}
@@ -34,6 +34,9 @@ public class GlobalConfiguration 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 d79410cc8b6054e5d3297b3e768fb232f97062e4..e9850b634c4e9bbebea6534690632b067b69b0b6 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -22,6 +22,7 @@ public class WorldConfigurations extends ConfigurationPart {
public Miscellaneous misc;
public class Miscellaneous extends ConfigurationPart {
}
+ public boolean reduceRandom = OPTIMIZE;
+ 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;

View File

@@ -7,10 +7,10 @@ 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 a13e6d41584a55e3e17d55d568b23f48082750ef..23eb620351ee08cac97e0408f1fc6cee33f036d0 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 {
@@ -2139,8 +2139,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void playerTouch(Player player) {}
public void push(Entity entity) {
@@ -21,7 +21,7 @@ index 1ca91631b03c9690b4f661ecfb4d500d23cb47ec..4461dc1b76cc2939130680f8039b69af
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
@@ -2135,7 +2136,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2169,7 +2170,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}

View File

@@ -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 {

View File

@@ -1,30 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 22:15:39 +0900
Date: Sun, 5 Nov 2023 12:03:06 +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
index 02364a148b347e3669275553004391e31d77c0b5..cd2d3707c8e4a313ad15958b2f926be6e05bcd4d 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
+ if (player == null && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.refreshLootTableForNonPlayerInteraction) return; // Plazma
if (this.level != null && this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper - don't unpack loot table if not in world
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
index d88208cb454d1042440803c817d99c5dcb775330..c687f448761a591900ae5ebad9c8dfca572e9b31 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 {
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
public boolean suppressThreadSafeRandom = DO_OPTIMIZE;
+ public boolean dontRefreshLootTableForNonPlayerInteraction = DO_OPTIMIZE;
public boolean reduceRandom = OPTIMIZE;
public boolean ignoreThreadSafeRandom = false;
+ public boolean refreshLootTableForNonPlayerInteraction = !OPTIMIZE;
}

View File

@@ -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;
+ }
+ }
+}

View File

@@ -1,36 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 22:17:11 +0900
Date: Sun, 5 Nov 2023 12:07:06 +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
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..49a8a81c586908278d1e3cbd51dea307540f28ec 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
+ if (!world.plazmaConfig().entity.phantom.loadChunksToSpawn && !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 {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index e9850b634c4e9bbebea6534690632b067b69b0b6..036c0b12553ae203e8c73d44dc2e3d625b812af5 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -32,6 +32,7 @@ public class WorldConfigurations extends ConfigurationPart {
public Phantom phantom;
public class Phantom extends ConfigurationPart {
+ public Phantom phantom;
+ public class Phantom extends ConfigurationPart {
+
+ public boolean dontLoadChunksToSpawn = DO_OPTIMIZE;
+
+ }
+
}
+ public boolean loadChunksToSpawn = !OPTIMIZE;
}
public Structure structure;

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 12:16:14 +0900
Subject: [PATCH] Add option to disable moved to quickly check for specific
players
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a7e82f95db5c6c054175192f019072006a3ef31f..21def42f813f00c9fbc9c920b9ba61efc5928ef6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1439,6 +1439,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") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) // 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/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index c687f448761a591900ae5ebad9c8dfca572e9b31..f3cf7634a5fd470e7fb295ae1f88e14f0c4a0d1d 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 class Player extends ConfigurationPart {
public boolean allowAnyUsername = false;
+ public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
}

View File

@@ -3,6 +3,7 @@ From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 28 Sep 2023 11:47:50 +0900
Subject: [PATCH] Implement No Chat Reports
Implemented: 62fbdef42dfbfec551d8324b7084c4ccf248bab7
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 40f51062624161892c780ddae05e22859e2cd021..b0b515b8ebeffe25a760d7d6faa87cbc1a585b2d 100644
@@ -81,22 +82,22 @@ index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..4d9f73add791cef03cc7aeaf1598a73c
}
}
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
index 770b959d9e51ef0645415d5a0d7d79b7031abd66..82670c8bc74cbb208a91cec433498b823e86ce2e 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
@@ -682,6 +682,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override
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;
}
// Paper start - fix secure profile with proxy online mode
return dedicatedserverproperties.enforceSecureProfile
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
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
index b19c59a87d4136da583a0b687f6b27fef3456f09..b54372c32845d2bc340951c0ea88d480efc1dd6a 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
@@ -262,6 +262,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
@@ -111,10 +112,10 @@ index 6f6228edfe77668552a40a814ab3cebd74c4cb5a..22f26761965d3c03b109939585ff528d
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
index e8de78f8b7c90a719e10c483991f45a7886256be..0ff64fc50768a4bed9c871fed1089753912b89d2 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 {
@@ -1493,6 +1493,7 @@ public abstract class PlayerList {
}
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
@@ -123,14 +124,13 @@ index 58cc1bed851994fb591e9b832b98d25eda153b47..4fbe96813067d3ccf1d8f29151ac3fac
}
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
index f3cf7634a5fd470e7fb295ae1f88e14f0c4a0d1d..5dafbe4ca74071e25ce79128ca08c7bfebb778d5 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;
@@ -56,4 +56,22 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+
+ public NoChatReports noChatReports;
+ public class NoChatReports extends ConfigurationPart {
+
@@ -148,4 +148,5 @@ index 5a62bffe495002b3bbf5fd995df135c5d174458a..989aa0aeb05a878945849adc6fb66630
+ }
+
+ }
+
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Ignore useless entity packets
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index c6d80accdac49564b5386717a92dbd5a10237f06..ddbff17499746cd370fdf18ff78606b0ac770df4 100644
index c6ef510d335b8baea58c4491853414a52a06b66b..e2dcdc9f317a4ab1a9b30e482607dc041abb7035 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -200,6 +200,8 @@ public class ServerEntity {
@@ -13,7 +13,7 @@ index c6d80accdac49564b5386717a92dbd5a10237f06..ddbff17499746cd370fdf18ff78606b0
flag5 = true;
}
+
+ if (this.entity.level().plazmaLevelConfiguration().entity.ignoreUselessPackets && isUselessPacket(packet1)) packet1 = null; // Plazma
+ if (this.level.plazmaConfig().entity.ignoreUselessPackets && isUselessPacket(packet1)) packet1 = null; // Plazma
}
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
@@ -37,16 +37,16 @@ index c6d80accdac49564b5386717a92dbd5a10237f06..ddbff17499746cd370fdf18ff78606b0
public void removePairing(ServerPlayer player) {
this.entity.stopSeenByPlayer(player);
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index 414baade911fab3450430af9378feedc419868f3..914cc4f9a5598d2d70c7338d7cfc9be0fe5f0e31 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 036c0b12553ae203e8c73d44dc2e3d625b812af5..909a74c19501d9440f3d2435b6514d738efcfc05 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -29,6 +29,8 @@ public class WorldConfigurations extends ConfigurationPart {
public Entity entity;
public class Entity extends ConfigurationPart {
+ public boolean ignoreUselessPackets = DO_OPTIMIZE;
+ public boolean ignoreUselessPackets = OPTIMIZE;
+
public Player player;
public class Player extends ConfigurationPart {
public Phantom phantom;
public class Phantom extends ConfigurationPart {

View File

@@ -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;

View File

@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 28 Sep 2023 12:33:14 +0900
Date: Mon, 6 Nov 2023 10:39:01 +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
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..642fd0e06f9ab53b4ef2cafe1dc3321a3fd7ee9e 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 {
@@ -13,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7
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
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve biome temperature cache
return Util.make(() -> {
/*
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
@@ -22,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7
long l = blockPos.asLong();
// Pufferfish start
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve BiomeTemperatureCache
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve biome temperature cache
float f = cache.getValue(l);
if (!Float.isNaN(f)) {
return f;

View File

@@ -0,0 +1,34 @@
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 aeae6117b398b84d5c8ecaa175a72867416ff166..c9df97eebe3635009737be83a28f36d291fcce79 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -936,10 +936,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().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
if (i % 2 != 0 && this.tickCount > 1) {
//this.level().getProfiler().push("targetSelector"); // Purpur
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 909a74c19501d9440f3d2435b6514d738efcfc05..b036b54d551c892cc48d0a6816382bce5e38efd4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -30,6 +30,7 @@ public class WorldConfigurations extends ConfigurationPart {
public class Entity extends ConfigurationPart {
public boolean ignoreUselessPackets = OPTIMIZE;
+ public int sensorTick = 1;
public Phantom phantom;
public class Phantom extends ConfigurationPart {

View File

@@ -0,0 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Tue, 7 Nov 2023 15:32:24 +0900
Subject: [PATCH] Configurable cave lava sea level
This patch also fix MC-237017.
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index 58609a0911c4e32b6f80f050cd3d23f70ad75b1b..2db6c1b9530b4b082ef6f6ec17c542ba8ad7fa5f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -72,6 +72,15 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
}
private static Aquifer.FluidPicker createFluidPicker(NoiseGeneratorSettings settings) {
+ // Plazma start
+ if (true) {
+ org.plazmamc.plazma.configurations.GlobalConfiguration config = org.plazmamc.plazma.configurations.GlobalConfiguration.get();
+ return (x, y, z) -> new Aquifer.FluidStatus(
+ config.worldgen.caveLavaSeaLevel.useCustomSeaLevel ? config.worldgen.caveLavaSeaLevel.customSeaLevel : settings.seaLevel(),
+ config.worldgen.caveLavaSeaLevel.customSeaLevel(settings)
+ );
+ }
+ // Plazma end
Aquifer.FluidStatus aquifer_b = new Aquifer.FluidStatus(-54, Blocks.LAVA.defaultBlockState());
int i = settings.seaLevel();
Aquifer.FluidStatus aquifer_b1 = new Aquifer.FluidStatus(i, settings.defaultFluid());
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 5dafbe4ca74071e25ce79128ca08c7bfebb778d5..3cfb9357d0c61e84488c2c60f073fa12df942b8e 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -35,6 +35,25 @@ public class GlobalConfiguration extends ConfigurationPart {
public WorldGeneration worldgen;
public class WorldGeneration extends ConfigurationPart {
+ public CaveLavaSeaLevel caveLavaSeaLevel;
+ public class CaveLavaSeaLevel extends ConfigurationPart {
+
+ public boolean useCustomSeaLevel = false;
+ public int customSeaLevel = -54;
+ String customSeaBlock = "default";
+
+ public net.minecraft.world.level.block.state.BlockState customSeaLevel(net.minecraft.world.level.levelgen.NoiseGeneratorSettings settings) {
+ if (this.customSeaBlock.equalsIgnoreCase("default")) return settings.defaultFluid();
+ return net.minecraft.core.registries.BuiltInRegistries.BLOCK
+ .getOptional(new net.minecraft.resources.ResourceLocation(this.customSeaBlock))
+ .orElseGet(() -> {
+ PlazmaConfigurations.LOGGER.warn("Invalid custom sea level block: " + this.customSeaBlock, ", defaulting to lava");
+ return net.minecraft.world.level.block.Blocks.LAVA;
+ })
+ .defaultBlockState();
+ }
+
+ }
}

View File

@@ -1,41 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 30 Sep 2023 22:06:00 +0900
Subject: [PATCH] Suppress error from dirty attributes
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index b2770e053f6db173dedbf044d67aa315e2fd7302..30b4c6bf1a0c847d00fc466ca9c997f9049bb697 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -395,7 +395,8 @@ public class ServerEntity {
}
if (this.entity instanceof LivingEntity) {
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // Plazma - Suppress error from dirty attributes
+ final Set<AttributeInstance> set = this.entity.level().plazmaLevelConfiguration().entity.suppressErrorFromDirtyAttributes ? java.util.Collections.synchronizedSet(attributes) : attributes; // Plazma - Suppress error from dirty attributes
if (!set.isEmpty()) {
// CraftBukkit start - Send scaled max health
@@ -406,7 +407,7 @@ public class ServerEntity {
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
}
- set.clear();
+ attributes.clear(); // Plazma - Suppress error from dirty attributes
}
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index cb21da3cff4dbb08c7786c09b39e381abdf45c33..dfd408dc42a6000eb5fa56bbdb64f2329e545078 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -36,6 +36,7 @@ public class LevelConfigurations extends ConfigurationPart {
public int sensorTick = DO_OPTIMIZE ? 10 : 1;
public boolean ignoreUselessPackets = DO_OPTIMIZE;
+ public boolean suppressErrorFromDirtyAttributes = false;
public Player player;
public class Player extends ConfigurationPart {

View File

@@ -1,28 +1,28 @@
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 b036b54d551c892cc48d0a6816382bce5e38efd4..459cba838468b95547b2a515c497fcbb7bd45718 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -39,6 +39,20 @@ public class WorldConfigurations extends ConfigurationPart {
}
+ public WakeUpDurationVariance wakeUpDurationVariance;
+ public class WakeUpDurationVariance extends ConfigurationPart {
+
+ 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); }
+
+ }
+
@@ -30,47 +30,47 @@ index 82975c1c92c84294740a411b4a351efb8a2e6769..cb21da3cff4dbb08c7786c09b39e381a
public Structure structure;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 062a793a134f774ebf918aab10443527c06c4fd1..3a362fef29c6fa29c37eff539e343eb3a56bf122 100644
index 0b03dae85e6008283e68b07fa438daccf0e4f5fa..5b981300a8addb85fce32b814dfe70cb2bc4beb3 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -68,6 +68,13 @@ public class ActivationRange
@@ -68,29 +68,36 @@ public class ActivationRange
Activity.PANIC
};
+ // Plazma start - Variable entity wakeup duration
+ private static final java.util.Random WAKEUP_DURATION_RANDOM = org.plazmamc.plazma.PlazmaOptions.useJavaRandom() ? new java.util.Random() : new org.plazmamc.plazma.Random();
+ private static int getWakeupDurationWithVariance(int duration, double deviation) {
+ 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
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
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
}
} 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
}
} 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
}
} 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
}
}
return -1;

View File

@@ -1,59 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 30 Sep 2023 22:02:58 +0900
Date: Mon, 4 Dec 2023 23:12:47 +0900
Subject: [PATCH] Optimise state lookup more
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..0832e4fa92b6464a6206475fbceb3b36462757b3 100644
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..50d97c5ab33f33b81dbafd7cf42da5afd9856eeb 100644
--- a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
+++ b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
@@ -17,6 +17,7 @@ public final class ZeroCollidingReferenceStateTable {
protected final StateHolder<?, ?> this_state;
protected long[] index_table;
+ public long[] index_table() { return this.index_table; } // Plazma - getter
+ public long[] index_table() { return this.index_table; } // Plazma - Getter
protected StateHolder<?, ?>[][] value_table;
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
index 5f285d190186a2ff5a61d05070593e1d633dd79a..7b61a956892e90c7556db46d9277da8d252547cd 100644
index 5f285d190186a2ff5a61d05070593e1d633dd79a..669c42f1598e2a06bb0b95aa0bc413911346f3ff 100644
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
@@ -114,21 +114,15 @@ public abstract class StateHolder<O, S> {
@@ -114,6 +114,12 @@ public abstract class StateHolder<O, S> {
}
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
- Comparable<?> comparable = this.values.get(property);
- if (comparable != null && !comparable.equals(value)) {
- S object = this.neighbours.get(property, value);
- if (object == null) {
- throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
- } else {
- return object;
- }
- } else {
- return (S)this;
- }
+ // Plazma start - optimise state lookup more
+ // Plazma start - Optimise state lookup more
+ final S ret = (S) this.optimisedTable.get(property, value);
+ if (ret == null) throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
+ return ret;
+ /*
+ // Plazma end
Comparable<?> comparable = this.values.get(property);
if (comparable != null && !comparable.equals(value)) {
S object = this.neighbours.get(property, value);
@@ -125,10 +131,11 @@ public abstract class StateHolder<O, S> {
} else {
return (S)this;
}
+ */ // Plazma - Optimise state lookup more
}
public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
- if (this.neighbours != null) {
+ if (this.optimisedTable.index_table() != null) { // Plazma - optimise state lookup more
+ if (this.optimisedTable.index_table() != null) { // Plazma - optimise state lookup
throw new IllegalStateException();
} else {
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
@@ -143,7 +137,7 @@ public abstract class StateHolder<O, S> {
@@ -143,7 +150,7 @@ public abstract class StateHolder<O, S> {
}
}
- this.neighbours = (Table<Property<?>, Comparable<?>, S>)(table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.neighbours, this.values); // Paper - optimise state lookup
+ this.optimisedTable.loadInTable((Table) (table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Paper - optimise state lookup // Plazma - more
+ this.optimisedTable.loadInTable((Table) (table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Plazma - Optimize state lookup more
}
}

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 4 Dec 2023 23:15:43 +0900
Subject: [PATCH] Suppress errors from dirty attributes
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index e2dcdc9f317a4ab1a9b30e482607dc041abb7035..085dfb2cf8596f5f0be4b1bf9a3cbe1a0e9b2967 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -395,7 +395,8 @@ public class ServerEntity {
}
if (this.entity instanceof LivingEntity) {
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // Plazma - Suppress errors from dirty attributes
+ final Set<AttributeInstance> set = this.level.plazmaConfig().entity.suppressErrorsFromDirtyAttributes ? Collections.synchronizedSet(attributes) : attributes; // Plazma - Suppress errors from dirty attributes
if (!set.isEmpty()) {
// CraftBukkit start - Send scaled max health
@@ -406,7 +407,7 @@ public class ServerEntity {
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
}
- set.clear();
+ attributes.clear(); // Plazma - Suppress errors from dirty attributes
}
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 459cba838468b95547b2a515c497fcbb7bd45718..b1293935e55fcb1c45224e5bda9be8d1045ff4e8 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 boolean ignoreUselessPackets = OPTIMIZE;
public int sensorTick = 1;
+ public boolean suppressErrorsFromDirtyAttributes = OPTIMIZE;
public Phantom phantom;
public class Phantom extends ConfigurationPart {

View File

@@ -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;

View File

@@ -1,27 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 30 Sep 2023 22:17:02 +0900
Subject: [PATCH] Optimize Spigot event bus
Date: Mon, 4 Dec 2023 23:19:46 +0900
Subject: [PATCH] Optimize spigot event bus
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
index 6016c304ddbeb6ffbd591f30914c85fcb6371e80..482e2cdbd4f76f2a56c62bec12bfc39d7193b6ce 100644
index 23594fb7eb4b2f33146592866608c2858ef23937..94eecf374f1e6b00556a380fd28376f720d61e8e 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
@@ -41,11 +41,14 @@ public class PaperEventManager { // Plazma - package -> public
RegisteredListener[] listeners = handlers.getRegisteredListeners();
@@ -39,12 +39,19 @@ class PaperEventManager {
// Plazma start - Skip event if no listeners
RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
if (listeners.length == 0) return;
// Plazma end
- // Plazma end
- if (event.isAsynchronous() && this.server.isPrimaryThread()) {
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
+ // Plazma start - Optimize Spigot event bus
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
+ final boolean async = event.isAsynchronous();
+ final boolean primary = this.server.isPrimaryThread();
+ if (async && primary) throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
+ if (!async && !primary && !this.server.isStopping()) throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
+
+ // Optimize Spigot event bus
+ if (event.asynchronous() == net.kyori.adventure.util.TriState.NOT_SET) {
+ boolean async = event.isAsynchronous();
+ boolean primary = this.server.isPrimaryThread();
+
+ if (async && primary)
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
+
+ if (!async && !primary && !this.server.isStopping())
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
}
+ // Plazma end

View File

@@ -1,11 +1,13 @@
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
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 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7494d8477 100644
index 914564a528c360f352927e7681ab2e31ed365b21..090643e977257a097a99a3f54d1d73b995cfd82a 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 {
@@ -14,17 +16,17 @@ index 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7
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 {
// Paper start - ported from 1.20.3 Fix MC-259321
static <B, T extends B> net.minecraft.world.level.entity.EntityTypeTest<B, T> forExactClass(Class<T> clazz) {
return new net.minecraft.world.level.entity.EntityTypeTest<>() {
@@ -97,6 +99,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 (world.plazmaConfig().entity.spawnDeadlockTimer.enabled) {
+ if (!this.blockLockedByTime) {
+ if (this.blockExistsTick > org.plazmamc.plazma.configurations.GlobalConfiguration.get().gameMechanics.spawning.deadlockTimer.timerTimeout)
+ if (this.blockExistsTick > world.plazmaConfig().entity.spawnDeadlockTimer.timerTimeout)
+ blockLockedByTime = true;
+ else blockExistsTick++;
+ }
@@ -35,22 +37,20 @@ index 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7
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 {
@@ -301,6 +314,12 @@ public abstract class BaseSpawner {
if (nbt.contains("SpawnRange", 99)) {
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)) {
+ if (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 {
@@ -330,6 +349,9 @@ public abstract class BaseSpawner {
}));
}
@@ -60,32 +60,22 @@ index 64d911bee1607880514061c75116d8672df8bb8f..7868590696f620cc5f0785125c9573d7
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 {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index b1293935e55fcb1c45224e5bda9be8d1045ff4e8..e5e0b0f0bd3b2249dc1db029682b8957b0addcac 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -54,6 +54,14 @@ public class WorldConfigurations extends ConfigurationPart {
}
}
+ public GameMechanics gameMechanics;
+ public class GameMechanics extends ConfigurationPart {
+ public SpawnDeadlockTimer spawnDeadlockTimer;
+ public class SpawnDeadlockTimer 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 boolean enabled = OPTIMIZE;
+ public int timerTimeout = 0;
+
+ }
+
+ }
+
public Player player;
public class Player extends ConfigurationPart {
}
public Structure structure;

File diff suppressed because it is too large Load Diff

View 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 1bcb5a58b945cdb3dc94efb314d7ba41fbb38e07..34beb1b0af10877b3388e6f44913253eb51e7a51 100644
--- a/src/main/java/net/minecraft/util/random/WeightedRandomList.java
+++ b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
@@ -8,10 +8,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);
}

View 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 7fdb4d5eb1ab6c45c88ca18112d5b1b26bfd5947..57b1f741609193eced5e5ab1d45f18bea005eeb7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2602,6 +2602,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {
+ if (!this.swinging && this.swingTime == 0) return; // Plazma - de-sisyphus :skull:
int i = this.getCurrentSwingDuration();
if (this.swinging) {

View File

@@ -0,0 +1,116 @@
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 935dac757280731bfeb0a8f033cbe315ecac46da..038f370ac2cb768e14fe7605b32b2ac811c33b8f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
@@ -60,20 +60,20 @@ public class DedicatedPlayerList extends PlayerList {
}
private void saveIpBanList() {
- try {
+ //try { // Plazma - Build fix
this.getIpBans().save();
- } catch (IOException var2) {
+ /*} catch (IOException var2) { // Plazma - Build fix
LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
- }
+ }*/ // Plazma - Build fix
}
private void saveUserBanList() {
- try {
+ //try { // Plazma - Build fix
this.getBans().save();
- } catch (IOException var2) {
+ /*} catch (IOException var2) { // Plazma - Build fix
LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
- }
+ }*/ // Plazma - Build fix
}
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 34b7c5421da93f14050425b0fc16bbc27e5f3eba..a35340b9231bc3009ca9449fa6ea8f8ae6929146 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -61,11 +61,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void add(V entry) {
this.map.put(this.getKeyForUser(entry.getUser()), entry);
- try {
+ //try { // Plazma - Fix build
this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Fix build
StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
- }
+ }*/ // Plazma - Fix build
}
@@ -83,11 +83,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void remove(K key) {
this.map.remove(this.getKeyForUser(key));
- try {
+ //try { // Plazma - Fix build
this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Fix build
StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
- }
+ }*/ // Plazma - Fix build
}
@@ -142,7 +142,10 @@ 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
@@ -154,27 +157,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, 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
public void load() throws IOException {
if (this.file.exists()) {

File diff suppressed because it is too large Load Diff

View File

@@ -1,87 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Thu, 4 May 2023 16:54:53 +0900
Subject: [PATCH] Optimize VarInts
https://github.com/PaperMC/Paper/pull/8418
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index c0bd2997fe3ebbfe926de832a36d209cc875f3e2..8bb552410207b39a3b4160a5df51410455107fcf 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -99,12 +99,26 @@ public class FriendlyByteBuf extends ByteBuf {
private static final Gson GSON = new Gson();
public static boolean hasItemSerializeEvent = false; // Purpur
+ public static boolean optimizeVarInts = false; // Plazma
public FriendlyByteBuf(ByteBuf parent) {
this.source = parent;
}
+ // Plazma start - Optimize VarInts
+ private static final int[] VARINT_EXACT_BYTE_LENGTHS = new int[33];
+ static {
+ for (int i = 0; i <= 32; ++i) {
+ VARINT_EXACT_BYTE_LENGTHS[i] = (int) Math.ceil((31d - (i - 1)) / 7d);
+ }
+ VARINT_EXACT_BYTE_LENGTHS[32] = 1; // Special case for the number 0.
+ }
+ // Plazma end
public static int getVarIntSize(int value) {
+ // Plazma start - Optimize VarInts
+ if (optimizeVarInts)
+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)];
+ // Plazma end
for (int j = 1; j < 5; ++j) {
if ((value & -1 << j * 7) == 0) {
return j;
@@ -620,6 +634,25 @@ public class FriendlyByteBuf extends ByteBuf {
}
public FriendlyByteBuf writeVarInt(int value) {
+ // Plazma start - Optimize VarInts
+ if (optimizeVarInts) {
+ // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
+ // that the proxy will write, to improve inlining.
+ if ((value & (0xFFFFFFFF << 7)) == 0) {
+ writeByte(value);
+ } else if ((value & (0xFFFFFFFF << 14)) == 0) {
+ int w = (value & 0x7F | 0x80) << 8 | (value >>> 7);
+ writeShort(w);
+ } else {
+ while ((value & -128) != 0) {
+ this.writeByte(value & 127 | 128);
+ value >>>= 7;
+ }
+ this.writeByte(value);
+ }
+ return this;
+ }
+ // Plazma end
while ((value & -128) != 0) {
this.writeByte(value & 127 | 128);
value >>>= 7;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0..525fe30b6abba295709fca3d10f9b24679112571 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -38,11 +38,17 @@ public class GlobalConfiguration extends ConfigurationPart {
}
public Misc misc;
- public class Misc extends ConfigurationPart {
+ public class Misc extends ConfigurationPart.Post {
public boolean reduceCreateRandomInstance = DO_OPTIMIZE;
public boolean doNotTriggerLootTableRefreshForNonPlayerInteraction = DO_OPTIMIZE;
public boolean doNotSendUselessEntityPackets = DO_OPTIMIZE;
+ public boolean optimizeVarInts = DO_OPTIMIZE;
+
+ @Override
+ public void postProcess() {
+ net.minecraft.network.FriendlyByteBuf.optimizeVarInts = optimizeVarInts;
+ }
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,21 @@ pluginManagement {
}
}
dependencyResolutionManagement {
versionCatalogs {
create("libs") {}
create("api") {
from(files("libs/api.versions.toml"))
}
create("server") {
from(files("libs/server.versions.toml"))
}
create("common") {
from(files("libs/common.versions.toml"))
}
}
}
rootProject.name = "plazma"
for (name in listOf("Plazma-API", "Plazma-Server")) {
val projName = name.lowercase(Locale.ENGLISH)