Compare commits

...

100 Commits

Author SHA1 Message Date
MrHua269
8d6d9119a8 Buffered linear region format 1.0 2025-06-13 17:50:42 +08:00
Bacteriawa
40a455c92f Updated Upstream (Folia) 2025-06-13 02:32:12 +08:00
Bacteriawa
23b9e44ff3 Merge branch 'dev/1.21.4-hardfork' of https://github.com/LuminolMC/Luminol into dev/1.21.4-hardfork 2025-06-13 02:29:33 +08:00
Bacteriawa
da25676332 Remove faster chunk serialization 2025-05-27 19:45:24 +08:00
Bacteriawa
3d60c6c0fc Remove faster chunk serialization 2025-05-26 23:49:10 +08:00
Bacteriawa
9a6720e5f1 Merge branch 'dev/1.21.4-hardfork' of https://github.com/LuminolMC/Luminol into dev/1.21.4-hardfork 2025-05-23 23:00:16 +08:00
Helvetica Volubi
1d88056195 refactor: resort patches 2025-05-21 18:22:39 +08:00
Helvetica Volubi
3a7d1bd81d feat: Disable end crystal check (#102) 2025-05-21 13:05:30 +08:00
Helvetica Volubi
e84a8a5c18 [ci skip]refactor: rename some Class name 2025-05-21 12:20:17 +08:00
Bacteriawa
92928ee93d Updated Upstream (Folia) 2025-05-21 12:20:17 +08:00
Bacteriawa
61c3cc8c74 Updated Upstream (Folia) 2025-05-20 16:31:49 +08:00
Bacteriawa
8e697a3dd6 Updated Upstream (Folia) 2025-05-20 14:13:16 +08:00
Helvetica Volubi
c46c70db18 [ci skip]refactor: add some license and resort patches 2025-05-19 23:46:05 +08:00
Helvetica Volubi
4692867da8 [ci skip]refactor: resort patches 2025-05-19 20:27:46 +08:00
Helvetica Volubi
aacb2cd631 feat: add multi transfer class support 2025-05-18 13:33:01 +08:00
Helvetica Volubi
897ee50d29 feat: add redirect to Removed Config 2025-05-18 13:10:44 +08:00
xiaoxijun
72f49cfafe Update LICENSE (#99) 2025-05-18 10:55:55 +08:00
MrHua269
5b6d1ee061 Tidy patches & rename RemovedConfig to TransferringConfig 2025-05-18 08:38:45 +08:00
M2ke4U
1eba4e1a05 Merge pull request #101 from Suisuroru/ss/RemovedConfig
add RemovedConfig interface for Config-update
2025-05-18 08:15:09 +08:00
Helvetica Volubi
741b00c9be fix: fix an error in platform generate 2025-05-18 05:10:26 +08:00
Helvetica Volubi
3e73f9f9cb feat: new tripwire behavior modifier 2025-05-18 04:42:35 +08:00
Helvetica Volubi
b1e3a300a2 feat: RemovedConfig config tag 2025-05-18 03:20:35 +08:00
Helvetica Volubi
c12bf7b06c fix: fix a bug in patch [prevent tripwire dupe in end platform generate] 2025-05-17 20:56:45 +08:00
MrHua269
8673e02ca3 Fix rebranding 2025-05-17 15:55:53 +08:00
MrHua269
dc973293d6 Added some license information into patches 2025-05-17 15:55:53 +08:00
MrHua269
e2b129df71 Add getId to TickRegion api class 2025-05-17 15:55:53 +08:00
MrHua269
533a41b5c9 Make tickregion object bind with nms object 2025-05-17 15:55:53 +08:00
Helvetica Volubi
511b4fafd4 feat: add Config to fix string dupe in end platform (#62) 2025-05-17 15:55:53 +08:00
MrHua269
d5dfcfa253 Retidy patches 2025-05-17 15:55:53 +08:00
Helvetica Volubi
df72ac7a55 [ci skip]docs: update Contributing files 2025-05-17 15:55:53 +08:00
Helvetica Volubi
21440dbbce refactor: organize patches 2025-05-17 15:55:53 +08:00
Bacteriawa
a99b5fd8c6 Faster chunk serialization 2025-05-17 15:55:53 +08:00
Helvetica Volubi
649473678e refactor: organize patches 2025-05-17 15:55:53 +08:00
Helvetica Volubi
e79afe47dd fix: creative item fix
it fix Leaves#489[https://github.com/LeavesMC/Leaves/issues/489]
2025-05-17 15:55:53 +08:00
xiaoxijun
05795e53d7 neaten ci 2025-05-17 15:55:53 +08:00
Bacteriawa
730bc2ea62 Fix maven repo 2025-05-17 15:55:53 +08:00
Helvetica Volubi
8d4d923310 refactor: fix an error in speed-fix 2025-05-17 15:55:53 +08:00
Helvetica Volubi
9b42664025 refactor: use skip tick and compensate tick to fix some bugs 2025-05-17 15:55:53 +08:00
Helvetica Volubi
3d5fe06a3c [ci skip]note: fix up one note error 2025-05-17 15:55:53 +08:00
MrHua269
982e82de9e Tidy patches 2025-05-17 15:55:53 +08:00
Helvetica Volubi
53e4333bfc fix: rebuild Entity portal-teleport speed fix 2025-05-17 15:55:53 +08:00
Helvetica Volubi
e042d98762 ci: always use ncipollo/release-action@v1-latest to release 2025-05-17 15:55:53 +08:00
MrHua269
521c2b9cbd Run generateDevelopmentBundle 2025-05-17 15:55:53 +08:00
MrHua269
978e8a10ca Fix syntax error 2025-05-17 15:55:53 +08:00
MrHua269
7b2885fd8d Fix npe while running tasks without private mvn repo variables 2025-05-17 15:55:53 +08:00
MrHua269
3e0571fc52 Added private maven repo for some testing 2025-05-17 15:55:53 +08:00
MrHua269
9713a09905 Fix incorrectly synced data after player teleportation
Fixes:https://github.com/PaperMC/Folia/issues/357
2025-05-17 15:55:53 +08:00
Helvetica Volubi
9d2d3aff72 Add config to enable tick command (#94)
* feat: tick command support

* feat: use exp-config to enable tick command
2025-05-17 15:55:53 +08:00
MrHua269
80e438bf96 Tidy patches 2025-05-17 15:55:52 +08:00
Helvetica Volubi
45ce5b56bd MC-274911 Full revert & Cross Region Damage trace (#92)
* fix: Cross Region Damage trace

* fix: fix patch - revert raid

* refactor: pull code to rebuild patch

* note: rewrite raid-revert note

* feat: revert spawn position logic

[revert spawn position logic] reverted MC-274911, so old [MC-274911 revert] is removed, and config extended old revert_274911

* refactor: simplify code

* refactor: rewritten in thread-safe way

* fix: fix error print out

* refactor: rebuild patch

* refactor: remove import & fixup LOGGER print out

* refactor: move rebuild effect affect to Cross Region

* feat: use config to set if [Cross Region Damage Trace] is enabled
2025-05-17 15:55:52 +08:00
MrHua269
cf129162ef Tidy patches 2025-05-17 15:55:52 +08:00
Helvetica Volubi
a3b9c347f7 refactor: better log print 2025-05-17 15:55:52 +08:00
Helvetica Volubi
f9d700eca4 feat: origin print complete 2025-05-17 15:55:52 +08:00
Helvetica Volubi
760da7d7be bugfix: fix crash when execute setblock with an illegal nbt 2025-05-17 15:55:52 +08:00
MrHua269
af796c4b03 Tidy patches 2025-05-17 15:55:52 +08:00
Helvetica Volubi
1c27c1ce38 EndGateway Portal Passengers Fix (#90)
* feat: EndGateway Portal Passengers Fix

* refactor: delete some debug information

* refactor: merge patches to [Portal behavior modifiers]

* refactor: rebuild patch
2025-05-17 15:55:52 +08:00
MrHua269
7f297a4d20 Fix off tickregion sync teleport & tidy patches
Fixes: https://github.com/PaperMC/Folia/issues/329
2025-05-17 15:55:52 +08:00
Helvetica Volubi
923233be6f patch: fixup a patch's name 2025-05-17 15:55:52 +08:00
Helvetica Volubi
5d90f68192 note: fixup note 2025-05-17 15:55:52 +08:00
Helvetica Volubi
f835ecf227 feat: add flag to process async failed 2025-05-17 15:55:52 +08:00
Helvetica Volubi
9cb931e691 fix: Entity portal-teleport speed fix 2025-05-17 15:55:52 +08:00
Helvetica Volubi
e7b3a713b1 fixup note 2025-05-17 15:55:52 +08:00
Helvetica Volubi
ae32e89dbb ci: update build_1.21.4.yml
fix an error in a file name
2025-05-17 15:55:52 +08:00
Helvetica Volubi
5af12cd66f feat: add afterPortalLogic to process some logics 2025-05-17 15:55:52 +08:00
Helvetica Volubi
8611086dfc fix: TNT Nether Portal break portal fix 2025-05-17 15:55:52 +08:00
Helvetica Volubi
da39a79d17 remove: move 0044 to todo list 2025-05-17 15:55:52 +08:00
Helvetica Volubi
acd1ce5ded Leaves Fix SculkCatalyst exp skip (Leaves#471) 2025-05-17 15:55:52 +08:00
Helvetica Volubi
efb26e7554 note: use Correct player respawn place as tag 2025-05-17 15:55:52 +08:00
Helvetica Volubi
519f46ab01 fix: Player respawn in correct place 2025-05-17 15:55:52 +08:00
Bacteriawa
1f86bd0656 Add Lithium: fast util & Lithium: Skip unnecessary calculations if player is not flying or swing 2025-05-17 15:55:52 +08:00
Helvetica Volubi
97c2703fb4 remove: remove 0024 2025-05-17 15:55:52 +08:00
Helvetica Volubi
bbb0933042 Prefer Leaves#455 to luminol (#77)
* feat: prefer Leaves#452 to luminol

* feat: rename Files

* rename: fixup a file name
2025-05-17 15:55:52 +08:00
Bacteriawa
177bb8eed2 Updated Upstream (Folia) 2025-05-17 15:55:52 +08:00
Helvetica Volubi
cce7e23ae1 feat: rewrite MC-274911 revert (tick-mode) 2025-05-17 15:55:52 +08:00
Helvetica Volubi
ac008463d3 feat: try revert MC-274911 2025-05-17 15:55:52 +08:00
Helvetica Volubi
0b48acc022 tip: add a tip in new feat 2025-05-17 15:55:52 +08:00
Helvetica Volubi
fa59901792 feat: disable raid self check config
--Function from leaves
2025-05-17 15:55:52 +08:00
Helvetica Volubi
ec7f6d1e23 description: fix up description 2025-05-17 15:55:52 +08:00
Helvetica Volubi
db56fca556 feat: prefer #75 to hardfork-ver 2025-05-17 15:55:52 +08:00
MrHua269
0a1e7a509f Fully removed player teleport event and entity teleport event call & Rebase patches 2025-05-17 15:55:51 +08:00
MrHua269
6e7d7f9aad Add: Leaf Smart sort entities in NearestLivingEntitySensor 2025-05-17 15:55:51 +08:00
Helvetica Volubi
ef810b9f95 fix: fix up number 2025-05-17 15:55:51 +08:00
Helvetica Volubi
7c1818ed78 del: delete patch 0022(MrHua269) 2025-05-17 15:55:51 +08:00
Helvetica Volubi
692d40a89c feat: selected raid update 2025-05-17 15:55:51 +08:00
Bacteriawa
c0d4f434ce Updated Upstream (Folia) 2025-05-17 15:55:51 +08:00
ShintoKosei
c4d87f3d90 [ci skip] Enable dependabot 2025-05-17 15:55:51 +08:00
Dreeam
54fbeb2e5e [ci skip] Only release paperclip jar 2025-05-17 15:55:51 +08:00
MrHua269
a81e970785 Revert RegionizedTaskQueue referent counter changes 2025-05-17 15:55:51 +08:00
Kercute
1a8c988db1 Add force the data command to be enabled config 2025-05-17 15:55:51 +08:00
Creeam
6673fb02fd [ci skip] Update CONTRIBUTING_EN.md 2025-05-17 15:55:51 +08:00
Creeam
7bfb5ac414 [ci skip] Update EN contributing guide 2025-05-17 15:55:51 +08:00
Helvetica Volubi
b4acb43e85 [ci skip] Update CONTRIBUTING guide (#57)
* misc: fixup count of patch

* ci: update ncipollo/release-action to 1.16.0

* docs: update CONTRIBUTING.md

* docs: update CONTRIBUTING files

* docs: update CONTRIBUTING files

* Update CONTRIBUTING.md

* docs: sync zh_cn's update to en

* docs: correct grammar errors

* docs: fixup jdk version to 21

---------

Co-authored-by: xiaoxijun <A3167717663@hotmail.com>
2025-05-17 15:55:51 +08:00
Suisuroru
65516ac3c3 feat(config): optimize configuration description of raid config 2025-05-17 15:55:51 +08:00
Suisuroru
12b5752c2d feat: Merge Revert-raid-changes of Leaves to Luminol 2025-05-17 15:55:51 +08:00
HaHaWTH
cbf59b889c Updated Upstream (Folia) 2025-05-17 15:55:51 +08:00
MrHua269
58e9f3fd5f Do not search the block out of current region & Ported some micro optimizations from Leaf
Probably fixes(Do not search the block out of current region): https://github.com/PaperMC/Folia/issues/343
2025-05-17 15:55:50 +08:00
Kercute
d0d4292649 0019-Skip-collision-check-if-the-block-is-not-belong-to-c.patch 2025-05-17 15:55:29 +08:00
Kercute
3d6cc305cd Updated Upstream (Folia) 2025-05-17 15:55:29 +08:00
MrHua269
e5005425f7 [ci skip] Use --global flag to configure git 2025-05-17 15:55:29 +08:00
MrHua269
35cd2efa8e Add experiment config for entity to clean memory value which is not belong to current tickregion & Fix a series issue around entity memory typed GlobalPos
Probably fixes: https://github.com/PaperMC/Folia/issues/203
2025-05-17 15:55:28 +08:00
115 changed files with 3963 additions and 458 deletions

12
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Enable version updates for github actions
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@@ -15,39 +15,50 @@ jobs:
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '22'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Configure Git User Details
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
- name: Apply Patches
run: ./gradlew applyAllPatches
- name: CreateJar
run: ./gradlew createMojmapPaperclipJar
- name: Publish to repo
if: github.event_name != 'pull_request'
continue-on-error: true
run: |
export MAVEN_REPO_USER=${{ secrets.MAVEN_REPO_USER }}
export MAVEN_REPO_PASSWORD=${{ secrets.MAVEN_REPO_PASSWORD }}
./gradlew publish -PpublishDevBundle=true
./gradlew generateDevelopmentBundle publish -PpublishDevBundle=true
env:
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
- name: Upload Artifact
uses: "actions/upload-artifact@v4"
uses: actions/upload-artifact@v4
with:
name: "${{ env.project_id_b }} CI Artifacts"
path: "luminol-server/build/libs/*.jar"
path: "luminol-server/build/libs/*-paperclip-*-mojmap.jar"
- name: SetENV
if: github.event_name != 'pull_request'
run: sh scripts/SetENV.sh
- name: Create Release
if: github.event_name != 'pull_request'
uses: ncipollo/release-action@v1.14.0
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}
@@ -58,7 +69,6 @@ jobs:
${{ env.commit_msg }}
artifacts: |
${{ env.jar_dir }}
${{ env.jar_dir_bundler }}
generateReleaseNotes: true
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}

4
Jenkinsfile vendored
View File

@@ -5,8 +5,8 @@ pipeline {
stage('Configure git') {
steps {
script {
sh 'git config user.name "luminolmc"'
sh 'git config user.email "luminolmc@noreply.github.com"'
sh 'git config --global user.name "luminolmc"'
sh 'git config --global user.email "luminolmc@noreply.github.com"'
}
}
}

21
LICENSE
View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2025 LuminolMC
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.

31
LICENSE.md Normal file
View File

@@ -0,0 +1,31 @@
Luminol inherits its licensing from the included upstream projects.
Luminol从上游继承了许可证。
As such, Luminol is licensed under the
[GNU General Public License version 3](licenses/GPL.md); as it inherits it from Folia,
who in turn inherits it from the original Paper, Spigot, Bukkit and CraftBukkit projects.
因此Luminol中应当遵守[GNU通用公共许可证-第3版](licenses/GPL.md) 的许可;
因为Luminol从上游Folia继承了它而Folia又从其上游的Paper、Spigot、Bukkit和Craftbukkit项目中继承了它。
Any author who is _not_ listed below should be presumed to have released their work
under the original [GPL](licenses/GPL.md) license.
任何 _未在下面列出_ 的作者都应该被认为他们的修改基于[原始GPL许可证](licenses/GPL.md)。
In the interest of promoting a better Minecraft platform for everyone, contributors
may choose to release their code under the more permissive [MIT License](licenses/MIT.md).
为了向所有人推广一个更好的Minecraft平台贡献者可以选择在更宽松的[MIT许可证](licenses/MIT.md)下发布他们的代码。
The authors listed below have chosen to release their code under that more permissive
[MIT License](licenses/MIT.md). Any contributor who wants their name added below
should submit a pull request to this project to add their name.
下面列出的作者选择在更宽松的[MIT许可证](licenses/MIT.md)下发布他们的代码。
任何希望使用[MIT许可证](licenses/MIT.md)发布的作者都应该向此项目提交一个拉取请求以在下方添加他们的名字。
```text
Helvetica Volubi <suisuroru@blue-millennium.fun>
```

View File

@@ -3,7 +3,7 @@
# Luminol
<h4>Luminol 是一个基于Folia的分支具有许多有用的优化、可配置的原版特性和更多的API支持它专为生存和无政府服务器设计</h4>
[![MIT License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE)
[![License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Luminol?style=flat-square)](https://github.com/LuminolMC/Luminol/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Luminol?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Luminol?style=flat-square)
@@ -33,7 +33,7 @@
```kotlin
repositories {
maven {
url = "https://maven.moliatopia.icu/repository/maven-snapshots/"
url = "https://repo.menthamc.com/repository/maven-public/"
}
}
@@ -47,8 +47,8 @@ dependencies {
```xml
<repositories>
<repository>
<id>moliatopia</id>
<url>https://maven.moliatopia.icu/repository/maven-snapshots/</url>
<id>menthamc</id>
<url>https://repo.menthamc.com/repository/maven-public/</url>
</repository>
</repositories>
@@ -71,7 +71,7 @@ dependencies {
当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。
## 贡献代码
[查看 Contributing](./docs/CONTRIBUTING.md)
可查看 [Contributing](./docs/CONTRIBUTING.md)
## BStats
![bStats](https://bstats.org/signatures/server-implementation/Luminol.svg "bStats")

View File

@@ -3,7 +3,7 @@
# Luminol
<h4>Luminol is a Folia fork with many useful optimizations, configurable vanilla features, and more API supports, and it was designed for survival and anarchy servers</h4>
[![MIT License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE)
[![License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Luminol?style=flat-square)](https://github.com/LuminolMC/Luminol/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Luminol?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Luminol?style=flat-square)
@@ -34,7 +34,7 @@ For gradle:
```kotlin
repositories {
maven {
url = "https://maven.moliatopia.icu/repository/maven-snapshots/"
url = "https://repo.menthamc.com/repository/maven-public/"
}
}
@@ -48,8 +48,8 @@ For maven
```xml
<repositories>
<repository>
<id>moliatopia</id>
<url>https://maven.moliatopia.icu/repository/maven-snapshots/</url>
<id>menthamc</id>
<url>https://repo.menthamc.com/repository/maven-public/</url>
</repository>
</repositories>

View File

@@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java // TODO java launcher tasks
id("io.papermc.paperweight.patcher") version "2.0.0-SNAPSHOT"
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
}
paperweight {
@@ -81,12 +81,22 @@ subprojects {
extensions.configure<PublishingExtension> {
repositories {
/*
maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "paperSnapshots"
credentials(PasswordCredentials::class)
}
*/
maven("https://repo.menthamc.com/repository/maven-snapshots/") {
name = "MenthaMC"
credentials(PasswordCredentials::class) {
username = System.getenv("PRIVATE_MAVEN_REPO_USERNAME")
password = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD")
}
}
}
}
tasks.withType<Javadoc> {
options {
(this as StandardJavadocDocletOptions).apply {
addStringOption("-add-modules", "jdk.incubator.vector")
addStringOption("Xdoclint:none", "-quiet")
}
}
}
}

View File

@@ -21,23 +21,36 @@
在开始开发之前,您首先需要拥有以下软件作为开发环境:
- `git`
- `JDK 17 或更高版本`
- `JDK 21 或更高版本`
## 了解补丁Patches
Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的修改分成了两个目录:
- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit` 进行的修改。
- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` 进行的修改。
- `luminol-server` - 对 Minecraft 标准服务器原有逻辑进行的修改。
补丁系统是基于 git 的,你可以在这里了解 git 的基本内容: <https://git-scm.com/docs/gittutorial>
如果你已经 Fork 了主储存库,那么下面你应该这么做:
1. 将你的仓库 clone 到本地;
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyPatches`
3. 进入 `luminol-api` 文件夹进行修改。
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`
3. 在执行操作后,仓库根目录下应该存在以下目录对: `luminol-api``luminol-server` `folia-api``folia-server` 以及 `paper-api``paper-server`(下文称作 `*-api``*-server`
4. 进入 仓库根目录下的 `*-api``*-server` 文件夹进行修改。
顺便一提,`luminol-api` 并不是正常的 git 仓库
以下为对上述各个文件夹的简单描述,详细描述可以参考[这里](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md)
1. API部分
- `luminol-api` :暂无有效文件
- `folia-api` 对folia-API的修改应当在此文件夹下进行
- `paper-api` 对paper-API/spigot-API/bukkit-API的修改应该在此文件夹下进行
2. Server部分
- `luminol-server` 对Minecraft原版服务器的修改应当在此文件夹下进行
- `folia-server` :暂无有效文件
- `paper-server` :对于非原版的对服务器逻辑的修改应当在此文件夹下进行
顺便一提,仓库根目录下的 `*-api``*-server` 并不是正常的 git 仓库:
- 在应用补丁前,基点将会指向未被更改的源码
- 在基点后的每一个提交都是一个补丁
@@ -47,11 +60,12 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的
按照以下步骤增加一个补丁是非常简单的:
1.`luminol-api` 进行修改;
2. 使用 git 添加你的修改,比如 `git add .`
1.`*-api``*-server` 进行修改;
2. 使用 git 添加你的修改,比如 `git add .`(不要提交新建的文件的修改)
3. 使用 `git commit -m <提交信息>` 进行提交;
4. 运行 Gradle 任务 `rebuildPatches` 将你的提交转化为一个补丁
5. 将你生成的补丁文件进行推送。
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 生成新建文件的补丁文件(注意不要提交)
5. 运行 Gradle 任务 `rebuildAllServerPatches` 将你的提交转化为一个补丁;
6. 将你生成的补丁文件进行推送。
这样做以后,你就可以将你的补丁文件进行 PR 提交。
@@ -60,8 +74,9 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的
你可以使用以下方法来修改一个补丁的内容:
1. 在 HEAD 上直接进行修改;
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;不要提交对在luminol新建文件的修改
- 如果你想要更改提交信息,你也可以用 `--squash` 来代替 `--fixup`
3. 使用 `git rebase -i --autosquash base` 来进行自动变基,你只需要输入 `:q` 来关闭确认页面即可;
4. 运行 Gradle 任务 `rebuildPatches` 来修改已被修改的补丁
5. 将修改后的补丁 PR 发回储存库。
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在luminol新建文件的补丁注意不要提交
5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
6. 将修改后的补丁 PR 发回储存库。

View File

@@ -10,61 +10,77 @@ And if you can follow the rules below, we can complete the review faster.
## Please fork using your personal account
We regularly merge existing PRs.
If there're some small problems, we'll help you solve them by editing your PR.
If there are some small problems, we'll help you solve them by editing your PR.
But, if your PR is from a organization, we can NOT edit your PR, so we must merge your PR manually.
But, if your PR is from an organization, we can NOT edit your PR, so we must merge your PR manually.
So, don't use orgnization accounts for fork!
So, don't use organization accounts for fork!
See also [This issue](https://github.com/isaacs/github/issues/1681), and then you'll know why we can't edit PRs from organizations.
## Development Environment
Before coding, you need these softwares / tools as Dev Environment.
Before coding, you need these pieces of software / tools as Dev Environment.
- `git`
- `JDK 17 or higher`
- `JDK 21 or higher`
## Understanding "Patches"
Luminol uses as the same patching system as Paper,
and has been divided into two directories for the purpose of modifying different parts of it:
- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit`.
- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API`.
- `luminol-server` - Modifications to Minecraft Vanilla Server's source logic.
The patching system is based on git, and you can learn about it at here: <https://git-scm.com/docs/gittutorial>
If you have forked the main repository, then you should follow the steps below:
1. Clone your repository to local
2. Run Gradle's `applyPatches` task in your IDE or terminal (You can run `./gradlew applyPatches` directly in terminal.)
3. Enter `luminol-api` directory to carry out modifications.
2. Run Gradle's `applyAllPatches` task in your IDE or terminal (You can run `./gradlew applyAllPatches` directly in terminal.)
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `luminol-api` and `luminol-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
4. Enter `*-api` and `*-server` directory to carry out modifications.
BTW, `luminol-api` and are not normal git repositories.
The following is the simple description of the aforementioned folders, detailed description can be referred to [here](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
1. API part
- `luminol-api` : There is no valid file
- `folia-api` : Modifications to Folia API should be carried out in this folder
- `paper-api` : Modifications to Paper API/Spigot API/Bukkit API should be carried out in this folder
2. Server part
- `luminol-server` : Modifications to Minecraft Vanilla Server's source logic should be carried out in this folder
- `folia-server` : There is no valid file
- `paper-server` : Modifications to non-vanilla server logic should be carried out in this folder
BTW, `*-api` and `*-server` and are not normal git repositories.
- Before applying patches, the base will point to unmodified source code.
- Every commit after the base is a patch.
- Only commits after the last commit of Paper will be considered Luminol' patches.
- Only commits after the last commit of Paper will be considered as Luminol patches.
## Adding new patches
It's very easy to to add patches by following the steps below:
It's very easy to add patches by following the steps below:
1. Modify the code of `luminol-api`
1. Modify the code of `*-api` and `*-server`
2. Add these changes to the local git repository (For example, `git add .`)
3. Commit these changes using `git commit -m <Commit Message>`
4. Run Gradle's task `rebuildPatches` to convert your commits to a new patch
5. Push your patches to your repository
3. Commit these changes using `git commit -m <Commit Message>` (PS: do not commit new-created files)
4. Run Gradle's task `fixupPaperApiFilePatches` to generate newly created files to new patches (PS: do not commit again before you run this task)
5. Run Gradle's task `rebuildAllServerPatches` to convert your commits to a new patch
6. Push your patches to your repository
After pushing, you can open a PR to submit your patches.
## Modifying patches
You can modify a existing patch by following the steps below:
You can modify an existing patch by following the steps below:
1. Modify code at HEAD
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit
- If you want to edit the commit message, replace `--fixup` with `--squash`.
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit (PS: do not commit changes of luminol-created files)
- If you want to edit the commit message, replace `--fixup` with `--squash`
3. Run `git rebase -i --autosquash base` to rebase automatically, then just type `:q` to close the confirm page
4. Run Gradle's task `rebuildPatches` to modify existing patches
5. Push and PR again
4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate luminol-created files to patches (PS: do not commit again before you run this task)
5. Run Gradle's task `rebuildAllServerPatches` to modify existing patches
6. Push and PR again

View File

@@ -2,7 +2,7 @@ group = me.earthme.luminol
version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4
foliaRef=6265eb60e755171f5c35accf9bad6b7955eb9c7c
foliaRef=b785bccd6fd270b4897a165772124eef55d58c6c
org.gradle.configuration-cache=true
org.gradle.caching=true

675
licenses/GPL.md Normal file
View File

@@ -0,0 +1,675 @@
### GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
### Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom
to share and change all versions of a program--to make sure it remains
free software for all its users. We, the Free Software Foundation, use
the GNU General Public License for most of our software; it applies
also to any other work released this way by its authors. You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so. This is fundamentally incompatible with the
aim of protecting users' freedom to change the software. The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish
to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS
#### 0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays "Appropriate Legal Notices" to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
#### 1. Source Code.
The "source code" for a work means the preferred form of the work for
making modifications to it. "Object code" means any non-source form of
a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
#### 2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
#### 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
- a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
- b) The work must carry prominent notices stating that it is
released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4
to "keep intact all notices".
- c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
#### 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
- a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
#### 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU General Public
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that numbered version or
of any later version published by the Free Software Foundation. If the
Program does not specify a version number of the GNU General Public
License, you may choose any version ever published by the Free
Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy's public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
#### 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
#### 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#### 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper
mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands \`show w' and \`show c' should show the
appropriate parts of the General Public License. Of course, your
program's commands might be different; for a GUI interface, you would
use an "about box".
You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow
the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the
GNU Lesser General Public License instead of this License. But first,
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

23
licenses/MIT.md Normal file
View File

@@ -0,0 +1,23 @@
The MIT License (MIT)
=====================
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.

View File

@@ -5,15 +5,19 @@ Subject: [PATCH] Rebrand to Luminol
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index 652ff54e7c50412503725d628bfe72ed03059790..ee163b9fa8f441aa4b3e2309f33e8f932dfc02d7 100644
index 652ff54e7c50412503725d628bfe72ed03059790..db5e2f10278c20286779362cfdfadb2f42c724e0 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -19,6 +19,13 @@ public interface ServerBuildInfo {
@@ -19,6 +19,17 @@ public interface ServerBuildInfo {
*/
Key BRAND_PAPER_ID = Key.key("papermc", "paper");
+ // Luminol start
+ /**
+ * The brand id for folia
+ */
+ Key BRAND_FOLIA_ID = Key.key("papermc", "folia");
+ /**
+ * The brand id for Luminol.
+ */
+ Key BRAND_LUMINOL_ID = Key.key("luminolmc", "luminol");

View File

@@ -16,13 +16,13 @@ index d434277342b2db19f98e032d3a316b27d728b840..e188353ad193f6203533790ae52fafc0
+ long getChunkHotAvg(); // KioCG
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0081dd53b6a81ce7892e58d61f9f8a6718e30775..28fbd8df491a4c562de7530e88706e9c88460483 100644
index 494dca2ee48a03953d47050b178496df12bc48c5..a65d64b1ef64cf1cf213cec00e7f73cc7ad2b79c 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3902,4 +3902,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return the result of this method, holding leftovers and spawned items.
@@ -3918,4 +3918,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param score New death screen score of player
*/
PlayerGiveResult give(Collection<ItemStack> items, boolean dropIfFull);
void setDeathScreenScore(int score);
+
+ long getNearbyChunkHot(); // KioCG
}

View File

@@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..96147cace1550d14c682258dab039758
+}
diff --git a/src/main/java/me/earthme/luminol/api/ThreadedRegion.java b/src/main/java/me/earthme/luminol/api/ThreadedRegion.java
new file mode 100644
index 0000000000000000000000000000000000000000..38972ac3d05ccbbb134f751a8d018b9c53ad10b5
index 0000000000000000000000000000000000000000..01dac0602b5f66f80c0adfbb779666fe0325a24f
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/api/ThreadedRegion.java
@@ -0,0 +1,50 @@
@@ -0,0 +1,56 @@
+package me.earthme.luminol.api;
+
+import org.bukkit.Location;
@@ -90,6 +90,12 @@ index 0000000000000000000000000000000000000000..38972ac3d05ccbbb134f751a8d018b9c
+ */
+ @Nullable
+ World getWorld();
+
+ /**
+ * Get the id of the tick region</br>
+ * @return The id of the tick region
+ */
+ long getId();
+}
diff --git a/src/main/java/me/earthme/luminol/api/ThreadedRegionizer.java b/src/main/java/me/earthme/luminol/api/ThreadedRegionizer.java
new file mode 100644
@@ -186,10 +192,10 @@ index 0000000000000000000000000000000000000000..ecde4462b08d701b8bff9f26902f1775
+ RegionStats getRegionStats();
+}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 2729f71ac5525b7669fb7cc8719a75e5ce8d1dfc..9020f0781b399484e2acf0ad139b0b364e1c7a8f 100644
index bff01411f4b2d3ecd9e6d807c3f450d72c108323..1d74f4814d5c87d6cd1320634e5610cac16d32c5 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4409,4 +4409,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4437,4 +4437,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
}
}

View File

@@ -0,0 +1,59 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sun, 6 Apr 2025 10:42:47 +0800
Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
index 42ffb81708b327f765ba3235fdd1ab69cd7589fd..0a7e37420f8d024ffba1fd1c52edc50c10408e6e 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
@@ -25,17 +25,25 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
private float deathSoundVolume;
private float deathSoundPitch;
// Paper end
+ private int rewardExp; // Leaves - exp fix
public EntityDeathEvent(@NotNull final LivingEntity entity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops) {
this(entity, damageSource, drops, 0);
}
public EntityDeathEvent(@NotNull final LivingEntity what, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp) {
+ // Leaves start - exp fix
+ this(what, damageSource, drops, droppedExp, droppedExp);
+ }
+
+ public EntityDeathEvent(@NotNull final LivingEntity what, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int rewardExp) {
super(what);
this.damageSource = damageSource;
this.drops = drops;
this.dropExp = droppedExp;
+ this.rewardExp = rewardExp;
}
+ // Leaves end - exp fix
@NotNull
@Override
@@ -75,6 +83,7 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
*/
public void setDroppedExp(int exp) {
this.dropExp = exp;
+ this.rewardExp = exp; // Leaves - exp fix
}
/**
@@ -226,4 +235,14 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
this.deathSoundPitch = pitch;
}
// Paper end
+
+ // Leaves start - exp fix
+ public int getRewardExp() {
+ return rewardExp;
+ }
+
+ public void setRewardExp(int rewardExp) {
+ this.rewardExp = rewardExp;
+ }
+ // Leaves end - exp fix
}

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sun, 6 Apr 2025 10:42:47 +0800
Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/master/leaves-api/paper-patches/features/0008-Fix-SculkCatalyst-exp-skip.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
index ab7584873e46020148bceecbd42a43055684e6a0..f33ab20313310a113d6c88e0fc1fe1666218061e 100644
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
@@ -18,6 +18,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
private boolean keepLevel = false;
private boolean keepInventory = false;
private boolean doExpDrop; // Paper - shouldDropExperience API
+ private boolean useApiExpDropStatus = false; // Leaves - exp fix
// Paper start - adventure
@org.jetbrains.annotations.ApiStatus.Internal
public PlayerDeathEvent(final @NotNull Player player, final @NotNull DamageSource damageSource, final @NotNull List<ItemStack> drops, final int droppedExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
@@ -122,9 +123,16 @@ public class PlayerDeathEvent extends EntityDeathEvent {
*/
public void setShouldDropExperience(boolean doExpDrop) {
this.doExpDrop = doExpDrop;
+ this.useApiExpDropStatus = true; // Leaves - exp fix
}
// Paper end - shouldDropExperience API
+ // Leaves start - exp fix
+ public boolean forceUseEventDropStatus() {
+ return this.useApiExpDropStatus;
+ }
+ // Leaves end - exp fix
+
@NotNull
@Override
public Player getEntity() {

View File

@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 10:36:31 +0800
Subject: [PATCH] Add experiment config for command block command execution
Subject: [PATCH] Add config for command block command execution
diff --git a/net/minecraft/world/level/BaseCommandBlock.java b/net/minecraft/world/level/BaseCommandBlock.java

View File

@@ -0,0 +1,54 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 8 Mar 2025 09:56:15 +0800
Subject: [PATCH] Add config for entity to clean memory value which is not
belong to current tickregion
Folia does not fully get the entity AI patched correctly, like some memories in entity's brain is still exists when switched dimension or teleported to the new tickregion, which entity is still accessing in the next tick then it will trigger the async catcher, which lead the entity go disappear and throw an exception in the console.In this patch, if this function is turned on, the server will clean the memory that doesn't belong to the entity's tickregion before ticking any behaviors, which can simply fix that.
diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
index 65b2b3ece213d901cdd585093e2fafcd2ef4a7cd..52b08be8b37117edc38dddf6d1919178b1f86271 100644
--- a/net/minecraft/world/entity/ai/Brain.java
+++ b/net/minecraft/world/entity/ai/Brain.java
@@ -399,7 +399,7 @@ public class Brain<E extends LivingEntity> {
}
public void tick(ServerLevel level, E entity) {
- this.forgetOutdatedMemories();
+ this.forgetOutdatedMemories(entity); // Luminol - Add config to force clean entity memory that don't belong to current tick region
this.tickSensors(level, entity);
this.startEachNonRunningBehavior(level, entity);
this.tickEachRunningBehavior(level, entity);
@@ -411,10 +411,31 @@ public class Brain<E extends LivingEntity> {
}
}
- private void forgetOutdatedMemories() {
+ private void forgetOutdatedMemories(E owner) { // Luminol - Add config to force clean entity memory that don't belong to current tick region
for (Entry<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>> entry : this.memories.entrySet()) {
if (entry.getValue().isPresent()) {
ExpirableValue<?> expirableValue = (ExpirableValue<?>)entry.getValue().get();
+ // Luminol start - Add config to force clean entity memory that don't belong to current tick region
+ final Object value = expirableValue.getValue();
+ final net.minecraft.world.level.Level ownerLevel = owner.level();
+
+ // type: entity
+ if (me.earthme.luminol.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForEntity && value instanceof LivingEntity entity) {
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
+ this.eraseMemory(entry.getKey());
+ continue;
+ }
+ }
+
+ // type: block_pos
+ if (me.earthme.luminol.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForBlockPos && value instanceof net.minecraft.core.BlockPos blockPos) {
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ownerLevel, blockPos)) {
+ this.eraseMemory(entry.getKey());
+ continue;
+ }
+ }
+ // Luminol end
+
if (expirableValue.hasExpired()) {
this.eraseMemory(entry.getKey());
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add config for offline mode warning
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index 3abe2881e8a80bd6c128e96b976deebe3ada4678..a0a8b0c7d091f63f023f15a2620b03ae2126782e 100644
index 375f4a59333ee1d75fb1acb8c2cbada7866bd48e..f4b738b05ec9488e20402efb6c935ff55d86adf2 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -285,7 +285,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

View File

@@ -27,7 +27,7 @@ index 1fa5e6a12b943e889bde566038a632a6adcf319e..c1f6a3b3a8fa990b8e9b052341ab31bd
}
}
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
index 177735cf744e564081e4c140a0f8210c3a07e037..7274f2d7df9228f34305a21abde6d114a495c1cb 100644
index 554d75ac1374d7d93977a10e06fcf51259830c97..17c1ce4397c5953bb92aaa3b56c179b7c24a0736 100644
--- a/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
@@ -67,6 +67,11 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add config for vanilla random
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 1e59c21d26baf50fd74bc99c04dbea0faede446a..26637b397b06c14445740a733d378a38a85e1875 100644
index 2cd2ce1060f567be6c72b7bc9d02651ec7166203..f69fd922fa67cd366dbb93c34fa15659ba76c844 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -255,7 +255,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Wed, 21 May 2025 13:04:00 +0800
Subject: [PATCH] Add config to disable end crystal check
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 2e156694b337760be986fdf1cbf863b0d896ef2d..b55ac3c0d19cf9117368c17687fa34099bfe3533 100644
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -546,6 +546,8 @@ public class EndDragonFight {
blockPos = this.portalLocation;
}
+ // Luminol start - Disable end crystal check
+ if (!me.earthme.luminol.config.modules.misc.DisableEndCrystalCheckConfig.disableEndCrystalCheck) {
// Paper start - Perf: Do crystal-portal proximity check before entity lookup
if (placedEndCrystalPos != null) {
// The end crystal must be 0 or 1 higher than the portal origin
@@ -561,6 +563,7 @@ public class EndDragonFight {
}
}
// Paper end - Perf: Do crystal-portal proximity check before entity lookup
+ } // Luminol end - Disable end crystal check
List<EndCrystal> list = Lists.newArrayList();

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 13 Apr 2025 11:07:04 +0800
Subject: [PATCH] Add config to disable heightmap warning
diff --git a/net/minecraft/world/level/levelgen/Heightmap.java b/net/minecraft/world/level/levelgen/Heightmap.java
index 3b27bcfbbe0529d1526adc30760c846b4011645f..95747ae41cea0d4b577c58ef44959a18e0a46672 100644
--- a/net/minecraft/world/level/levelgen/Heightmap.java
+++ b/net/minecraft/world/level/levelgen/Heightmap.java
@@ -123,7 +123,8 @@ public class Heightmap {
if (raw.length == data.length) {
System.arraycopy(data, 0, raw, 0, data.length);
} else {
- LOGGER.warn("Ignoring heightmap data for chunk " + chunk.getPos() + ", size does not match; expected: " + raw.length + ", got: " + data.length);
+ if (!me.earthme.luminol.config.modules.misc.DisableHeightmapWarnConfig.enabled)
+ LOGGER.warn("Ignoring heightmap data for chunk " + chunk.getPos() + ", size does not match; expected: " + raw.length + ", got: " + data.length);
primeHeightmaps(chunk, EnumSet.of(type));
}
}

View File

@@ -0,0 +1,167 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Thu, 1 May 2025 22:43:08 +0800
Subject: [PATCH] Add config to enable tick command
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
index 1382c695c4991488b113401e231875ddc74f6b01..68280b07a71dcdb42eaee6f62fbda074813a22e4 100644
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
@@ -286,6 +286,11 @@ public final class RegionizedServer {
this.randomWalk();
*/
++this.tickCount;
+ // Luminol start - Add a config to enable tick command
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
+ MinecraftServer.tickRateManager.tick();
+ }
+ // Luminol end - Add a config to enable tick command
// expire invalid click command callbacks
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue((int)this.tickCount);
@@ -308,6 +313,13 @@ public final class RegionizedServer {
this.globalTick(world, tickCount);
}
+ // Luminol start - Add a config to enable tick command
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
+ MinecraftServer.tickRateManager.reduceSprintTicks();
+ MinecraftServer.tickRateManager.endTickWork();
+ }
+ // Luminol end - Add a config to enable tick command
+
// tick connections
this.tickConnections();
@@ -441,7 +453,7 @@ public final class RegionizedServer {
}
private void tickTime(final ServerLevel world, final int tickCount) {
- if (world.tickTime) {
+ if ((!me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command
if (world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
world.setDayTime(world.levelData.getDayTime() + (long)tickCount);
}
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
index 7123b3eb2f2e52946b8ef9de993a6828eb0bb6f7..82948984404a183711588932a4a026dc4c241feb 100644
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
@@ -31,8 +31,8 @@ public final class TickRegionScheduler {
}
}
- public static final int TICK_RATE = 20;
- public static final long TIME_BETWEEN_TICKS = 1_000_000_000L / TICK_RATE; // ns
+ public static float TICK_RATE = 20; // Luminol - Add tick command support
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Luminol - Add tick command support
// Folia start - watchdog
public static final FoliaWatchdogThread WATCHDOG_THREAD = new FoliaWatchdogThread();
@@ -375,8 +375,23 @@ public final class TickRegionScheduler {
final long cpuStart = MEASURE_CPU_TIME ? THREAD_MX_BEAN.getCurrentThreadCpuTime() : 0L;
final long tickStart = System.nanoTime();
- // use max(), don't assume that tickStart >= scheduledStart
- final int tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
+ // Luminol start - Add a config to enable tick command
+ final int tickCount;
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
+ if (MinecraftServer.tickRateManager.isSprinting() && MinecraftServer.tickRateManager.checkShouldSprintThisTick()) {
+ TICK_RATE = net.minecraft.server.commands.TickCommand.MAX_TICKRATE;
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
+ tickCount = 1;
+ } else {
+ TICK_RATE = MinecraftServer.tickRateManager.tickrate();
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
+ }
+ } else {
+ // use max(), don't assume that tickStart >= scheduledStart
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
+ }
+ // Luminol end - Add tick command support
if (!this.tryMarkTicking()) {
if (!this.cancelled.get()) {
@@ -416,6 +431,11 @@ public final class TickRegionScheduler {
try {
// next start isn't updated until the end of this tick
this.tickRegion(tickCount, tickStart, scheduledEnd);
+ // Luminol start - Add a config to enable tick command
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
+ MinecraftServer.tickRateManager.endTickWork();
+ }
+ // Luminol end - Add a config to enable tick command
} catch (final Throwable thr) {
this.scheduler.regionFailed(this, false, thr);
// regionFailed will schedule a shutdown, so we should avoid letting this region tick further
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
index 009e6405a11a391adca41a7c4ecafbf3254d799d..779dfa95d91ec4661227c94b012cb63953d4ba96 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -211,7 +211,11 @@ public class Commands {
//TeamMsgCommand.register(this.dispatcher); // Folia - region threading - TODO later
TeleportCommand.register(this.dispatcher);
TellRawCommand.register(this.dispatcher, context);
- //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
+ // Luminol start - Add a config to enable tick command
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
+ TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
+ }
+ // Luminol end - Add a config to enable tick command
TimeCommand.register(this.dispatcher);
TitleCommand.register(this.dispatcher, context);
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 46375fa81b36b89b79c22f0a7ac6d610ab1183d4..2f0a1810e3ab4ff4376e893af7ceb2bf5849ba76 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private String serverId;
public MinecraftServer.ReloadableResources resources;
private final StructureTemplateManager structureTemplateManager;
- private final ServerTickRateManager tickRateManager;
+ public static ServerTickRateManager tickRateManager; // Luminol - Add tick command support
protected WorldData worldData;
public PotionBrewing potionBrewing;
private FuelValues fuelValues;
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
index 40338efd1c0e56d869d03f1d0687e7ff0fcbf11a..d0d90a25a10bbecfffceee1992af88c60d14fd87 100644
--- a/net/minecraft/server/ServerTickRateManager.java
+++ b/net/minecraft/server/ServerTickRateManager.java
@@ -105,7 +105,7 @@ public class ServerTickRateManager extends TickRateManager {
return false;
} else if (this.remainingSprintTicks > 0L) {
this.sprintTickStartTime = System.nanoTime();
- this.remainingSprintTicks--;
+ // this.remainingSprintTicks--; // Luminol - Add tick command support
return true;
} else {
this.finishTickSprint();
@@ -113,6 +113,12 @@ public class ServerTickRateManager extends TickRateManager {
}
}
+ // Luminol start - Add tick command support
+ public void reduceSprintTicks() {
+ this.remainingSprintTicks--;
+ }
+ // Luminol end - Add tick command support
+
public void endTickWork() {
this.sprintTimeSpend = this.sprintTimeSpend + (System.nanoTime() - this.sprintTickStartTime);
}
diff --git a/net/minecraft/server/commands/TickCommand.java b/net/minecraft/server/commands/TickCommand.java
index 6b6c8ce49eda6806c8288d70848dd143ba2c4703..5d09d2c8bb45cc10b2a13100793249adc7b5a7e9 100644
--- a/net/minecraft/server/commands/TickCommand.java
+++ b/net/minecraft/server/commands/TickCommand.java
@@ -14,7 +14,7 @@ import net.minecraft.server.ServerTickRateManager;
import net.minecraft.util.TimeUtil;
public class TickCommand {
- private static final float MAX_TICKRATE = 10000.0F;
+ public static final float MAX_TICKRATE = 10000.0F; // Luminol - Add tick command support
private static final String DEFAULT_TICKRATE = String.valueOf(20);
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {

View File

@@ -0,0 +1,123 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 18 May 2025 03:48:53 +0800
Subject: [PATCH] Add config to modify tripwire behavior
diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java
index 9aace993c6c18f1a50610e4766225485984b8167..419c1c7e14691a472b70ed548ecb928cb289b939 100644
--- a/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -214,10 +214,18 @@ public class TripWireHookBlock extends Block {
BlockPos blockPos1 = pos.relative(direction, i2);
BlockState blockState2 = blockStates[i2];
if (blockState2 != null) {
- BlockState blockState3 = level.getBlockState(blockPos1);
- if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); // Paper - prevent tripwire from updating
+ // Luminol start - tripwire and tripwireHook dupe
+ if (me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled) {
+ level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, flag2), 3);
+ level.getBlockState(blockPos1);
+ } else {
+ BlockState blockState3 = level.getBlockState(blockPos1);
+ if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE))
+ level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); // Paper - prevent tripwire from updating
+ }
}
+ // Luminol end - tripwire and tripwireHook dupe
}
}
}
diff --git a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
index f96fc1391167dea48cac1caa464b9026657df89a..29b286386546db9d809f1b1b5c98571d3058a0f5 100644
--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
@@ -27,6 +27,11 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
// CraftBukkit end
BlockPos.MutableBlockPos mutableBlockPos = pos.mutable();
+ // Luminol start - tripwire behavior modifier
+ java.util.List<BlockPos> blockList1 = new java.util.ArrayList<>();
+ java.util.List<BlockPos> blockList2 = new java.util.ArrayList<>();
+ boolean flag21 = !java.util.Objects.equals(me.earthme.luminol.config.modules.misc.AllowTripwireDupe.behaviorMode, "VANILLA20")
+ && !java.util.Objects.equals(me.earthme.luminol.config.modules.misc.AllowTripwireDupe.behaviorMode, "MIXED");
for (int i = -2; i <= 2; i++) {
for (int i1 = -2; i1 <= 2; i1++) {
for (int i2 = -1; i2 < 3; i2++) {
@@ -35,7 +40,29 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
// CraftBukkit start
if (!blockList.getBlockState(blockPos).is(block)) {
if (dropBlocks) {
- blockList.destroyBlock(blockPos, true, null);
+ boolean flag = false;
+ if (me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled) {
+ switch (me.earthme.luminol.config.modules.misc.AllowTripwireDupe.behaviorMode) {
+ case "VANILLA20": {
+ flag = true;
+ }
+ case "MIXED": {
+ net.minecraft.world.level.block.state.BlockState state = level.getBlockState(blockPos);
+ if (state.is(Blocks.TRIPWIRE)) {
+ if (state.getValue(net.minecraft.world.level.block.TripWireBlock.DISARMED)) {
+ flag = true;
+ blockList2.add(blockPos.immutable());
+ }
+ if (!flag) {
+ flag = checkString(blockList2, blockPos);
+ }
+ }
+ }
+ default: {} // Luminol - 1.21 & default Logic - default empty
+ }
+ }
+ if (flag) blockList1.add(blockPos.immutable());
+ else blockList.destroyBlock(blockPos, true, null);
}
blockList.setBlock(blockPos, block.defaultBlockState(), 3);
@@ -54,11 +81,39 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
if (portalEvent.isCancelled()) return;
}
- // SPIGOT-7856: End platform not dropping items after replacing blocks
- if (dropBlocks) {
- blockList.getList().forEach((state) -> level.destroyBlock(state.getPosition(), true, null));
+ if (flag21 || !me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled) {
+ // Luminol start - When updated replace it with newer code
+ if (dropBlocks) {
+ java.util.function.Consumer<? super org.bukkit.craftbukkit.block.CraftBlockState> beforeRun = state -> level.destroyBlock(state.getPosition(), !blockList1.contains(state.getPosition()), null);
+ java.util.function.Predicate<? super org.bukkit.block.BlockState> filter = $ -> true;
+ for (org.bukkit.craftbukkit.block.CraftBlockState state : blockList.getList()) {
+ if (filter.test(state)) {
+ beforeRun.accept(state);
+ if (state.isPlaced()) {
+ state.getWorldHandle().setBlock(state.getPosition(), state.getHandle(), state.getFlag());
+ }
+ }
+ }
+ } else {
+ blockList.updateList();
+ }
+ // Luminol end - When updated replace it with newer code
+ } else {
+ // SPIGOT-7856: End platform not dropping items after replacing blocks
+ if (dropBlocks) {
+ blockList.getList().forEach((state) -> level.destroyBlock(state.getPosition(), !blockList1.contains(state.getPosition()), null)); // Luminol - prevent tripwire dupe in end platform generate
+ }
+ blockList.updateList();
}
- blockList.updateList();
// CraftBukkit end
}
+
+ private static boolean checkString(java.util.List<BlockPos> blockList, BlockPos blockPos) {
+ for (BlockPos pos : blockList) {
+ if (pos.getY() != blockPos.getY()) continue;
+ if (pos.getX() == blockPos.getX() || pos.getZ() == blockPos.getZ()) return true;
+ }
+ return false;
+ }
+ // Luminol end - tripwire behavior modifier
}

View File

@@ -0,0 +1,197 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Fri, 11 Apr 2025 16:53:57 +0800
Subject: [PATCH] Add config to revert raid changes
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
index 80f17f33f670018240c854df589cf90cdeab6e70..8672757a4d5fb5c247599782fece6b8d7d6ec921 100644
--- a/net/minecraft/world/effect/BadOmenMobEffect.java
+++ b/net/minecraft/world/effect/BadOmenMobEffect.java
@@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect {
&& !serverPlayer.isSpectator()
&& level.getDifficulty() != Difficulty.PEACEFUL
&& level.isVillage(serverPlayer.blockPosition())) {
+ // Leaves start - Revert raid changes
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.trigger) {
+ return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null;
+ }
+ // Leaves end - Revert raid changes
Raid raidAt = level.getRaidAt(serverPlayer.blockPosition());
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
index 2f45befbb50645f1bfb5961ad725f3670ff0d592..190b9f46029ba0a0d69f68db2c56301f4ea21c94 100644
--- a/net/minecraft/world/entity/raid/Raid.java
+++ b/net/minecraft/world/entity/raid/Raid.java
@@ -325,7 +325,20 @@ public class Raid {
}
if (flag1) {
- this.waveSpawnPos = this.getValidSpawnPos();
+ // Luminol Start - Raid revert
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
+ this.waveSpawnPos = this.getValidSpawnPos();
+ } else {
+ int n4 = 0;
+ if (this.raidCooldownTicks < 100) {
+ n4 = 1;
+ }
+ if (this.raidCooldownTicks < 40) {
+ n4 = 2;
+ }
+ this.waveSpawnPos = this.getValidSpawnPos(n4);
+ }
+ // Luminol End - Raid revert
}
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
@@ -360,7 +373,14 @@ public class Raid {
int i = 0;
while (this.shouldSpawnGroup()) {
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
+ // Luminol Start - Raid revert
+ BlockPos blockPos;
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20));
+ } else {
+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(i, 20);
+ }
+ // Luminol End - Raid revert
if (blockPos != null) {
this.started = true;
this.spawnGroup(blockPos);
@@ -372,7 +392,7 @@ public class Raid {
i++;
}
- if (i > 5) {
+ if (i > (me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert ? 3 : 5)) { // Luminol - Raid revert
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
this.stop();
break;
@@ -449,6 +469,17 @@ public class Raid {
return blockPos != null ? Optional.of(blockPos) : Optional.empty();
}
+ // Luminol Start - Raid revert
+ private Optional<BlockPos> getValidSpawnPos(int n) {
+ for (int i = 0; i < 3; ++i) {
+ BlockPos blockPos = this.findRandomSpawnPos(n, 1);
+ if (blockPos == null) continue;
+ return Optional.of(blockPos);
+ }
+ return Optional.empty();
+ }
+ // Luminol End - Raid revert
+
private boolean hasMoreWaves() {
return this.hasBonusWave() ? !this.hasSpawnedBonusWave() : !this.isFinalWave();
}
@@ -674,7 +705,7 @@ public class Raid {
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
int height = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
- if (Mth.abs(height - this.center.getY()) <= 96) {
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.heightCheck || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - Disable height check
mutableBlockPos.set(i2, height, i3);
if (!this.level.isVillage(mutableBlockPos) || i <= 7) {
int i4 = 10;
@@ -694,6 +725,26 @@ public class Raid {
return null;
}
+ // Luminol Start - Raid revert
+ @Nullable
+ private BlockPos findRandomSpawnPos(int n, int n2) {
+ int n3 = 2 - n;
+ BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
+ SpawnPlacementType spawnPlacementType = SpawnPlacements.getPlacementType(EntityType.RAVAGER);
+ for (int i = 0; i < n2; ++i) {
+ float f = this.level.random.nextFloat() * ((float)Math.PI * 2);
+ int n4 = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0f * (float)n3) + this.level.random.nextInt(5);
+ int n5 = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0f * (float)n3) + this.level.random.nextInt(5);
+ int n6 = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, n4, n5);
+ mutableBlockPos.set(n4, n6, n5);
+ if (this.level.isVillage(mutableBlockPos) && n < 2) continue;
+ if (!this.level.hasChunksAt(mutableBlockPos.getX() - 10, mutableBlockPos.getZ() - 10, mutableBlockPos.getX() + 10, mutableBlockPos.getZ() + 10) || !this.level.isPositionEntityTicking(mutableBlockPos) || !spawnPlacementType.isSpawnPositionOk(this.level, mutableBlockPos, EntityType.RAVAGER) && (!this.level.getBlockState((BlockPos)mutableBlockPos.below()).is(Blocks.SNOW) || !this.level.getBlockState(mutableBlockPos).isAir())) continue;
+ return mutableBlockPos;
+ }
+ return null;
+ }
+ // Luminol End - Raid revert
+
private boolean addWaveMob(int wave, Raider raider) {
return this.addWaveMob(wave, raider, true);
}
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
index 7c385baae81b9a987c0e1e4deb017884600331bc..075563d83fadd85191117685fa3b97a9fad14488 100644
--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
@@ -125,6 +125,43 @@ public abstract class Raider extends PatrollingMonster {
currentRaid.removeFromRaid(this, false);
}
+
+ // Leaves start - Revert raid changes
+ if (this.level() instanceof ServerLevel serverLevel) {
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.effect && !this.hasRaid()) {
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
+ net.minecraft.world.entity.player.Player entityhuman = null;
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
+ entityhuman = player;
+ } else if (entity instanceof net.minecraft.world.entity.animal.Wolf wolf) {
+ LivingEntity entityliving = wolf.getOwner();
+ if (wolf.isTame() && entityliving instanceof net.minecraft.world.entity.player.Player player) {
+ entityhuman = player;
+ }
+ }
+
+ if (entityhuman != null && !itemstack.isEmpty() && this.isCaptain()) {
+ net.minecraft.world.effect.MobEffectInstance mobeffect = entityhuman.getEffect(net.minecraft.world.effect.MobEffects.BAD_OMEN);
+ int i = 1;
+
+ if (mobeffect != null) {
+ i += mobeffect.getAmplifier();
+ entityhuman.removeEffectNoUpdate(net.minecraft.world.effect.MobEffects.BAD_OMEN);
+ } else {
+ --i;
+ }
+
+ i = net.minecraft.util.Mth.clamp(i, 0, 4);
+ net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, i, false, false, true);
+
+ if (!serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_DISABLE_RAIDS)) {
+ entityhuman.addEffect(mobeffect1, entityhuman, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true, true); // CraftBukkit // Luminol - Raid revert adapt Cross Region Damage trace
+ }
+ this.setPatrolLeader(false);
+ }
+ }
+ }
+ // Leaves end - Revert raid changes
}
super.die(cause);
@@ -153,7 +190,7 @@ public abstract class Raider extends PatrollingMonster {
}
public boolean hasRaid() {
- return this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null);
+ return !me.earthme.luminol.config.modules.misc.RaidChangesConfig.selfCheck && (this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null)); // Leaves - Disable raid self check
}
public boolean hasActiveRaid() {
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
index 318f24d67be4daf6993ba547da0540be9c221a75..5607d2f21131510563f8fdc9079d1145483b11df 100644
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
@@ -40,7 +40,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
@Override
public void addToTooltip(Item.TooltipContext context, Consumer<Component> tooltipAdder, TooltipFlag tooltipFlag) {
- List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true));
+ List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Luminol - Raid effect infinite
PotionContents.addPotionTooltip(list, tooltipAdder, 1.0F, context.tickRate());
}
}

View File

@@ -22,7 +22,7 @@ index a814512fcfb85312474ae2c2c21443843bf57831..2e084a5b28cbe4737f48c25e10af5892
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
final int chunkX, final int chunkZ, final CompoundTag compound
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
index 98fbc5c8044bd945d64569f13412a6e7e49a4e7f..9709d60d3b2a5478cd6c711669e32f28ac105667 100644
index b5c300f867f4f9670f51b6082982e9363e7a7326..8bafd7ac9706dbf6c43a136733a63ecc3ffb430d 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
@@ -1260,7 +1260,7 @@ public final class MoonriseRegionFileIO {
@@ -55,7 +55,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..c7d4d944eb198ac53a3eeae717a25c7d
+ public void moonrise$write(final abomination.IRegionFile regionFile) throws IOException; // Luminol - Configurable region file format
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index f2124edb487b1d5f6bdc7fa086814f870724363a..ed00a29daccfee1d631bef27c0a3a4ae83140018 100644
index 2f0a1810e3ab4ff4376e893af7ceb2bf5849ba76..27782d1096dc4c9c82c02c29e9b17e2bf8d3f4d3 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -986,10 +986,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Wed, 29 Jan 2025 14:57:20 +0800
Subject: [PATCH] Skip collision check if the block is not belong to current
tick region
A temporary fix of these issues:
https://github.com/PaperMC/Folia/issues/311
Due to that mojang won't ignore the blocks the entity passed by, and sometimes the old position may not be updated and it points to a block that we don't own it, and it will access it during applyEffectsFromBlocks.So the best way to fix that is to skip the collision check of that block because it was already not owned by us and it's not necessary to check it
Related to mojang's bug fix:
https://bugs.mojang.com/browse/MC-92875
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index b5a535cbcf592ef210981334128365ff5bc68e92..477b71c94461ab504b3955437d0f7acb312ed33f 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1676,6 +1676,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return;
}
+ // Luminol start - Try fixing folia's old position issue
+ if(!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, blockPos) && me.earthme.luminol.config.modules.fixes.FoliaOldPositionIssueFixConfig.enabled) {
+ continue;
+ }
+ // Luminol end
+
BlockState blockState = this.level().getBlockState(blockPos);
if (!blockState.isAir() && set.add(blockPos.asLong())) {
try {

View File

@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kercute <A3167717663@hotmail.com>
Date: Sun, 16 Mar 2025 23:31:41 +0800
Subject: [PATCH] Add force the data command to be enabled config
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
index 779dfa95d91ec4661227c94b012cb63953d4ba96..8f7b28e5688252207ad8ce9f3fb6f9c3b65d1adc 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -162,7 +162,9 @@ public class Commands {
ClearInventoryCommands.register(this.dispatcher, context);
//CloneCommands.register(this.dispatcher, context); // Folia - region threading - TODO
DamageCommand.register(this.dispatcher, context);
- //DataCommands.register(this.dispatcher); // Folia - region threading - TODO
+ if(me.earthme.luminol.config.modules.experiment.CommandDataConfig.enabled) {
+ DataCommands.register(this.dispatcher); // Folia - region threading - TODO
+ }
//DataPackCommand.register(this.dispatcher); // Folia - region threading - TODO
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
DefaultGameModeCommands.register(this.dispatcher);

View File

@@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Mon, 27 Jan 2025 13:01:55 +0800
Subject: [PATCH] Add tick regions api
diff --git a/io/papermc/paper/threadedregions/ThreadedRegionizer.java b/io/papermc/paper/threadedregions/ThreadedRegionizer.java
index 604385af903845d966382ad0a4168798e4ed4a0e..45aa5484b1cdb317ed55f1b001dbfe13a720b2a7 100644
--- a/io/papermc/paper/threadedregions/ThreadedRegionizer.java
+++ b/io/papermc/paper/threadedregions/ThreadedRegionizer.java
@@ -43,6 +43,7 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
private final RegionCallbacks<R, S> callbacks;
private final StampedLock regionLock = new StampedLock();
private Thread writeLockOwner;
+ public final me.earthme.luminol.api.ThreadedRegionizer threadedRegionizerAPI; // Luminol - Tick region API
/*
static final record Operation(String type, int chunkX, int chunkZ) {}
@@ -72,6 +73,7 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
this.world = world;
this.callbacks = callbacks;
//this.loadTestData();
+ this.threadedRegionizerAPI = new me.earthme.luminol.api.impl.ThreadedRegionizerImpl(this.world); // Luminol - Tick region API
}
/*
@@ -693,6 +695,7 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
private final ReferenceOpenHashSet<ThreadedRegion<R, S>> mergeIntoLater = new ReferenceOpenHashSet<>();
private final ReferenceOpenHashSet<ThreadedRegion<R, S>> expectingMergeFrom = new ReferenceOpenHashSet<>();
+ public final me.earthme.luminol.api.ThreadedRegion threadedRegionAPI = new me.earthme.luminol.api.impl.ThreadedRegionImpl((ThreadedRegion<TickRegions.TickRegionData, TickRegions.TickRegionSectionData>) this); // Luminol - Tickregion API
public ThreadedRegion(final ThreadedRegionizer<R, S> regioniser) {
this.regioniser = regioniser;
@@ -819,7 +822,7 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
return this.deadSections.size() == this.sectionByKey.size();
}
- private final double getDeadSectionPercent() {
+ public final double getDeadSectionPercent() { // Luminol - Threaded regions api
return (double)this.deadSections.size() / (double)this.sectionByKey.size();
}
diff --git a/io/papermc/paper/threadedregions/TickRegions.java b/io/papermc/paper/threadedregions/TickRegions.java
index 988fe74578065c9464f5639e5cc6af79619edef5..bfb39cbf1ba58d02da7e35300eb95872747506e8 100644
--- a/io/papermc/paper/threadedregions/TickRegions.java
+++ b/io/papermc/paper/threadedregions/TickRegions.java
@@ -134,6 +134,7 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
private final AtomicInteger entityCount = new AtomicInteger();
private final AtomicInteger playerCount = new AtomicInteger();
private final AtomicInteger chunkCount = new AtomicInteger();
+ public final me.earthme.luminol.api.RegionStats regionStatsAPI = new me.earthme.luminol.api.impl.RegionStatsImpl(this); // Luminol - Tickregion API
public int getEntityCount() {
return this.entityCount.get();
@@ -183,6 +184,7 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
private final RegionStats regionStats;
public volatile ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler; // Folia - profiler
+ public final me.earthme.luminol.api.TickRegionData tickRegionDataAPI = new me.earthme.luminol.api.impl.TickRegionDataImpl(this); // Luminol - Tickregion API
private TickRegionData(final ThreadedRegionizer.ThreadedRegion<TickRegionData, TickRegionSectionData> region) {
this.region = region;

View File

@@ -17,7 +17,7 @@ index 8d67b4629c69d3039b199aaad45533d1acde114e..f7bfeca4b11b9860241d5eb80b6df420
((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickServerLevel)(ServerLevel)chunk.getLevel()).moonrise$removeChunkForPlayerTicking(chunk); // Moonrise - chunk tick iteration
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 46375fa81b36b89b79c22f0a7ac6d610ab1183d4..f2124edb487b1d5f6bdc7fa086814f870724363a 100644
index 27782d1096dc4c9c82c02c29e9b17e2bf8d3f4d3..56f5568848d0f20b4d706c07dc8114594e0b5337 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1665,7 +1665,44 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -66,7 +66,7 @@ index 46375fa81b36b89b79c22f0a7ac6d610ab1183d4..f2124edb487b1d5f6bdc7fa086814f87
this.lastServerStatus = nanos;
this.status = this.buildServerStatus();
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index 375f4a59333ee1d75fb1acb8c2cbada7866bd48e..3abe2881e8a80bd6c128e96b976deebe3ada4678 100644
index f4b738b05ec9488e20402efb6c935ff55d86adf2..a0a8b0c7d091f63f023f15a2620b03ae2126782e 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -766,6 +766,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -80,7 +80,7 @@ index 375f4a59333ee1d75fb1acb8c2cbada7866bd48e..3abe2881e8a80bd6c128e96b976deebe
//Util.shutdownExecutors(); // Paper - Improved watchdog support; moved into super
SkullBlockEntity.clear();
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 7fb6cfe0484a4cc1e30fd8e344de307a0c734b68..f2d0d8c7577ea5d798b6a2cf8fd6282cead9de94 100644
index f884c707d4c1f36801018e15efb9adf91f5d6b33..210eba85ac1a50d993ef6e19b65b9f8afada00ba 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -1339,6 +1339,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -118,7 +118,7 @@ index 7fb6cfe0484a4cc1e30fd8e344de307a0c734b68..f2d0d8c7577ea5d798b6a2cf8fd6282c
}
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 423534a1ff02bd0d0f9baacfe2428f45c7d9acb9..9fd3fe181df2ce6dbe695f6463d3940ac4c01167 100644
index 8a192bb24abca6d2ea90d70e12f14733658ed27b..6e3e872ba415e8e809cfbe5a4dc1441b39c45480 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -393,7 +393,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -185,7 +185,7 @@ index 23b342cc31c7e72ade0e1ccad86a9ccf34380f13..249cb7326c8e4012dcffdb6bbb7bfc1f
+ // KioCG end
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 26637b397b06c14445740a733d378a38a85e1875..0a7d6172d42f4b0395aa448b1c1d9fb8eaa4bf7a 100644
index f69fd922fa67cd366dbb93c34fa15659ba76c844..cc8efa162fbe7ce6a91629239bf18d7b6b096a8a 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -5919,4 +5919,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -212,10 +212,10 @@ index f003a65b34027dff14455860815c7d719c5289fa..6f9f8e52d2311343a0c0c3900a466c6a
+ // KioCG end
}
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
index 6394b0899095b047ca9266135fc44aa0c32467cf..af7dbb0f2df0ec42c2c16bc58ba16b6c65d3ebcb 100644
index da922d4c0ffa0f40d5e8dd69487bf30dbbbeed87..94a7b95f41c2954561f9c3cb0f61210c0c058f1d 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
@@ -1720,4 +1720,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1722,4 +1722,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
public float[] getArmorDropChances() {
return this.armorDropChances;
}

View File

@@ -3,9 +3,10 @@ From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 10:53:41 +0800
Subject: [PATCH] Teleport async if entity was moving to another region at once
On folia, entity usually cannot move out of the tickregion, but sometimes it actually does(like some end pearl gun that can shoot an end pearl to the block faraway than 10000 blocks even more). To fix this, we added a temporary fix which teleport these entities to the destination instead running its move logics so that we could ensure anything is under control.But one thing need to consider is that teleportAsync is actually calling halfway of the entity tick and there is still something running when teleportAsync called, which is actually modified the entity in another thread, so there is still need an improvement
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 0a7d6172d42f4b0395aa448b1c1d9fb8eaa4bf7a..b5a535cbcf592ef210981334128365ff5bc68e92 100644
index cc8efa162fbe7ce6a91629239bf18d7b6b096a8a..4026d465687604965f105ded21a8206fd52bd375 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1100,6 +1100,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@@ -3,6 +3,7 @@ From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 10:56:59 +0800
Subject: [PATCH] Try fixing folia off region POI accessing issue
Folia's POIManager sometimes is trying getting the POI record that doesn't belong to current tickregion which is causing some off-main-thread exceptions thrown, so we need to replace the logic with corrected one
diff --git a/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/net/minecraft/world/entity/ai/village/poi/PoiManager.java
index c10810bf00d75f459c3c6a9415c1e09f0519d50e..3adafa43367cd6648ecbccb92ba5bd509740d5a4 100644

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sat, 26 Apr 2025 21:47:45 +0800
Subject: [PATCH] Correct player respawn place
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 6e3e872ba415e8e809cfbe5a4dc1441b39c45480..40f3700c9bf56cfb26f0bca0dc6320fad8c75a65 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -465,8 +465,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
double amountX = selectMaxX - selectMinX;
double amountZ = selectMaxZ - selectMinZ;
- int selectX = amountX < 1.0 ? Mth.floor(worldBorder.getCenterX()) : (int)Mth.floor((amountX + 1.0) * random.nextDouble() + selectMinX);
- int selectZ = amountZ < 1.0 ? Mth.floor(worldBorder.getCenterZ()) : (int)Mth.floor((amountZ + 1.0) * random.nextDouble() + selectMinZ);
+ // Luminol start - Correct player respawn place
+ int selectX = amountX < 0.0 ? Mth.floor(worldBorder.getCenterX()) : (int)Mth.floor(amountX * random.nextDouble() + selectMinX);
+ int selectZ = amountZ < 0.0 ? Mth.floor(worldBorder.getCenterZ()) : (int)Mth.floor(amountZ * random.nextDouble() + selectMinZ);
+ // Luminol end - Correct player respawn place
return new BlockPos(selectX, 0, selectZ);
}
@@ -477,10 +479,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
}
private static BlockPos findSpawnAround(ServerLevel world, ServerPlayer player, BlockPos selected) {
+ // Luminol start - Correct player respawn place
+ BlockPos inChunk;
+ inChunk = PlayerRespawnLogic.getOverworldRespawnPos(world, selected.getX(), selected.getZ());
+ if (inChunk != null) {
+ AABB checkVolume = player.getBoundingBoxAt((double)inChunk.getX() + 0.5, (double)inChunk.getY(), (double)inChunk.getZ() + 0.5);
+ if (player.noCollisionNoLiquid(world, checkVolume)) {
+ return inChunk;
+ }
+ }
+ // Luminol end - Correct player respawn place
// try hard to find, so that we don't attempt another chunk load
for (int dz = -SPAWN_RADIUS_SELECTION_SEARCH; dz <= SPAWN_RADIUS_SELECTION_SEARCH; ++dz) {
for (int dx = -SPAWN_RADIUS_SELECTION_SEARCH; dx <= SPAWN_RADIUS_SELECTION_SEARCH; ++dx) {
- BlockPos inChunk = PlayerRespawnLogic.getOverworldRespawnPos(world, selected.getX() + dx, selected.getZ() + dz);
+ inChunk = PlayerRespawnLogic.getOverworldRespawnPos(world, selected.getX() + dx, selected.getZ() + dz); // Luminol - Correct player respawn place
if (inChunk == null) {
continue;
}

View File

@@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Thu, 24 Apr 2025 20:59:52 +0800
Subject: [PATCH] Command IllegalArgumentException crash fix
diff --git a/net/minecraft/server/commands/FillCommand.java b/net/minecraft/server/commands/FillCommand.java
index 89154adfc659afa188cd771e70087e3b1a9c98b9..e622f96e6e116bf491bbea39da099e02ceaee502 100644
--- a/net/minecraft/server/commands/FillCommand.java
+++ b/net/minecraft/server/commands/FillCommand.java
@@ -210,6 +210,10 @@ public class FillCommand {
// Folia start - region threading
} catch (CommandSyntaxException ex) {
sendMessage(source, ex);
+ // Luminol Start - Server crash fix
+ } catch (IllegalArgumentException ex) {
+ net.minecraft.server.commands.SetBlockCommand.processIAE(source, ex);
+ // Luminol End - Server crash fix
}
}); return 0; // Folia end - region threading
}
diff --git a/net/minecraft/server/commands/SetBlockCommand.java b/net/minecraft/server/commands/SetBlockCommand.java
index 05b824409546ba8bacf7efdaeac106af89ff0715..55911d49c7650b344b46b2cfa9c4ae840ae433c8 100644
--- a/net/minecraft/server/commands/SetBlockCommand.java
+++ b/net/minecraft/server/commands/SetBlockCommand.java
@@ -86,6 +86,15 @@ public class SetBlockCommand {
}
// Folia end - region threading
+ // Luminol Start - Server crash fix
+ public static void processIAE(CommandSourceStack src, IllegalArgumentException ex) {
+ Component hoverText = Component.translatable("command.failed")
+ .withStyle(style -> style.withHoverEvent(new net.minecraft.network.chat.HoverEvent(net.minecraft.network.chat.HoverEvent.Action.SHOW_TEXT, Component.literal(ex.getMessage()))));
+ src.sendFailure(hoverText);
+ com.mojang.logging.LogUtils.getLogger().error(ex.getMessage(), ex);
+ }
+ // Luminol end - Server crash fix
+
private static int setBlock(
CommandSourceStack source, BlockPos pos, BlockInput state, SetBlockCommand.Mode mode, @Nullable Predicate<BlockInWorld> predicate
) throws CommandSyntaxException {
@@ -119,6 +128,10 @@ public class SetBlockCommand {
// Folia start - region threading
} catch (CommandSyntaxException ex) {
sendMessage(source, ex);
+ // Luminol Start - Server crash fix
+ } catch (IllegalArgumentException ex) {
+ processIAE(source, ex);
+ // Luminol End - Server crash fix
}
});
return 1;

View File

@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sun, 9 Mar 2025 11:39:01 +0800
Subject: [PATCH] Do not search the block out of current region
Skip getting the blocks don't belong to current tickregion.
notice: this bug is actually caused by another bug of the teleportAsync implementation.
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 61887e6b052bca715c90dff5d9cd657e0b3f6a78..95e2dff6782bf7767ecb1a23e618862919ea71aa 100644
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -422,6 +422,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
if (i != 0 || i1 != 0 || allowBedrock) {
for (int y = level.getMaxY(); y > (blockPos == null ? level.getMinY() : blockPos.getY()); y--) {
BlockPos blockPos1 = new BlockPos(pos.getX() + i, y, pos.getZ() + i1);
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor((Level) level, blockPos1)) continue; // Luminol - Do not search the block out of current region as we might be at the edge of the tickregion
BlockState blockState = level.getBlockState(blockPos1);
if (blockState.isCollisionShapeFullBlock(level, blockPos1) && (allowBedrock || !blockState.is(Blocks.BEDROCK))) {
blockPos = blockPos1;

View File

@@ -3,9 +3,10 @@ From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:00:49 +0800
Subject: [PATCH] Force disable builtin spark plugin
The spark passed down from paper has some memory leaking issue, so we fully removed it from the code to prevent that memory leaking issue.
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index ed00a29daccfee1d631bef27c0a3a4ae83140018..330af9f4de1c72387326816065350e71fe546efe 100644
index 56f5568848d0f20b4d706c07dc8114594e0b5337..e62e8b9af7ad3e4454702ac86ad2b27973eba66f 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -783,8 +783,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sat, 10 May 2025 19:46:16 +0800
Subject: [PATCH] Fix creative player item pick
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
index 7587130e021d494ae5013f7992b8f3c96590cbd7..1116e2f00ea54f738535d7243fec6ad49b96f6ee 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
@@ -435,7 +435,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
Item item1 = item.getItem();
int count = item.getCount();
// CraftBukkit start - fire PlayerPickupItemEvent
- int canHold = entity.getInventory().canHold(item);
+ // Luminol start - Fix creative item picking
+ int canHold;
+ if (entity instanceof net.minecraft.server.level.ServerPlayer
+ && ((net.minecraft.server.level.ServerPlayer) entity).gameMode.getGameModeForPlayer().equals(net.minecraft.world.level.GameType.CREATIVE)) {
+ canHold = count;
+ } else {
+ canHold = entity.getInventory().canHold(item);
+ }
+ // Luminol end
int remaining = count - canHold;
boolean flyAtPlayer = false; // Paper

View File

@@ -1,159 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 14:15:24 +0800
Subject: [PATCH] Gale Use platform math functions
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Use Math.floor instead of fastfloor"
By: Xymb <xymb@endcrystal.me>
As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Comparison of floor methods used in Paper *
Measure shown is floored number of milliseconds
(nanoseconds integer-divided by 1_000_000
taken to get the floor of 1000 randomly chosen doubles
(all in the range of [-Integer.MAX_VALUE + 10, Integer.MAX_VALUE - 10])
100_000 times (making it 100_000_000 floor operations total)
and adding it to a total.
We are testing the following methods:
* net.minecraft.util.Mth.floor
* java.lang.Math.floor
* java.lang.StrictMath.floor
* org.apache.commons.math3.util.FastMath.floor
* org.apache.commons.math3.util.FastMath.floor, but with a hot start (see comment in code)
* io.papermc.paper.util.MCUtil.fastFloor
The tests performed clearly show that Math.floor is the fastest.
This is most likely due to java.lang.Math's usage of the @IntrinsicCandidate
annotation, which allows the JVM to use a more optimized implementation at runtime.
However, in the case that there is no intrinsic replacement for Math.floor,
it defers to StrictMath.floor, which relies on a number of native methods, and is
still much faster than the existing Minecraft utility functions.
Therefore, using Math.floor instead of these functions is better regardless.
In Apache Commons Math 4, FastMath.floor has also been removed in favor of Math.floor.
The versions used:
* Windows 10 Home 21H2 19044.3086
* OpenJDK Runtime Environment Temurin-19.0.2+7 (build 19.0.2+7)
* Paper a3c760e6af1e8c7244ef75c6da6e6df278a79e14 on Minecraft 1.20.1
* Apache Commons Math 3.6.1
Results:
Total is of type int Total is of type double
----------------------------------------------------------------------------------
Mth.floor 2113 (double) Mth.floor 2658
(int) Math.floor 130 Math.floor 194
(int) StrictMath.floor 835 StrictMath.floor 381
(int) FastMath.floor 412 FastMath.floor 376
(int) FastMath.floor with hot start 359 FastMath.floor with hot start 321
MCUtil.fastFloor 2284 (double) MCUtil.fastFloor 2469
Code is below:
```java
package somepackage;
import io.papermc.paper.util.MCUtil;
import net.minecraft.util.Mth;
import java.util.Random;
public class Main {
public static void main(String[] args) {
// IF FastMath.floor with a hot start:
// FastMath.floor(37485.5);
var random = new Random(4889338);
int size = 1000;
var values = new double[size];
double bound = Integer.MAX_VALUE - 10;
for (int i = 0; i < size; i++) {
values[i] = random.nextDouble(bound * 2) - bound;
}
int repeats = 100_000;
// int total = 0;
// OR
// double total = 0;
long start = System.nanoTime();
for (int repeat = 0; repeat < repeats; repeat++) {
for (int index = 0; index < size; index++) {
total += insert_function_being_tested_here(values[index]);
}
}
long diff = System.nanoTime() - start;
System.out.println(total);
System.out.println(diff / 1_000_000L);
}
}
```
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
index d5d8134da9423cec199cf44762460104677194d6..e0eed27cb33348fcb46858c40014b5fe5dbaf426 100644
--- a/net/minecraft/util/Mth.java
+++ b/net/minecraft/util/Mth.java
@@ -58,18 +58,15 @@ public class Mth {
}
public static int floor(float value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // Gale - use platform math functions
}
public static int floor(double value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // Gale - use platform math functions
}
public static long lfloor(double value) {
- long l = (long)value;
- return value < l ? l - 1L : l;
+ return (long) Math.floor(value); // Gale - use platform math functions
}
public static float abs(float value) {
@@ -81,13 +78,11 @@ public class Mth {
}
public static int ceil(float value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // Gale - use platform math functions
}
public static int ceil(double value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // Gale - use platform math functions
}
public static int clamp(int value, int min, int max) {
@@ -123,15 +118,7 @@ public class Mth {
}
public static double absMax(double x, double y) {
- if (x < 0.0) {
- x = -x;
- }
-
- if (y < 0.0) {
- y = -y;
- }
-
- return Math.max(x, y);
+ return Math.max(Math.abs(x), Math.abs(y)); // Gale - use platform math functions
}
public static int floorDiv(int dividend, int divisor) {

View File

@@ -0,0 +1,86 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 8 Mar 2025 09:55:40 +0800
Subject: [PATCH] Fix a series issue around entity memory typed GlobalPos and
WalkTarget
Fixes the issue remained by the memory cleaning fix due to that there is a little complex relationship in these memories, and we need to manual patch them
diff --git a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
index 2664d72c3b6906d0505df2e63c0e5075eba9461b..f03c3c512ea48c2a89eebae62484922d28e4f831 100644
--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
@@ -69,6 +69,11 @@ public class BehaviorUtils {
}
public static void setWalkAndLookTargetMemories(LivingEntity entity, PositionTracker positionTracker, float speedModifier, int closeEnoughDist) {
+ // Luminol - Do not set walk target if target position is out of current tick region
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity.level(), positionTracker.currentBlockPosition())) {
+ return;
+ }
+ // Luminol end
WalkTarget walkTarget = new WalkTarget(positionTracker, speedModifier, closeEnoughDist);
entity.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, positionTracker);
entity.getBrain().setMemory(MemoryModuleType.WALK_TARGET, walkTarget);
diff --git a/net/minecraft/world/entity/ai/behavior/SleepInBed.java b/net/minecraft/world/entity/ai/behavior/SleepInBed.java
index bc6a5cacd67d46e0beb97adf30d98c1034be1a44..dd35eef062c36a409b6d3e701664db504c4c7631 100644
--- a/net/minecraft/world/entity/ai/behavior/SleepInBed.java
+++ b/net/minecraft/world/entity/ai/behavior/SleepInBed.java
@@ -42,6 +42,12 @@ public class SleepInBed extends Behavior<LivingEntity> {
}
}
+ // Luminol - Prevent off-tick-region chunk operations
+ final net.minecraft.world.level.Level currentLevel = owner.level();
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(currentLevel, globalPos.pos())) {
+ return false;
+ }
+ // Luminol -end
BlockState blockState = level.getBlockStateIfLoaded(globalPos.pos()); // Paper - Prevent sync chunk loads when villagers try to find beds
if (blockState == null) { return false; } // Paper - Prevent sync chunk loads when villagers try to find beds
return globalPos.pos().closerToCenterThan(owner.position(), 2.0) && blockState.is(BlockTags.BEDS) && !blockState.getValue(BedBlock.OCCUPIED);
diff --git a/net/minecraft/world/entity/animal/allay/AllayAi.java b/net/minecraft/world/entity/animal/allay/AllayAi.java
index 36a9887f8be04c5c3fda6d926d819a9e5b2a79f2..5681592bdeb050d875c4c5d0dfaf6e015beb1c74 100644
--- a/net/minecraft/world/entity/animal/allay/AllayAi.java
+++ b/net/minecraft/world/entity/animal/allay/AllayAi.java
@@ -114,6 +114,17 @@ public class AllayAi {
Optional<GlobalPos> memory = brain.getMemory(MemoryModuleType.LIKED_NOTEBLOCK_POSITION);
if (memory.isPresent()) {
GlobalPos globalPos = memory.get();
+ // Luminol start - Do not like item if they were out of current tickregion
+ final Level targetLevel = entity.level().getServer().getLevel(globalPos.dimension());
+ final BlockPos targetPos = globalPos.pos();
+
+ // thread checks
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(targetLevel, targetPos)) {
+ brain.eraseMemory(MemoryModuleType.LIKED_NOTEBLOCK_POSITION); // The memory value is not being belong to current tick region anymore
+ return Optional.empty();
+ }
+ // Luminol end
+
if (shouldDepositItemsAtLikedNoteblock(entity, brain, globalPos)) {
return Optional.of(new BlockPosTracker(globalPos.pos().above()));
}
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 62ca7871d1e5d0fe611948ad43e44c23fdc2d3f8..cd0fc85fbefce4669b4cb637ec3b2628da57adbf 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -257,7 +257,17 @@ public class Sniffer extends Animal {
private boolean canDig(BlockPos pos) {
return this.level().getBlockState(pos).is(BlockTags.SNIFFER_DIGGABLE_BLOCK)
- && this.getExploredPositions().noneMatch(globalPos -> GlobalPos.of(this.level().dimension(), pos).equals(globalPos))
+ && this.getExploredPositions().noneMatch(globalPos -> { // Luminol start - Do not pathfind out of tickregion
+ // thread checks
+ final Level targetLevel = net.minecraft.server.MinecraftServer.getServer().getLevel(globalPos.dimension());
+ final BlockPos targetPos = globalPos.pos();
+
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(targetLevel, targetPos)) {
+ return false;
+ }
+
+ return GlobalPos.of(this.level().dimension(), pos).equals(globalPos); // Original logic
+ }) // Luminol end
&& Optional.ofNullable(this.getNavigation().createPath(pos, 1)).map(Path::canReach).orElse(false);
}

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Fri, 2 May 2025 12:03:14 +0800
Subject: [PATCH] Fix incorrectly synced data after player teleportation
Use vanilla's flag and logics to run some status sync after post teleportation, folia forgets send some packets after teleportation and which caused some desync between client and server
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 40f3700c9bf56cfb26f0bca0dc6320fad8c75a65..b5d0eb5026067080a376b9c3f902dcdf40d5dc48 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1805,14 +1805,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.connection.send(new ClientboundChangeDifficultyPacket(
worlddata.getDifficulty(), worlddata.isDifficultyLocked()
));
- this.connection.send(new ClientboundSetExperiencePacket(
+ /*this.connection.send(new ClientboundSetExperiencePacket( // Luminol start - teleportAsync tweaks, will send in next tick, see the changes below
this.experienceProgress, this.totalExperience, this.experienceLevel
- ));
+ ));*/ // Luminol end
playerlist.sendActivePlayerEffects(this);
playerlist.sendLevelInfo(this, destination);
playerlist.sendPlayerPermissionLevel(this);
+ // Luminol start - teleportAsync tweaks
+ this.lastSentExp = -1;
+ this.lastSentHealth = -1.0F;
+ this.lastSentFood = -1;
+ // Luminol end
+
// regular world add logic
this.unsetRemoved();
destination.addDuringTeleport(this);

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Thu, 24 Apr 2025 23:11:13 +0800
Subject: [PATCH] Fix off tickregion sync teleport
Folis's teleportAsync implementation has some checks missing during the sync teleportation checks, if we are teleport to the edge of the tickregion, it is still asserting that we are in the same tickregion and moved us directly, but there is actually some logics is already touching the stuff out of current tickregion.So we added some new edge checks to the sync teleportation checks which will check the tickregion belonging in a shape of cycle which is in min(entity's bounding box + simulate distance, 6) of radius to fix that issue
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4026d465687604965f105ded21a8206fd52bd375..771744d4540fcd163efcde43c27111680b25c928 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4060,6 +4060,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.resetStoredPositions();
}
+ // Luminol start - Fix sync teleport issue
+ private boolean checkNearbyTickRegions(int destX, int destZ) {
+ // Dumb end gateway search the chunks in radius of 5 chunks, so we need keep 6(5+1) by default check radius
+ int sizeBx = Math.min(6, (int) (this.bb.maxX - this.bb.minX) + this.level.getCraftServer().getSimulationDistance());
+ int sizeBz = Math.min(6, (int) (this.bb.maxZ - this.bb.minZ) + this.level.getCraftServer().getSimulationDistance());
+
+ // check tick thread around these area
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level,
+ (destX >> 4) - sizeBx,
+ (destZ >> 4) - sizeBz,
+ (destX >> 4) + sizeBx,
+ (destZ >> 4) + sizeBz);
+ }
+ // Luminol end
+
protected final void transform(TeleportTransition telpeort) {
PositionMoveRotation move = PositionMoveRotation.calculateAbsolute(
PositionMoveRotation.of(this), PositionMoveRotation.of(telpeort), telpeort.relatives()
@@ -4157,7 +4172,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// check for same region
if (destination == this.level()) {
Vec3 currPos = this.position();
- if (
+ // Luminol - Prevent entity sync teleported to the edge of tickregion
+ if (this.checkNearbyTickRegions((int) pos.x, (int) pos.z) && // Luminol - Fix sync teleport issue
destination.regioniser.getRegionAtUnsynchronised(
ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(currPos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(currPos)
) == destination.regioniser.getRegionAtUnsynchronised(

View File

@@ -3,6 +3,7 @@ From: MrHua269 <wangxyper@163.com>
Date: Tue, 11 Feb 2025 13:34:47 +0800
Subject: [PATCH] Fix uncorrected death check of folia
In the new mc version, mojang changed some checks in A.C.M(AbstractContainerMenu) and there is a new death check of player which will be executed when player dead.But on folia, player entity cannot be discarded unless they disconnected from the server, so there is an obvious bug that when player dead, the logic depend on that dead check will not be executed correctly because the check logic is still asserting the player is alive by checking if the player is discarded, which caused some exploits can save items in the crafting slots(with InventoryTweaks turned on in meteor client) when keepInventory is set to false
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
index 50af953a4698a3c6e16b840fab764dd733b3fbc9..a9c058238819f3631d94ac306185e909821caf35 100644

View File

@@ -1,9 +1,13 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:03:09 +0800
Subject: [PATCH] Merge Paper #11945 for temporary hopper behavior fix
Subject: [PATCH] Paper: Hopper behavior fix
A hopper optimization fix on Paper's pr : https://github.com/PaperMC/Paper/pull/11945
temporary fix
Origin: https://github.com/PaperMC/Paper/pull/11945
Co-authored by: Aikar <aikar@aikar.co>
As part of: Paper (https://github.com/PaperMC/Paper/blob/d2d23118c151f11c00e42b5c60ab7e4a3a1be09c/paper-server/patches/features/0029-Optimize-Hoppers.patch)
Licensed under: MIT (https://github.com/PaperMC/Paper/blob/fa360aa83657d15e8e803ce55800986f6bff8f70/licenses/MIT.md)
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index ae988c4910421fb720177178ef6136e595ae6946..72a81e29be6570fb119b159210453a86f003f893 100644

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 8 Mar 2025 21:21:11 +0800
Subject: [PATCH] Paper: Prevent zombie reinforcements loading chunks
Origin: https://github.com/PaperMC/Paper/pull/11945
Co-authored by: Newwind <support@newwindserver.com>
As part of: Paper (https://github.com/PaperMC/Paper/blob/2ae1f05336d0f13b646e6c284f83ded16aae84ff/patches/server/1045-Prevent-zombie-reinforcements-loading-chunks.patch)
Licensed under: GPL-3.0 (https://github.com/PaperMC/Paper/blob/fa360aa83657d15e8e803ce55800986f6bff8f70/licenses/GPL.md)
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
index cf231380febd6d316eb902d43c636135ee0d7fa4..731473610e068a613d67efaee08ded810fe86cf0 100644
--- a/net/minecraft/world/entity/monster/Zombie.java
+++ b/net/minecraft/world/entity/monster/Zombie.java
@@ -348,6 +348,13 @@ public class Zombie extends Monster {
int i2 = floor1 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
int i3 = floor2 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
BlockPos blockPos = new BlockPos(i1, i2, i3);
+
+ // Paper start - Prevent reinforcement checks from loading chunks
+ if (this.level().getChunkIfLoadedImmediately(blockPos.getX() >> 4, blockPos.getZ() >> 4) == null) {
+ continue;
+ }
+ // Paper end - Prevent reinforcement checks from loading chunks
+
if (SpawnPlacements.isSpawnPositionOk(type, level, blockPos)
&& SpawnPlacements.checkSpawnRules(type, level, EntitySpawnReason.REINFORCEMENT, blockPos, level.random)) {
zombie.setPos(i1, i2, i3);

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:03:59 +0800
Subject: [PATCH] Kaiiju Don't pathfind outside region
Subject: [PATCH] Kaiiju: Don't pathfind outside region
Co-authored by: Sofiane H. Djerbi <46628754+kugge@users.noreply.github.com>
As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/patches/server/0028-Don-t-pathfind-outside-region.patch)
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
diff --git a/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
index 621ba76784f2b92790eca62be4d0688834335ab6..52b3f1795843f40fdb3298cfd1a570a211a08739 100644

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:07:08 +0800
Subject: [PATCH] Kaiiju Entity tick and removal limiter
Subject: [PATCH] Kaiiju: Entity tick and removal limiter
Co-authored by: Xymb <xymb@endcrystal.me>
As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/patches/server/0021-Entity-ticking-throttling-removal-to-prevent-lag.patch)
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java
index c6e487a4c14e6b82533881d01f32349b9ae28728..2c747cb8a724cd25c9d724908f92b320741600de 100644
@@ -17,7 +20,7 @@ index c6e487a4c14e6b82533881d01f32349b9ae28728..2c747cb8a724cd25c9d724908f92b320
// block ticking
private final ObjectLinkedOpenHashSet<BlockEventData> blockEvents = new ObjectLinkedOpenHashSet<>();
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index f2d0d8c7577ea5d798b6a2cf8fd6282cead9de94..c768279df8551498a61d29630f4374f1054a2d8b 100644
index 210eba85ac1a50d993ef6e19b65b9f8afada00ba..2763c3d87ef1f9fcbc01bdff7c0b266d46b8170a 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -808,6 +808,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Mon, 27 Jan 2025 13:01:55 +0800
Subject: [PATCH] Tick regions api
diff --git a/io/papermc/paper/threadedregions/ThreadedRegionizer.java b/io/papermc/paper/threadedregions/ThreadedRegionizer.java
index 604385af903845d966382ad0a4168798e4ed4a0e..7ac803ba9706b65a0125b6e00983fe6a7947991a 100644
--- a/io/papermc/paper/threadedregions/ThreadedRegionizer.java
+++ b/io/papermc/paper/threadedregions/ThreadedRegionizer.java
@@ -819,7 +819,7 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
return this.deadSections.size() == this.sectionByKey.size();
}
- private final double getDeadSectionPercent() {
+ public final double getDeadSectionPercent() { // Luminol - Threaded regions api
return (double)this.deadSections.size() / (double)this.sectionByKey.size();
}

View File

@@ -1,14 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:04:12 +0800
Subject: [PATCH] Kaiiju Vanilla end portal teleportation
Subject: [PATCH] Kaiiju: Vanilla end portal teleportation
Co-authored by: Sofiane H. Djerbi <46628754+kugge@users.noreply.github.com>
As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/patches/server/0024-Vanilla-end-portal-teleportation.patch)
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 477b71c94461ab504b3955437d0f7acb312ed33f..35e413b7b2f8465946b2cc8651560c6899898458 100644
index 771744d4540fcd163efcde43c27111680b25c928..2efc715857d49f69a8289bcf50f422960c00c8bd 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4281,14 +4281,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4291,14 +4291,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
(chunks) -> {
@@ -31,7 +34,7 @@ index 477b71c94461ab504b3955437d0f7acb312ed33f..35e413b7b2f8465946b2cc8651560c68
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
)
@@ -4303,11 +4307,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4313,11 +4317,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
(chunks) -> {
BlockPos adjustedSpawn = destination.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, spawnPos);
@@ -49,7 +52,7 @@ index 477b71c94461ab504b3955437d0f7acb312ed33f..35e413b7b2f8465946b2cc8651560c68
Relative.union(Relative.DELTA, Relative.ROTATION),
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
@@ -4485,6 +4493,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4495,6 +4503,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
@@ -60,7 +63,7 @@ index 477b71c94461ab504b3955437d0f7acb312ed33f..35e413b7b2f8465946b2cc8651560c68
Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos(
@@ -4549,9 +4561,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4559,9 +4571,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postTeleportTransition().onTransition(teleported);
}

View File

@@ -1,11 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 12:21:59 +0800
Subject: [PATCH] Petal Reduce sensor work
Subject: [PATCH] Petal: Reduce sensor work
Co-authored by: peaches94 <peachescu94@gmail.com>
As part of: Petal (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/patches/server/0005-feat-reduce-sensor-work.patch)
Licensed under: GPL-3.0 (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/LICENSE)
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
index af7dbb0f2df0ec42c2c16bc58ba16b6c65d3ebcb..53e78475e721a05e9757235d0849eae3878007cd 100644
index 94a7b95f41c2954561f9c3cb0f61210c0c058f1d..dbe0fc0c46f66c61a2f286d521302719b28917c1 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
@@ -866,11 +866,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab

View File

@@ -1,11 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Suisuroru <qwertyuiop14077@qq.com>
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Thu, 20 Feb 2025 01:00:28 +0800
Subject: [PATCH] Purpur-Barrels-and-enderchests-6-rows
Subject: [PATCH] Purpur: Barrels and enderchests 6 rows
Co-authored by: William Blake Galbreath <Blake.Galbreath@GMail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/features/0003-Barrels-and-enderchests-6-rows.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 548f7a2b0b020ff7fff27396942cc0bc9e755afe..b977d0b2c754c227b667ce9fdd3ebb934db8e974 100644
index 751b011701d6ae373099226ea63ffbafcd24ce6a..e5e946462da9e56344428139768075b7bd228ec0 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1103,6 +1103,10 @@ public abstract class PlayerList {
@@ -20,7 +23,7 @@ index 548f7a2b0b020ff7fff27396942cc0bc9e755afe..b977d0b2c754c227b667ce9fdd3ebb93
public boolean isWhiteListed(GameProfile profile) {
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
index ad34d0e1ab16fb269b3cec2842bfc2f2c29b452e..40b91234fd2e4f4f134d309590ea6b605f764e83 100644
index ae049c5c3593525b991d865fec695c00ad408a59..c6252a245e9701f69db1fe167f6590095237553a 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -200,6 +200,7 @@ public abstract class Player extends LivingEntity {

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Thu, 30 Jan 2025 08:42:29 +0800
Subject: [PATCH] Purpur Lobotomize stuck villagers
Subject: [PATCH] Purpur: Lobotomize stuck villagers
Co-authored by: William Blake Galbreath <Blake.Galbreath@GMail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/features/0001-Ridables.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
index 7ea74aeb905b95e5919d74df5fbc5e8f7a9985e3..b61da3d0d7d24b674cae155b95f7fab0669f4a20 100644

View File

@@ -1,11 +1,13 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 11:43:15 +0800
Subject: [PATCH] Purpur Use alternative keep alive
Subject: [PATCH] Purpur: Use alternative keep alive
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99694c1683 100644
index 79fe336adf35f4f007461ed050e6301764fe7fc3..a5b805b98cf138eabfb06f4ff202462be60c2995 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -41,6 +41,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -33,7 +35,7 @@ index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int)(Util.getMillis() - this.keepAliveTime);
this.latency = (this.latency * 3 + i) / 4;
@@ -250,7 +261,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -254,7 +265,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
final long elapsedTime = millis - this.keepAliveTime;
@@ -57,7 +59,7 @@ index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
@@ -263,6 +289,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -267,6 +293,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
}
}

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
Date: Mon, 24 Feb 2025 06:00:00 -0800
Subject: [PATCH] Configurable tripwire dupe
diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java
index 9aace993c6c18f1a50610e4766225485984b8167..07ffe289b9556b45a9ef7db5357d85b14fe23feb 100644
--- a/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -215,7 +215,7 @@ public class TripWireHookBlock extends Block {
BlockState blockState2 = blockStates[i2];
if (blockState2 != null) {
BlockState blockState3 = level.getBlockState(blockPos1);
- if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
+ if (me.earthme.luminol.config.modules.misc.AllowTripwireDupe.enabled || blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); // Paper - prevent tripwire from updating
}
}

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 12:25:44 +0800
Subject: [PATCH] Pufferfish Cache climbing check for activation
Subject: [PATCH] Pufferfish: Cache climbing check for activation
Co-authored by: Paul Sauve <paul@technove.co>
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/patches/server/0017-Cache-climbing-check-for-activation.patch)
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
index c260741a87513b89a5cc62c543fb9f990f86491e..beb9b3b3cd5ca60bd2cdada937bff8a1da639da5 100644

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 12:27:17 +0800
Subject: [PATCH] Pufferfish Reduce chunk loading & lookups
Subject: [PATCH] Pufferfish: Reduce chunk loading & lookups
Co-authored by: Paul Sauve <paul@technove.co>
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/patches/server/0014-Reduce-chunk-loading-lookups.patch)
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
index 4b5ffd278e0e9d47100e5452949e8d757bbfece4..772ccc4dc66253a84a6d24d00e271d9b4916f052 100644

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Wed, 22 Jan 2025 17:23:16 +0800
Subject: [PATCH] Gale Optimize noise generation
Subject: [PATCH] Gale: Optimize noise generation
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>, ishland <ishlandmc@yeah.net>
As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0106-Optimize-noise-generation.patch) and C2ME (https://github.com/RelativityMC/C2ME-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/level/levelgen/synth/ImprovedNoise.java b/net/minecraft/world/level/levelgen/synth/ImprovedNoise.java
index fb11a2eea540d55e50eab59f9857ca5d99f556f8..dcc1a3f8b611c9f103b848db90b077b984b60ada 100644

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Wed, 22 Jan 2025 17:18:00 +0800
Subject: [PATCH] Gale Replace AI attributes with optimized collections
Subject: [PATCH] Gale: Replace AI attributes with optimized collections
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>, 2No2Name <2No2Name@web.de>
As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0087-Replace-AI-attributes-with-optimized-collections.patch) and Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 4c808c7ef336de74048f40bd1cc8b14131a9325d..8dfd32a8ec590c688dc8d64f18b6b59378c17880 100644

View File

@@ -1,11 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 15:35:15 +0800
Subject: [PATCH] Gale Skip entity move if movement is zero
Subject: [PATCH] Gale: Skip entity move if movement is zero
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>, ishland <ishlandmc@yeah.net>
As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0103-Skip-entity-move-if-movement-is-zero.patch) and VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 35e413b7b2f8465946b2cc8651560c6899898458..59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe 100644
index 2efc715857d49f69a8289bcf50f422960c00c8bd..18e6e9fe39a559ae043fdafcf4e4db467144e309 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1104,7 +1104,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -23,7 +26,7 @@ index 35e413b7b2f8465946b2cc8651560c6899898458..59dd6ecc3b79b1d6c13eda7b71d6dbbf
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -5051,6 +5058,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5061,6 +5068,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setBoundingBox(AABB bb) {

View File

@@ -0,0 +1,68 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 14:15:24 +0800
Subject: [PATCH] Gale: Use platform math functions
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>, Xymb <xymb@endcrystal.me>
As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0019-Use-platform-math-functions.patch) and Kaiiju(https://github.com/KaiijuMC/Kaiiju)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
index d5d8134da9423cec199cf44762460104677194d6..e0eed27cb33348fcb46858c40014b5fe5dbaf426 100644
--- a/net/minecraft/util/Mth.java
+++ b/net/minecraft/util/Mth.java
@@ -58,18 +58,15 @@ public class Mth {
}
public static int floor(float value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // Gale - use platform math functions
}
public static int floor(double value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // Gale - use platform math functions
}
public static long lfloor(double value) {
- long l = (long)value;
- return value < l ? l - 1L : l;
+ return (long) Math.floor(value); // Gale - use platform math functions
}
public static float abs(float value) {
@@ -81,13 +78,11 @@ public class Mth {
}
public static int ceil(float value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // Gale - use platform math functions
}
public static int ceil(double value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // Gale - use platform math functions
}
public static int clamp(int value, int min, int max) {
@@ -123,15 +118,7 @@ public class Mth {
}
public static double absMax(double x, double y) {
- if (x < 0.0) {
- x = -x;
- }
-
- if (y < 0.0) {
- y = -y;
- }
-
- return Math.max(x, y);
+ return Math.max(Math.abs(x), Math.abs(y)); // Gale - use platform math functions
}
public static int floorDiv(int dividend, int divisor) {

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 15:31:52 +0800
Subject: [PATCH] Gale Variable entity wake-up duration
Subject: [PATCH] Gale: Variable entity wake-up duration
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>
As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0054-Variable-entity-wake-up-duration.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
index beb9b3b3cd5ca60bd2cdada937bff8a1da639da5..3c9fc433155dd235668ded700d51d95434ba745f 100644

View File

@@ -1,8 +1,10 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 15:35:43 +0800
Subject: [PATCH] SparklyPaper Optimize canSee checks
Subject: [PATCH] SparklyPaper: Optimize canSee checks
Co-authored by: MrPowerGamerBR <git@mrpowergamerbr.com>
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/paper-patches/features/0005-Optimize-canSee-checks.patch)
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
index 5c507be097051de9a43a31bbc6190c3db7688667..7eff847790394aecd058e7a61905da86163b4c6e 100644

View File

@@ -1,9 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 15:37:25 +0800
Subject: [PATCH] SparklyPaper Skip "distanceToSqr" call in
Subject: [PATCH] SparklyPaper: Skip "distanceToSqr" call in
"ServerEntity#sendChanges" if the delta movement hasn't changed
Co-authored by: MrPowerGamerBR <git@mrpowergamerbr.com>
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/minecraft-patches/features/0002-Skip-distanceToSqr-call-in-ServerEntity-sendChanges-.patch)
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..1de43a4969a2a4535239b15a7bc30d99eb6934c6 100644

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 8 Mar 2025 21:20:11 +0800
Subject: [PATCH] Leaf: Replace brain maps with optimized collection
Co-authored by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch)
Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/MIT.txt)
diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
index 52b08be8b37117edc38dddf6d1919178b1f86271..d98eae5ee8a69a89e37751594dfff636831c8016 100644
--- a/net/minecraft/world/entity/ai/Brain.java
+++ b/net/minecraft/world/entity/ai/Brain.java
@@ -45,14 +45,14 @@ public class Brain<E extends LivingEntity> {
static final Logger LOGGER = LogUtils.getLogger();
private final Supplier<Codec<Brain<E>>> codec;
private static final int SCHEDULE_UPDATE_DELAY = 20;
- private final Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>> memories = Maps.newHashMap();
- private final Map<SensorType<? extends Sensor<? super E>>, Sensor<? super E>> sensors = Maps.newLinkedHashMap();
+ private final Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>> memories = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Leaf - Replace brain maps with optimized collection
+ private final Map<SensorType<? extends Sensor<? super E>>, Sensor<? super E>> sensors = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // Leaf - Replace brain maps with optimized collection
private final Map<Integer, Map<Activity, Set<BehaviorControl<? super E>>>> availableBehaviorsByPriority = Maps.newTreeMap();
private Schedule schedule = Schedule.EMPTY;
- private final Map<Activity, Set<Pair<MemoryModuleType<?>, MemoryStatus>>> activityRequirements = Maps.newHashMap();
- private final Map<Activity, Set<MemoryModuleType<?>>> activityMemoriesToEraseWhenStopped = Maps.newHashMap();
- private Set<Activity> coreActivities = Sets.newHashSet();
- private final Set<Activity> activeActivities = Sets.newHashSet();
+ private final Map<Activity, Set<Pair<MemoryModuleType<?>, MemoryStatus>>> activityRequirements = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Leaf - Replace brain maps with optimized collection
+ private final Map<Activity, Set<MemoryModuleType<?>>> activityMemoriesToEraseWhenStopped = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Leaf - Replace brain maps with optimized collection
+ private Set<Activity> coreActivities = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(); // Leaf - Replace brain maps with optimized collection
+ private final Set<Activity> activeActivities = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(); // Leaf - Replace brain maps with optimized collection
private Activity defaultActivity = Activity.IDLE;
private long lastScheduleUpdate = -9999L;

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 8 Mar 2025 21:14:53 +0800
Subject: [PATCH] Leaf: Remove useless creating stats json bases on player name
logic
Co-authored by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/leaf-server/minecraft-patches/features/0043-Remove-useless-creating-stats-json-bases-on-player-n.patch)
Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/MIT.txt)
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index e5e946462da9e56344428139768075b7bd228ec0..9777a5b7ba9916e426ba87d6ee7cd56f0e43c195 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1420,6 +1420,8 @@ public abstract class PlayerList {
if (serverStatsCounter == null) {
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
File file1 = new File(file, uuid + ".json");
+ // Leaf start - Remove useless creating stats json bases on player name logic
+ /*
if (!file1.exists()) {
File file2 = new File(file, displayName + ".json"); // CraftBukkit
Path path = file2.toPath();
@@ -1427,6 +1429,8 @@ public abstract class PlayerList {
file2.renameTo(file1);
}
}
+ */
+ // Leaf end - Remove useless creating stats json bases on player name logic
serverStatsCounter = new ServerStatsCounter(this.server, file1);
// this.stats.put(uuid, serverStatsCounter); // CraftBukkit

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Tue, 28 Jan 2025 18:56:53 +0800
Subject: [PATCH] Leaf Secure seed and matter seed command
Subject: [PATCH] Leaf: Secure seed and matter seed command
Co-authored by: Apehum <apehumchik@gmail.com>
As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/leaf-server/paper-patches/features/0019-Matter-Secure-Seed.patch and https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/leaf-server/minecraft-patches/features/0050-Matter-Secure-Seed-command.patch)
Licensed under: GPL-3.0 (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/GPL-3.0.txt)
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
index a65affc41a4fc299bc2281f0f53f2e075633899d..f071e469468b768bd9c063d78c222b1b3e3b13bd 100644
@@ -62,7 +65,7 @@ index ac06b8a4813716a8d136be5731cbd96113976a7e..82d95005fc67336458b50c47d44ec404
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index c768279df8551498a61d29630f4374f1054a2d8b..31a1e2d9287654418563f4cb97a17bca42d17e64 100644
index 2763c3d87ef1f9fcbc01bdff7c0b266d46b8170a..0cec31be4733ad330b09e3d2e81c696c396cac3c 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -620,6 +620,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing teleportation apis for folia
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f69f19dcec 100644
index b5d0eb5026067080a376b9c3f902dcdf40d5dc48..62634b5c29a3333fd8f39927f4d0a3258835c891 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1653,6 +1653,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -1666,6 +1666,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
if (respawnComplete != null) {
respawnComplete.accept(ServerPlayer.this);
}
@@ -19,10 +19,10 @@ index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f6
);
});
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814daf9850916 100644
index 18e6e9fe39a559ae043fdafcf4e4db467144e309..2ea6160492cb23e96271dfbfd3bd35fe03109d6a 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4166,6 +4166,31 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4175,6 +4175,31 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// TODO any events that can modify go HERE
@@ -54,7 +54,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
// check for same region
if (destination == this.level()) {
@@ -4282,7 +4307,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4292,7 +4317,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// we just select the spawn position
case END: {
if (destination.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END) {
@@ -74,7 +74,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
// need to load chunks so we can create the platform
destination.moonrise$loadChunksAsync(
targetPos, 16, // load 16 blocks to be safe from block physics
@@ -4307,7 +4343,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4317,7 +4353,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
);
} else {
@@ -94,7 +94,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
// need to load chunk for heightmap
destination.moonrise$loadChunksAsync(
spawnPos, 0,
@@ -4362,8 +4409,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4372,8 +4419,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
WorldBorder destinationBorder = destination.getWorldBorder();
double dimensionScale = net.minecraft.world.level.dimension.DimensionType.getTeleportationScale(origin.dimensionType(), destination.dimensionType());
@@ -114,7 +114,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
ca.spottedleaf.concurrentutil.completable.CallbackCompletable<BlockUtil.FoundRectangle> portalFound
= new ca.spottedleaf.concurrentutil.completable.CallbackCompletable<>();
@@ -4500,9 +4557,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4510,9 +4567,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
@@ -134,7 +134,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
// Kaiiju end
Vec3 initialPosition = this.position();
@@ -4576,6 +4642,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4586,6 +4652,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
tpComplete.accept(teleported);
}
// Kaiiju end
@@ -145,7 +145,7 @@ index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814da
);
});
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 61887e6b052bca715c90dff5d9cd657e0b3f6a78..4f18340a99b141e15f74595282155bbd9632fb86 100644
index 95e2dff6782bf7767ecb1a23e618862919ea71aa..386c38273e21ba6b48f9fad67fddc39255138e14 100644
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -193,6 +193,18 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {

View File

@@ -0,0 +1,142 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 27 Apr 2025 14:26:01 +0800
Subject: [PATCH] Portal Behavior Modifiers
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 0cec31be4733ad330b09e3d2e81c696c396cac3c..de3042c1cad21c55b19ed12da0f4cbd99068540f 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -1353,7 +1353,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
if (levelChunk != null) levelChunk.getChunkHot().startTicking(); try { // KioCG
try {
// Folia end - profiler
+ // Luminol start - Entity portal-teleport speed fix
if (isActive) { // Paper - EAR 2
+ if (!(entity instanceof Player) && entity.flag_portal && entity.flag_compensate_ticks) { // Luminol - after portal compensate tick
+ entity.tick();
+ entity.tick();
+ entity.flag_compensate_ticks = false;
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
+ return;
+ }
+ if (entity.handlePortal()) {
+ return;
+ }
+ } else if (!(entity instanceof Player) && entity.flag_portal) { // Luminol - portal teleport only
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
+ return;
+ }
+ if (entity.handlePortal()) {
+ return;
+ }
+ } else {
entity.tick();
// Folia start - region threading
if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
@@ -1364,6 +1383,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// portalled
return;
}
+ }
+ // Luminol end - Entity portal-teleport speed fix
// Folia end - region threading
} else {entity.inactiveTick();} // Paper - EAR 2
profilerFiller.pop();
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 2ea6160492cb23e96271dfbfd3bd35fe03109d6a..97879ba5080db09dde7cd76fe7b0ba502d8df572 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -343,6 +343,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public long activatedTick = Integer.MIN_VALUE;
public boolean isTemporarilyActive;
public long activatedImmunityTick = Integer.MIN_VALUE;
+ // Luminol start - Entity portal-teleport speed fix
+ public boolean flag_portal = false;
+ public boolean flag_compensate_ticks = false;
+ // Luminol end - Entity portal-teleport speed fix
public void inactiveTick() {
}
@@ -3305,6 +3309,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} else {
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
this.portalProcess = new PortalProcessor(portal, pos.immutable());
+ this.flag_portal = true; // Luminol - Entity portal-teleport speed fix
} else if (!this.portalProcess.isInsidePortalThisTick()) {
this.portalProcess.updateEntryPosition(pos.immutable());
this.portalProcess.setAsInsidePortalThisTick(true);
@@ -3829,20 +3834,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
EntityTreeNode curr;
while ((curr = queue.pollFirst()) != null) {
- EntityTreeNode[] passengers = curr.passengers;
+ restore(curr); // Luminol - EndGateway Portal Passengers Fix
+ }
+ }
+
+ // Luminol Start - EndGateway Portal Passengers Fix
+ private EntityTreeNode[] restore(EntityTreeNode entity) {
+ EntityTreeNode[] passengers = entity.passengers;
if (passengers == null) {
- continue;
+ return null;
}
List<Entity> newPassengers = new java.util.ArrayList<>();
for (EntityTreeNode passenger : passengers) {
+ passenger.passengers = restore(passenger);
newPassengers.add(passenger.root);
- passenger.root.vehicle = curr.root;
+ passenger.root.vehicle = entity.root;
}
-
- curr.root.passengers = ImmutableList.copyOf(newPassengers);
- }
+ entity.root.passengers = ImmutableList.copyOf(newPassengers);
+ return passengers;
}
+ // Luminol End - EndGateway Portal Passengers Fix
public void addTracker() {
for (final EntityTreeNode node : this.getFullTree()) {
@@ -4561,6 +4573,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
+ // Luminol start - Add afterPortalLogic
+ protected void afterPortalLogic() {
+ this.flag_compensate_ticks = true; // Luminol - Entity portal-teleport speed fix
+ this.flag_portal = false; // Luminol - Entity portal-teleport speed fix
+ }
+ // Luminol end - Add afterPortalLogic
+
protected boolean portalToAsync(ServerLevel destination, BlockPos portalPos, boolean takePassengers,
PortalType type, java.util.function.Consumer<Entity> teleportComplete) {
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
@@ -4644,6 +4663,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postTeleportTransition().onTransition(teleported);
}
+ teleported.afterPortalLogic(); // Luminol - Add afterPortalLogic
+
// Kaiiju start - vanilla end teleportation
/*if (teleportComplete != null) {
teleportComplete.accept(teleported);
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
index 88570bb4aa02896545805d7721c45cf9599befea..f2d9ef4429b56785fd9d95abb9d734901d589828 100644
--- a/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
@@ -251,4 +251,11 @@ public class PrimedTnt extends Entity implements TraceableEntity {
return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
}
// Paper end - Option to prevent TNT from moving in water
+
+ // Luminol start - Add afterPortalLogic
+ protected void afterPortalLogic() {
+ this.setUsedPortal(true);
+ super.afterPortalLogic();
+ }
+ // Luminol end - Add afterPortalLogic
}

View File

@@ -1,14 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: adabugra <57899270+adabugra@users.noreply.github.com>
Date: Fri, 31 Jan 2025 19:17:01 +0300
Subject: [PATCH] Leaves Disable moved wrongly threshold
Subject: [PATCH] Leaves: Disable moved wrongly threshold
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/patches/removed/server/0099-Disable-moved-wrongly-threshold.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60048c7231 100644
index da45200818ef4f495c90517c234a41725f709b85..bf617d2ca5e66bbcd244e4f290a7b101a967d18b 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -579,7 +579,7 @@ public class ServerGamePacketListenerImpl
@@ -581,7 +581,7 @@ public class ServerGamePacketListenerImpl
return;
}
// Paper end - Prevent moving into unloaded chunks
@@ -17,7 +20,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
// CraftBukkit end
LOGGER.warn(
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
@@ -609,7 +609,7 @@ public class ServerGamePacketListenerImpl
@@ -611,7 +611,7 @@ public class ServerGamePacketListenerImpl
d5 = d2 - rootVehicle.getZ();
d7 = d3 * d3 + d4 * d4 + d5 * d5;
boolean flag2 = false;
@@ -26,7 +29,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
flag2 = true; // Paper - diff on change, this should be moved wrongly
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
}
@@ -1434,7 +1434,7 @@ public class ServerGamePacketListenerImpl
@@ -1438,7 +1438,7 @@ public class ServerGamePacketListenerImpl
if (this.shouldCheckPlayerMovement(isFallFlying)) {
float f2 = isFallFlying ? 300.0F : 100.0F;
@@ -35,7 +38,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
// CraftBukkit end
// Paper start - Add fail move event
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
@@ -1506,7 +1506,8 @@ public class ServerGamePacketListenerImpl
@@ -1510,7 +1510,8 @@ public class ServerGamePacketListenerImpl
d5 = d2 - this.player.getZ();
d7 = d3 * d3 + d4 * d4 + d5 * d5;
boolean movedWrongly = false; // Paper - Add fail move event; rename

View File

@@ -1,8 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sat, 8 Feb 2025 14:25:16 +0800
Subject: [PATCH] Leaves Fix Incorrect Collision Behavior for Block Shape
Subject: [PATCH] Leaves: Fix Incorrect Collision Behavior for Block Shape
Co-authored by: Fortern <blueten.ki@gmail.com>
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/leaves-server/minecraft-patches/features/0110-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
index 471b6d49d77e03665ffc269d17ab46f225e3ce1c..c574f9a23868a35ef694e432ba581d2f00e39da7 100644

View File

@@ -0,0 +1,81 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Mon, 28 Apr 2025 22:51:32 +0800
Subject: [PATCH] Leaves: Fix SculkCatalyst exp skip
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/leaves-server/paper-patches/features/0016-Fix-SculkCatalyst-exp-skip.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 62634b5c29a3333fd8f39927f4d0a3258835c891..74e5fc8686042525dd79d773832ec0a88a135293 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1351,7 +1351,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
}
// SPIGOT-5478 must be called manually now
- if (event.shouldDropExperience()) this.dropExperience(this.serverLevel(), cause.getEntity()); // Paper - tie to event
+ if (shouldDropExperience(event.shouldDropExperience(), event.forceUseEventDropStatus())) this.dropExperience(this.serverLevel(), cause.getEntity()); // Paper - tie to event // Leaves - exp fix
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {
// Paper start - PlayerDeathEvent#getItemsToKeep
@@ -1385,6 +1385,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.setClientLoaded(false);
}
+ // Leaves start - exp fix
+ private boolean shouldDropExperience(boolean eventResult, boolean forceUseEvent) {
+ if (forceUseEvent) {
+ return eventResult;
+ }
+ return wasExperienceConsumed() ? false : eventResult;
+ }
+ // Leaves end - exp fix
+
private void tellNeutralMobsThatIDied() {
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
this.level()
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 2293c3db45e9ecce4e0d4b2f87b8e90228e44d94..658aa09aecf8d64145feedb82dc9be2a55201450 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -293,6 +293,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected float appliedScale = 1.0F;
// CraftBukkit start
public int expToDrop;
+ public int expToReward; // Leaves - exp fix
public ArrayList<DefaultDrop> drops = new ArrayList<>(); // Paper - Restore vanilla drops behavior
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
public boolean collides = true;
@@ -1761,6 +1762,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
entity.killedEntity((ServerLevel) this.level(), this);
}
this.gameEvent(GameEvent.ENTITY_DIE);
+ if (!this.wasExperienceConsumed()) this.dropExperience((ServerLevel) this.level(), damageSource.getEntity()); // Leaves - exp fix
} else {
this.dead = false;
this.setHealth((float) deathEvent.getReviveHealth());
@@ -1835,7 +1837,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.drops = new ArrayList<>();
// this.dropEquipment(level); // CraftBukkit - moved up
// CraftBukkit end
- this.dropExperience(level, damageSource.getEntity());
+ // this.dropExperience(level, damageSource.getEntity()); // Leaves - exp fix
return deathEvent; // Paper
}
diff --git a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
index bd6693af6412fb08a28ca9a71d5c70d54f72c6e6..8c2e35d087150fb0fc67c7457a4af9298f4b41e1 100644
--- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
@@ -96,8 +96,7 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi
public boolean handleGameEvent(ServerLevel level, Holder<GameEvent> gameEvent, GameEvent.Context context, Vec3 pos) {
if (gameEvent.is(GameEvent.ENTITY_DIE) && context.sourceEntity() instanceof LivingEntity livingEntity) {
if (!livingEntity.wasExperienceConsumed()) {
- DamageSource lastDamageSource = livingEntity.getLastDamageSource();
- int experienceReward = livingEntity.getExperienceReward(level, Optionull.map(lastDamageSource, DamageSource::getEntity));
+ int experienceReward = livingEntity.expToReward; // Leaves - exp fix
if (livingEntity.shouldDropExperience() && experienceReward > 0) {
this.sculkSpreader.addCursors(BlockPos.containing(pos.relative(Direction.UP, 0.5)), experienceReward);
this.tryAwardItSpreadsAdvancement(level, livingEntity);

View File

@@ -0,0 +1,148 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Tue, 29 Apr 2025 23:03:56 +0800
Subject: [PATCH] Add config to enable Cross Region Damage trace
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 74e5fc8686042525dd79d773832ec0a88a135293..221efd21385edb6656b37f7fb672539e92790805 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1371,6 +1371,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.awardStat(Stats.ENTITY_KILLED_BY.get(killCredit.getType()));
killCredit.awardKillScore(this, cause);
this.createWitherRose(killCredit);
+ // Luminol Start - Cross Region Damage trace
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
+ if (entitylivingnew != null) {
+ this.damageTransferToAsync(entitylivingnew, cause);
+ }
+ // Luminol End - Cross Region Damage trace
}
this.level().broadcastEntityEvent(this, (byte)3);
@@ -1385,6 +1392,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.setClientLoaded(false);
}
+ // Luminol Start - Cross Region Damage trace
+ private void damageTransferToAsync(LivingEntity entity, DamageSource cause) {
+ // Operations running on current entity
+ this.awardStat(Stats.ENTITY_KILLED_BY.get(entity.getType()));
+ this.createWitherRose(entity);
+
+ // the entity might be in another tickregion sometimes, so we need to schedule the task onto the entity
+ // to ensure thread safe
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
+ try {
+ nmsEntity.awardKillScore(this, cause);
+ } catch (Throwable ex) {
+ LOGGER.error(ex.getMessage(), ex);
+ }
+ }, null, 1L );
+ }
+ // Luminol End - Cross Region Damage trace
+
// Leaves start - exp fix
private boolean shouldDropExperience(boolean eventResult, boolean forceUseEvent) {
if (forceUseEvent) {
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 658aa09aecf8d64145feedb82dc9be2a55201450..ccb1541e5ea0acf7ec34084a041652e2139ee724 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -1181,6 +1181,29 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
+ // Luminol Start - raid revert adapt Cross Region Damage trace
+ public boolean addEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent, boolean async) {
+ if (ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
+ return addEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
+ postToEntityThreadAddEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
+ return true;
+ }
+ return false;
+ }
+
+ private void postToEntityThreadAddEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent) {
+ if (entity != null)
+ entity.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> {
+ try {
+ addEffect(effectInstance, nmsEntity, cause, fireEvent);
+ } catch (Throwable ex) {
+ LOGGER.error(ex.getMessage(), ex);
+ }
+ }, null, 1L );
+ }
+ // Luminol End - raid revert adapt Cross Region Damage trace
+
public boolean canBeAffected(MobEffectInstance effectInstance) {
if (this.getType().is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
return !effectInstance.is(MobEffects.INFESTED);
@@ -1831,6 +1854,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
final LivingEntity entityliving = this.getKillCredit();
if (entityliving != null) {
entityliving.awardKillScore(this, damageSource);
+ // Luminol Start - Cross Region Damage trace
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
+ if (entitylivingnew != null) {
+ this.damageTransferToAsync(entitylivingnew, damageSource);
+ }
+ // Luminol End - Cross Region Damage trace
}
}); // Paper end
this.postDeathDropItems(deathEvent); // Paper
@@ -1841,6 +1871,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
return deathEvent; // Paper
}
+ // Luminol Start - Cross Region Damage trace
+ private void damageTransferToAsync(LivingEntity entity, DamageSource damageSource) {
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
+ try {
+ nmsEntity.awardKillScore(this, damageSource);
+ } catch (Throwable ex) {
+ LOGGER.error(ex.getMessage(), ex);
+ }
+ }, null, 1L );
+ }
+ // Luminol End - Cross Region Damage trace
+
protected void dropEquipment(ServerLevel level) {
}
protected void postDeathDropItems(org.bukkit.event.entity.EntityDeathEvent event) {} // Paper - method for post death logic that cannot be ran before the event is potentially cancelled
@@ -2474,6 +2516,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
+ // Luminol Start - Cross Region Damage trace
+ @Nullable
+ public LivingEntity getKillCreditOrigin() {
+ if (this.lastHurtByPlayer != null) {
+ return this.lastHurtByPlayer;
+ } else if (this.lastHurtByMob != null) {
+ return this.lastHurtByMob;
+ }
+ return null;
+ }
+ // Luminol End - Cross Region Damage trace
+
public final float getMaxHealth() {
return (float)this.getAttributeValue(Attributes.MAX_HEALTH);
}
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
index 5607d2f21131510563f8fdc9079d1145483b11df..f709880a8c1064298aa133617055e7aa5cc2be5e 100644
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
@@ -28,7 +28,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
@Override
public void onConsume(Level level, LivingEntity entity, ItemStack stack, Consumable consumable) {
- entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
+ entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below // Luminol - Raid effect infinite
}
// Paper start - properly resend entities - collect packets for bundle

View File

@@ -1,9 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Wed, 5 Feb 2025 15:22:19 +0800
Subject: [PATCH] Raytracing tracker experiment
Subject: [PATCH] Add config to enable Raytracing tracker
Based on the framework of EntityCulling(((((((
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
index 7eff847790394aecd058e7a61905da86163b4c6e..9099457f55a2829297ac1db8a69a98ff717d9a86 100644
@@ -19,7 +18,7 @@ index 7eff847790394aecd058e7a61905da86163b4c6e..9099457f55a2829297ac1db8a69a98ff
double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1);
if (rangeY != -1) {
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index f26cdc00180f72bea271877b9ef814daf9850916..647510b9fae49b5a4113a35be9909babf54acfcf 100644
index 97879ba5080db09dde7cd76fe7b0ba502d8df572..002466add86b36529bff6787332b575d1f12305b 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -135,7 +135,7 @@ import net.minecraft.world.scores.ScoreHolder;
@@ -31,7 +30,7 @@ index f26cdc00180f72bea271877b9ef814daf9850916..647510b9fae49b5a4113a35be9909bab
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
@@ -6055,4 +6055,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -6086,4 +6086,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper end - Expose entity id counter
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
@@ -93,10 +92,10 @@ index d9cc1d7e56c37d5ce92544edc10e89dbc89dd15d..39e7689be243b9c99b507d665f659135
public EntityType(
EntityType.EntityFactory<T> factory,
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2c29b452e 100644
index c6252a245e9701f69db1fe167f6590095237553a..40b91234fd2e4f4f134d309590ea6b605f764e83 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -210,6 +210,25 @@ public abstract class Player extends LivingEntity {
@@ -211,6 +211,25 @@ public abstract class Player extends LivingEntity {
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
}
// CraftBukkit end
@@ -122,7 +121,7 @@ index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2
public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
super(EntityType.PLAYER, level);
@@ -262,6 +281,26 @@ public abstract class Player extends LivingEntity {
@@ -263,6 +282,26 @@ public abstract class Player extends LivingEntity {
@Override
public void tick() {
@@ -149,7 +148,7 @@ index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
@@ -1504,6 +1543,7 @@ public abstract class Player extends LivingEntity {
@@ -1505,6 +1544,7 @@ public abstract class Player extends LivingEntity {
if (this.containerMenu != null && this.hasContainerOpen()) {
this.doCloseContainer();
}

View File

@@ -0,0 +1,90 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bacteriawa <A3167717663@hotmail.com>
Date: Thu, 7 Nov 2024 21:50:47 +0100
Subject: [PATCH] Lithium: Fast util
This patch is based on the following mixins:
* "net/caffeinemc/mods/lithium/mixin/math/fast_util/DirectionMixin.java"
* "net/caffeinemc/mods/lithium/mixin/math/fast_util/AABBMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/core/Direction.java b/net/minecraft/core/Direction.java
index 216f97207dac88cc1dc3df59c6ee8a62c7614b4a..3a76b1ec8570e4c9f328e9d362b41057b092be45 100644
--- a/net/minecraft/core/Direction.java
+++ b/net/minecraft/core/Direction.java
@@ -217,7 +217,7 @@ public enum Direction implements StringRepresentable, ca.spottedleaf.moonrise.pa
}
public Direction getOpposite() {
- return this.opposite; // Paper - optimise collisions
+ return VALUES[this.oppositeIndex]; // Leaf - Lithium - fast util
}
public Direction getClockWise(Direction.Axis axis) {
@@ -350,7 +350,7 @@ public enum Direction implements StringRepresentable, ca.spottedleaf.moonrise.pa
}
public static Direction getRandom(RandomSource random) {
- return Util.getRandom(VALUES, random);
+ return VALUES[random.nextInt(VALUES.length)]; // Leaf - Lithium - fast util
}
public static Direction getApproximateNearest(double x, double y, double z) {
diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java
index 85148858db1fd5e9da8bbdde4b0d84110d80e373..82fb85089336f874349fa87e7cb9c14ab087ad8b 100644
--- a/net/minecraft/world/phys/AABB.java
+++ b/net/minecraft/world/phys/AABB.java
@@ -18,6 +18,15 @@ public class AABB {
public final double maxY;
public final double maxZ;
+ // Leaf start - Lithium - fast util
+ static {
+ assert Direction.Axis.X.ordinal() == 0;
+ assert Direction.Axis.Y.ordinal() == 1;
+ assert Direction.Axis.Z.ordinal() == 2;
+ assert Direction.Axis.values().length == 3;
+ }
+ // Leaf end - Lithium - fast util
+
public AABB(double x1, double y1, double z1, double x2, double y2, double z2) {
this.minX = Math.min(x1, x2);
this.minY = Math.min(y1, y2);
@@ -79,11 +88,33 @@ public class AABB {
}
public double min(Direction.Axis axis) {
- return axis.choose(this.minX, this.minY, this.minZ);
+ // Leaf start - Lithium - fast util
+ switch (axis.ordinal()) {
+ case 0: //X
+ return this.minX;
+ case 1: //Y
+ return this.minY;
+ case 2: //Z
+ return this.minZ;
+ }
+
+ throw new IllegalArgumentException();
+ // Leaf end - Lithium - fast util
}
public double max(Direction.Axis axis) {
- return axis.choose(this.maxX, this.maxY, this.maxZ);
+ // Leaf start - Lithium - fast util
+ switch (axis.ordinal()) {
+ case 0: //X
+ return this.maxX;
+ case 1: //Y
+ return this.maxY;
+ case 2: //Z
+ return this.maxZ;
+ }
+
+ throw new IllegalArgumentException();
+ // Leaf end - Lithium - fast util
}
@Override

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bacteriawa <A3167717663@hotmail.com>
Date: Fri, 8 Nov 2024 00:22:44 +0800
Subject: [PATCH] Lithium: Skip unnecessary calculations if player is not
flying or swing
This patch is based on the following mixins:
* "net/caffeinemc/mods/lithium/mixin/entity/fast_elytra_check/LivingEntityMixin.java"
* "net/caffeinemc/mods/lithium/mixin/entity/fast_hand_swing/LivingEntityMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index ccb1541e5ea0acf7ec34084a041652e2139ee724..4eddc407d04428516dc3607e4726d3ff58588c62 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -2698,6 +2698,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {
+ if (!this.swinging && this.swingTime == 0) return; // Leaf - Lithium - entity.fast_hand_swing
int currentSwingDuration = this.getCurrentSwingDuration();
if (this.swinging) {
this.swingTime++;
@@ -3623,6 +3624,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected void updateFallFlying() {
this.checkSlowFallDistance();
if (!this.level().isClientSide) {
+ if (!this.isFallFlying() && this.fallFlyTicks == 0) return; // Leaf - Lithium - entity.fast_elytra_check
if (!this.canGlide()) {
if (this.getSharedFlag(7) != false && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
this.setSharedFlag(7, false);

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 19 Apr 2025 20:38:20 +0800
Subject: [PATCH] Fully removed player teleport event and entity teleport event
call
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a107d9ee24d0e39ce3e3e09bf27af1ea4ae35b96..e786177f9e36c1dfb0cdcfc641ab2e36d42f2451 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1764,7 +1764,7 @@ public class ServerGamePacketListenerImpl
final io.papermc.paper.entity.TeleportFlag.Relative flag = org.bukkit.craftbukkit.entity.CraftPlayer.deltaRelativeToAPI(relativeArgument);
if (flag != null) relativeFlags.add(flag);
}
- PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags));
+ /*PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags)); // Luminol - Fully remove EntityTeleportEvent and PlayerTeleportEvent
// Paper end - Teleport API
this.cserver.getPluginManager().callEvent(event);
@@ -1773,9 +1773,10 @@ public class ServerGamePacketListenerImpl
to = event.isCancelled() ? event.getFrom() : event.getTo();
posMoveRotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch());
}
+ */ // Luminol - Fully remove EntityTeleportEvent and PlayerTeleportEvent
this.internalTeleport(posMoveRotation, relatives);
- return !event.isCancelled(); // CraftBukkit - Return event status
+ return true; //!event.isCancelled(); // CraftBukkit - Return event status // Luminol - Fully remove EntityTeleportEvent and PlayerTeleportEvent
}
public void teleport(Location dest) {
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 6258b008ad3e00d41e9f3014572d6f7a06b1847c..1981f8e9e158ba7874dd3c9bde127654d56170ce 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -4226,7 +4226,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.setPos(x1, y1, z1);
if (flag) {
- if (!(this instanceof ServerPlayer)) {
+ if (!(this instanceof ServerPlayer) && false) { // Luminol - Fully remove EntityTeleportEvent and PlayerTeleportEvent
EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), new Location(this.level().getWorld(), x1, y1, z1), new Location(this.level().getWorld(), x, d, z));
this.level().getCraftServer().getPluginManager().callEvent(teleport);
if (!teleport.isCancelled() && teleport.getTo() != null) { // Paper

View File

@@ -0,0 +1,125 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Fri, 18 Apr 2025 22:04:20 +0800
Subject: [PATCH] Leaf Smart sort entities in NearestLivingEntitySensor
diff --git a/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java b/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java
index b0c5e41fefc7c9adf1a61bd5b52861736657d37e..b91c4aa042f6ac10e402bcf16a03d24d6dafec86 100644
--- a/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java
+++ b/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java
@@ -13,18 +13,107 @@ import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities;
import net.minecraft.world.phys.AABB;
public class NearestLivingEntitySensor<T extends LivingEntity> extends Sensor<T> {
+
+ // Leaf start - Optimized entity sorting with buffer reuse
+ private static final int SMALL_ARRAY_THRESHOLD = 2;
+ private final ThreadLocal<LivingEntity[]> entityBuffer = ThreadLocal.withInitial(() -> new LivingEntity[0]);
+ private final ThreadLocal<long[]> bitsBuffer = ThreadLocal.withInitial(() -> new long[0]);
+
@Override
protected void doTick(ServerLevel level, T entity) {
- double attributeValue = entity.getAttributeValue(Attributes.FOLLOW_RANGE);
- AABB aabb = entity.getBoundingBox().inflate(attributeValue, attributeValue, attributeValue);
- List<LivingEntity> entitiesOfClass = level.getEntitiesOfClass(
- LivingEntity.class, aabb, matchableEntity -> matchableEntity != entity && matchableEntity.isAlive()
+ double range = entity.getAttributeValue(Attributes.FOLLOW_RANGE);
+ double rangeSqr = range * range;
+ AABB aabb = entity.getBoundingBox().inflate(range, range, range);
+
+ List<LivingEntity> entities = level.getEntitiesOfClass(
+ LivingEntity.class, aabb, e -> e != entity && e.isAlive() && entity.distanceToSqr(e) <= rangeSqr
);
- entitiesOfClass.sort(Comparator.comparingDouble(entity::distanceToSqr));
+
+ LivingEntity[] sorted = smartSort(entities, entity);
+ List<LivingEntity> sortedList = java.util.Arrays.asList(sorted);
+
Brain<?> brain = entity.getBrain();
- brain.setMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES, entitiesOfClass);
- brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, new NearestVisibleLivingEntities(level, entity, entitiesOfClass));
+ brain.setMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES, sortedList);
+ brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES,
+ new NearestVisibleLivingEntities(level, entity, sortedList));
+ }
+
+ private LivingEntity[] smartSort(List<LivingEntity> entities, T reference) {
+ int size = entities.size();
+ if (size <= 1) return entities.toArray(new LivingEntity[0]);
+
+ LivingEntity[] entityBufferArray = this.entityBuffer.get();
+ long[] bitsBufferArray = this.bitsBuffer.get();
+ if (entityBufferArray.length < size) {
+ entityBufferArray = new LivingEntity[size];
+ entityBuffer.set(entityBufferArray);
+
+ bitsBufferArray = new long[size];
+ bitsBuffer.set(bitsBufferArray);
+ }
+
+ for (int i = 0; i < size; i++) {
+ LivingEntity e = entities.get(i);
+ entityBufferArray[i] = e;
+ bitsBufferArray[i] = Double.doubleToRawLongBits(reference.distanceToSqr(e));
+ }
+
+ fastRadixSort(entityBufferArray, bitsBufferArray, 0, size - 1, 62);
+
+ return java.util.Arrays.copyOf(entityBufferArray, size);
+ }
+
+ private void fastRadixSort(LivingEntity[] ents, long[] bits, int low, int high, int bit) {
+ if (bit < 0 || low >= high) return;
+
+ if (high - low <= SMALL_ARRAY_THRESHOLD) {
+ insertionSort(ents, bits, low, high);
+ return;
+ }
+
+ int i = low, j = high;
+ final long mask = 1L << bit;
+
+ while (i <= j) {
+ while (i <= j && (bits[i] & mask) == 0) i++;
+ while (i <= j && (bits[j] & mask) != 0) j--;
+
+ if (i < j) {
+ swap(ents, bits, i++, j--);
+ }
+ }
+
+ if (low < j) fastRadixSort(ents, bits, low, j, bit - 1);
+ if (i < high) fastRadixSort(ents, bits, i, high, bit - 1);
+ }
+
+ private void insertionSort(LivingEntity[] ents, long[] bits, int low, int high) {
+ for (int i = low + 1; i <= high; i++) {
+ int j = i;
+ LivingEntity e = ents[j];
+ long b = bits[j];
+
+ while (j > low && bits[j - 1] > b) {
+ ents[j] = ents[j - 1];
+ bits[j] = bits[j - 1];
+ j--;
+ }
+
+ ents[j] = e;
+ bits[j] = b;
+ }
+ }
+
+ private void swap(LivingEntity[] ents, long[] bits, int a, int b) {
+ LivingEntity te = ents[a];
+ ents[a] = ents[b];
+ ents[b] = te;
+
+ long tb = bits[a];
+ bits[a] = bits[b];
+ bits[b] = tb;
}
+ // Leaf end - Optimized entity sorting with buffer reuse
@Override
public Set<MemoryModuleType<?>> requires() {

View File

@@ -63,7 +63,7 @@ index 29bd788ae8bc61c1e62a4f84b9e259931a7041ce..1676ac5e6c8369836bf719f338603fbb
} else {
final Optional<String> gitBranch = build.gitBranch();
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
index e741201fdbea0dbbc0e42313ebd33368014c9dc4..673a81734a0903a0790f3007772642d3d9a044cc 100644
index e741201fdbea0dbbc0e42313ebd33368014c9dc4..e3c5f4c31f084294a59830f3e764921433dd80d5 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
@@ -91,7 +91,7 @@ index e741201fdbea0dbbc0e42313ebd33368014c9dc4..673a81734a0903a0790f3007772642d3
@Override
public boolean isBrandCompatible(final @NotNull Key brandId) {
- return brandId.equals(this.brandId);
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Luminol
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID); // Luminol
}
@Override

View File

@@ -22,10 +22,10 @@ index de8b9048c8395c05b8688bc9d984b8ad680f15b3..f42692cd4f0154705c3d5b030d281cfc
+ // KioCG end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2d1b672fc152054d7b6abf47f443b87f5a2ea3de..3e4e0dcdd4e2808aef8dd41f159a358f47450f40 100644
index f7ceb89d9b908f02fc9e90e426e8e14e330ac041..b6e451c8a41a1d25bac679d18156d6e813efda2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2404,6 +2404,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2400,6 +2400,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
handle.expToDrop = data.getInt("expToDrop");
handle.keepLevel = data.getBoolean("keepLevel");
}
@@ -41,7 +41,7 @@ index 2d1b672fc152054d7b6abf47f443b87f5a2ea3de..3e4e0dcdd4e2808aef8dd41f159a358f
}
}
@@ -2425,6 +2434,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2421,6 +2430,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName());
@@ -57,11 +57,10 @@ index 2d1b672fc152054d7b6abf47f443b87f5a2ea3de..3e4e0dcdd4e2808aef8dd41f159a358f
// Paper start - persist for use in offline save data
if (!nbttagcompound.contains("Paper")) {
nbttagcompound.put("Paper", new CompoundTag());
@@ -3611,4 +3629,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return forwardMovement == backwardMovement ? 0 : forwardMovement ? 1 : -1;
@@ -3614,4 +3632,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setDeathScreenScore(final int score) {
getHandle().setScore(score);
}
+
+ // KioCG start - ChunkHot
+ @Override
+ public long getNearbyChunkHot() {

View File

@@ -18,10 +18,10 @@ index a0b84535a9d3833d4df692b85b272f145559dd80..c2ba46408b5ad727d7a17f21d47b2898
return;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 09853a5035a6cb2f9efa20a68644038f11065a9d..00b3db1c0c449e77cd365c70d0ce044c56b2dcf7 100644
index a60e6ed437764ebeaab64e9ae7b87a177119e436..7ffdc9a50c41adcac5d2b8ac84036aacc789ece6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -314,7 +314,7 @@ public final class CraftServer implements Server {
@@ -315,7 +315,7 @@ public final class CraftServer implements Server {
public static Exception excessiveVelEx; // Paper - Velocity warnings
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer; // Paper - Custom Potion Mixes
@@ -30,7 +30,7 @@ index 09853a5035a6cb2f9efa20a68644038f11065a9d..00b3db1c0c449e77cd365c70d0ce044c
// Paper start - Folia region threading API
private final io.papermc.paper.threadedregions.scheduler.FoliaRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaRegionScheduler(); // Folia - region threading
@@ -492,7 +492,7 @@ public final class CraftServer implements Server {
@@ -493,7 +493,7 @@ public final class CraftServer implements Server {
}
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
@@ -39,7 +39,7 @@ index 09853a5035a6cb2f9efa20a68644038f11065a9d..00b3db1c0c449e77cd365c70d0ce044c
}
public boolean getCommandBlockOverride(String command) {
@@ -1156,7 +1156,7 @@ public final class CraftServer implements Server {
@@ -1157,7 +1157,7 @@ public final class CraftServer implements Server {
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
@@ -48,7 +48,7 @@ index 09853a5035a6cb2f9efa20a68644038f11065a9d..00b3db1c0c449e77cd365c70d0ce044c
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1185,7 +1185,7 @@ public final class CraftServer implements Server {
@@ -1186,7 +1186,7 @@ public final class CraftServer implements Server {
this.loadPlugins();
this.enablePlugins(PluginLoadOrder.STARTUP);
this.enablePlugins(PluginLoadOrder.POSTWORLD);

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] SparklyPaper Optimize canSee checks
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3e4e0dcdd4e2808aef8dd41f159a358f47450f40..450350e66ae42f234bfd3016da1434e3194259e2 100644
index b6e451c8a41a1d25bac679d18156d6e813efda2a..48c85729a6de20b554325ca29c2448d515bbc7a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -214,7 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -210,7 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private boolean hasPlayedBefore = false;
private final ConversationTracker conversationTracker = new ConversationTracker();
private final Set<String> channels = new HashSet<String>();
@@ -17,7 +17,7 @@ index 3e4e0dcdd4e2808aef8dd41f159a358f47450f40..450350e66ae42f234bfd3016da1434e3
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
@@ -2268,9 +2268,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2264,9 +2264,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public boolean canSee(org.bukkit.entity.Entity entity) {

View File

@@ -23,10 +23,10 @@ index f42692cd4f0154705c3d5b030d281cfc333803ed..39cc976f65f826a00e2e637c139f9134
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 00b3db1c0c449e77cd365c70d0ce044c56b2dcf7..4e9248980ee7400d856dc30792197468559bfe9b 100644
index 7ffdc9a50c41adcac5d2b8ac84036aacc789ece6..292f32c935767b54098290eea8a512b82f962caf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1423,7 +1423,11 @@ public final class CraftServer implements Server {
@@ -1424,7 +1424,11 @@ public final class CraftServer implements Server {
registryAccess = levelDataAndDimensions.dimensions().dimensionsRegistryAccess();
} else {
LevelSettings levelSettings;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Tick regions api
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 82d26889661a944e057be0c450fb5a296122ea8e..4f320a91fb8abe21cbb7b01fdc34330def5b2448 100644
index cd6e46fa68c009deb8dfebcecb88e058dfede0b0..f0c8e76efaf897a81283edbf9a9c2a71bc28c9a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2517,4 +2517,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -16,7 +16,7 @@ index 82d26889661a944e057be0c450fb5a296122ea8e..4f320a91fb8abe21cbb7b01fdc34330d
+ // Luminol start - Tick regions api
+ @Override
+ public me.earthme.luminol.api.ThreadedRegionizer getThreadedRegionizer() {
+ return new me.earthme.luminol.api.impl.ThreadedRegionizerImpl(this.world);
+ return this.world.regioniser.threadedRegionizerAPI;
+ }
+ // Luminol end
}

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sun, 6 Apr 2025 10:42:46 +0800
Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index bef7a026676ab59a84fc33c8af50ad2b9447fd8c..0a678458bcee4ced98d2880821dbff302f59b7f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -991,7 +991,7 @@ public class CraftEventFactory {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource);
CraftWorld world = (CraftWorld) entity.getWorld();
- EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, new io.papermc.paper.util.TransformingRandomAccessList<>(drops, Entity.DefaultDrop::stack, FROM_FUNCTION), victim.getExpReward(world.getHandle(), damageSource.getEntity())); // Paper - Restore vanilla drops behavior
+ EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, new io.papermc.paper.util.TransformingRandomAccessList<>(drops, Entity.DefaultDrop::stack, FROM_FUNCTION), victim.getExpReward(world.getHandle(), damageSource.getEntity()), victim.getExperienceReward(world.getHandle(), damageSource.getEntity())); // Paper - Restore vanilla drops behavior // Leaves - exp fix
populateFields(victim, event); // Paper - make cancellable
Bukkit.getServer().getPluginManager().callEvent(event);
@@ -1002,6 +1002,7 @@ public class CraftEventFactory {
playDeathSound(victim, event);
// Paper end
victim.expToDrop = event.getDroppedExp();
+ victim.expToReward = event.getRewardExp(); // Leaves - exp fix
lootCheck.run(); // Paper - advancement triggers before destroying items
// Paper start - Restore vanilla drops behavior
@@ -1037,6 +1038,7 @@ public class CraftEventFactory {
victim.newLevel = event.getNewLevel();
victim.newTotalExp = event.getNewTotalExp();
victim.expToDrop = event.getDroppedExp();
+ victim.expToReward = event.getRewardExp(); // Leaves - exp fix
victim.newExp = event.getNewExp();
// Paper start - Restore vanilla drops behavior

View File

@@ -1,6 +1,6 @@
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/api/impl/ThreadedRegionImpl.java
@@ -1,0 +_,47 @@
@@ -1,0 +_,52 @@
+package me.earthme.luminol.api.impl;
+
+import io.papermc.paper.threadedregions.ThreadedRegionizer;
@@ -39,7 +39,7 @@
+
+ @Override
+ public TickRegionData getTickRegionData() {
+ return new TickRegionDataImpl(this.internal.getData());
+ return this.internal.getData().tickRegionDataAPI;
+ }
+
+ @Nullable
@@ -47,4 +47,9 @@
+ public World getWorld() {
+ return this.internal.regioniser.world.getWorld();
+ }
+
+ @Override
+ public long getId() {
+ return this.internal.id;
+ }
+}

View File

@@ -40,7 +40,7 @@
+ return null;
+ }
+
+ return new ThreadedRegionImpl(got);
+ return got.threadedRegionAPI;
+ }
+
+ @Override
@@ -51,6 +51,6 @@
+ return null;
+ }
+
+ return new ThreadedRegionImpl(got);
+ return got.threadedRegionAPI;
+ }
+}

View File

@@ -27,7 +27,7 @@
+
+ @Override
+ public RegionStats getRegionStats() {
+ return new RegionStatsImpl(this.internal.getRegionStats());
+ return this.internal.getRegionStats().regionStatsAPI;
+ }
+
+}

View File

@@ -0,0 +1,10 @@
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/DefaultTransformLogic.java
@@ -1,0 +_,7 @@
+package me.earthme.luminol.config;
+
+public class DefaultTransformLogic {
+ public Object transform(Object obj) {
+ return obj;
+ }
+}

View File

@@ -1,6 +1,6 @@
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/EnumConfigCategory.java
@@ -1,0 +_,19 @@
@@ -1,0 +_,20 @@
+package me.earthme.luminol.config;
+
+public enum EnumConfigCategory {
@@ -8,7 +8,8 @@
+ FIXES("fixes"),
+ MISC("misc"),
+ GAMEPLAY("gameplay"),
+ EXPERIMENT("experiment");
+ EXPERIMENT("experiment"),
+ REMOVED("removed");
+
+ private final String baseKeyName;
+

Some files were not shown because too many files have changed in this diff Show More