Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 481d5bc001 | |||
| 13474bf193 | |||
| 61990fd9e9 |
+1
-1
@@ -11,4 +11,4 @@ issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
custom: [https://afdian.com/a/bm0721] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
custom: https://afdian.com/a/Luminol
|
||||
|
||||
@@ -32,10 +32,10 @@ jobs:
|
||||
BUILD_NUMBER: ${{ github.run_number }}
|
||||
steps:
|
||||
- name: Checkout Git Repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set Up JDK
|
||||
uses: actions/setup-java@v5.7.0
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: 25
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Configure Git User Details
|
||||
run: git config --global user.email "ci@lophinelabs.com" && git config --global user.name "LophinelabsCI"
|
||||
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
|
||||
|
||||
- name: Apply All Patches
|
||||
run: ./gradlew --refresh-dependencies applyAllPatches
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
tag: ${{ env.tag }}
|
||||
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
|
||||
body: |
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [](https://github.com/LophineLabs/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [](https://github.com/LuminolMC/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
|
||||
This release is automatically compiled by GitHub Actions
|
||||
### Branch Info
|
||||
> ${{ github.ref_name }}
|
||||
@@ -143,7 +143,7 @@ jobs:
|
||||
tag: ${{ env.tag }}
|
||||
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
|
||||
body: |
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [](https://github.com/LophineLabs/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [](https://github.com/LuminolMC/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
|
||||
This release is automatically compiled by GitHub Actions
|
||||
### Comments
|
||||
> ${{ inputs.comments }}
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
pull-requests: write
|
||||
checks: write
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
|
||||
fetch-depth: 0 # a full history is required for pull request analysis
|
||||
|
||||
+3
-3
@@ -3,11 +3,11 @@ Lophine inherits its licensing from the included upstream projects.
|
||||
Lophine从上游继承了许可证。
|
||||
|
||||
As such, Lophine 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.
|
||||
[GNU General Public License version 3](licenses/GPL.md); as it inherits it from Luminol,
|
||||
who in turn inherits it from the original Folia, Paper, Spigot, Bukkit and CraftBukkit projects.
|
||||
|
||||
因此,Lophine中应当遵守[GNU通用公共许可证-第3版](licenses/GPL.md);
|
||||
因为Lophine从上游Folia继承了它,而Folia又从其上游的Paper、Spigot、Bukkit和Craftbukkit项目中继承了它。
|
||||
因为Lophine从上游Luminol继承了它,而Luminol又从其上游的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.
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
|
||||
# Lophine
|
||||
|
||||
*Lophine 是一个基于Folia的分支,具有许多有用的优化和可配置的原版特性,目标是在Folia上实现更多生电的内容(请注意,完整生电请使用Fabric)*
|
||||
*Lophine 是一个基于Luminol的分支,具有许多有用的优化和可配置的原版特性,目标是在Folia上实现更多生电的内容(请注意,完整生电请使用Fabric)*
|
||||
|
||||

|
||||
[](LICENSE.md)
|
||||
[](https://github.com/LophineLabs/Lophine/issues)
|
||||

|
||||
[](LICENSE.md)
|
||||
[](https://github.com/LuminolMC/Lophine/issues)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
[English](./README_EN.md) | **中文(简体)** | [中文(繁體)](./README_ZH_TW.md)
|
||||
[English](./README_EN.md) | **中文**
|
||||
</div>
|
||||
|
||||
---
|
||||
@@ -29,15 +29,10 @@
|
||||
- 🔬 **生电功能增强** - 在 Folia 上实现更多生电内容(完整生电请使用 Fabric)
|
||||
- 🛠️ **更多实用功能** - 持续添加有用的服务器功能
|
||||
|
||||
### 额外启动参数
|
||||
|
||||
- morninggloryclip.useMojangSource 强制服务端使用mojang源下载文件
|
||||
- morninggloryclip.enable.mixin 启用服务器插件的mixin支持
|
||||
|
||||
## 📥 下载
|
||||
|
||||
### 稳定版本
|
||||
所有发布版本都可以在 [Releases](https://github.com/LophineLabs/Lophine/releases) 页面找到。
|
||||
所有发布版本都可以在 [Releases](https://github.com/LuminolMC/Lophine/releases) 页面找到。
|
||||
|
||||
### 开发版本
|
||||
如果您想体验最新功能,可以通过以下步骤自行构建。
|
||||
@@ -46,11 +41,11 @@
|
||||
|
||||
```bash
|
||||
# 克隆项目
|
||||
git clone https://github.com/LophineLabs/Lophine.git
|
||||
git clone https://github.com/LuminolMC/Lophine.git
|
||||
cd Lophine
|
||||
|
||||
# 应用补丁并构建 Paperclip JAR
|
||||
./gradlew applyAllPatches && ./gradlew createPaperclipJar
|
||||
./gradlew applyAllPatches && ./gradlew createMojmapPaperclipJar
|
||||
```
|
||||
|
||||
构建完成后,您可以在 `lophine-server/build/libs` 目录中找到生成的 JAR 文件。
|
||||
@@ -62,16 +57,12 @@ cd Lophine
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
url = "https://repo.bacteriawa.com/repository/maven-public/"
|
||||
url = "https://repo.menthamc.org/repository/maven-public/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
||||
compileOnly("fun.bm.lophine:lophine-api:$VERSION")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -80,16 +71,16 @@ java {
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repository</id>
|
||||
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
|
||||
<id>menthamc</id>
|
||||
<url>https://repo.menthamc.org/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fun.bm.lophine</groupId>
|
||||
<artifactId>lophine-api</artifactId>
|
||||
<version>[26.2.build,)</version>
|
||||
<artifactId>luminol-api</artifactId>
|
||||
<version>$VERSION</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
@@ -100,13 +91,15 @@ java {
|
||||
|
||||
### 加入我们的社区
|
||||
|
||||
- **QQ群**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
|
||||
- **Discord**: [点击加入](https://discord.gg/UXSgPZczcy)
|
||||
- **QQ群**: [1015048616](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=QML5kIVsniPi1PlZvnjHQT_02EHsZ5Jc&authKey=%2FTCJsZC7JFQ9sxAroPCKuYnlV57Z5fyqp36ewXZk3Sn4iJ9p4MB1JKdc%2FFcX3HOM&noverify=0&group_code=1015048616)
|
||||
- **QQ频道**: [点击加入](https://pd.qq.com/s/eq9krf9j)
|
||||
- **Telegram**: [点击加入](https://t.me/LuminolMinecraft)
|
||||
- **Discord**: [点击加入](https://discord.gg/Qd7m3V6eDx)
|
||||
|
||||
### 获取帮助
|
||||
|
||||
- 📋 [提交 Issue](https://github.com/LophineLabs/Lophine/issues)
|
||||
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
|
||||
- 📋 [提交 Issue](https://github.com/LuminolMC/Lophine/issues)
|
||||
- 💬 [GitHub Discussions](https://github.com/LuminolMC/Lophine/discussions)
|
||||
- 📖 [项目文档](./docs/)
|
||||
|
||||
## 🐛 问题反馈
|
||||
@@ -131,6 +124,34 @@ java {
|
||||
|
||||

|
||||
|
||||
## 🎉 特别感谢
|
||||
|
||||
### 项目赞助商
|
||||
|
||||
<div align="center">
|
||||
<b>感谢 <a href="https://github.com/LegacyLands">LegacyLands</a> 对本项目的赞助</b>
|
||||
<br>
|
||||
<i>如果你想开发跨 Folia/非 Folia 平台的插件,<a href="https://github.com/LegacyLands/legacy-lands-library/">legacy-lands-library</a> 将会是个不错的选择</i>
|
||||
<br><br>
|
||||
<img src="public/image/legacy-lands-logo.png" alt="LegacyLands Logo" width="200">
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ⭐ 请给我们一个 Star!
|
||||
|
||||
> 你的每一个免费的 ⭐Star 就是我们每一个前进的动力。
|
||||
|
||||
### Star 历史
|
||||
|
||||
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&LuminolMC/Lophine&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
|
||||
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<div align="center">
|
||||
<b>如果这个项目对您有帮助,请不要忘记给我们一个 ⭐Star!</b>
|
||||
</div>
|
||||
+52
-31
@@ -3,19 +3,19 @@
|
||||
|
||||
# Lophine
|
||||
|
||||
*Lophine is a Folia fork with many useful optimizations and configurable vanilla features, aims to provide more function for survival-usable circuit on folia (Please note that Fabric should be used for complete survival-usable)*
|
||||
*Lophine is a Luminol fork with many useful optimizations and configurable vanilla features, aims to provide more function for survival-usable circuit on folia (Please note that Fabric should be used for complete survival-usable)*
|
||||
|
||||

|
||||
[](LICENSE.md)
|
||||
[](https://github.com/LophineLabs/Lophine/issues)
|
||||

|
||||
[](LICENSE.md)
|
||||
[](https://github.com/LuminolMC/Lophine/issues)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
**English** | [中文(简体)](./README.md) | [中文(繁體)](./README_ZH_TW.md)
|
||||
**English** | [中文](./README.md)
|
||||
</div>
|
||||
|
||||
---
|
||||
@@ -29,15 +29,10 @@
|
||||
- 🔬 **Redstone Enhancement** - More redstone functionality on Folia (use Fabric for complete redstone features)
|
||||
- 🛠️ **More Useful Functions** - Continuously adding useful server features
|
||||
|
||||
### Additional Launch Parameters
|
||||
|
||||
- morninggloryclip.useMojangSource - Use Mojang's source for Minecraft Server
|
||||
- morninggloryclip.enable.mixin - Enable mixin support for Leaves Plugin
|
||||
|
||||
## 📥 Download
|
||||
|
||||
### Stable Releases
|
||||
All release versions can be found on the [Releases](https://github.com/LophineLabs/Lophine/releases) page.
|
||||
All release versions can be found on the [Releases](https://github.com/LuminolMC/Lophine/releases) page.
|
||||
|
||||
### Development Builds
|
||||
If you want to experience the latest features, you can build it yourself following the steps below.
|
||||
@@ -46,11 +41,11 @@ If you want to experience the latest features, you can build it yourself followi
|
||||
|
||||
```bash
|
||||
# Clone the project
|
||||
git clone https://github.com/LophineLabs/Lophine.git
|
||||
git clone https://github.com/LuminolMC/Lophine.git
|
||||
cd Lophine
|
||||
|
||||
# Apply patches and build Paperclip JAR
|
||||
./gradlew applyAllPatches && ./gradlew createPaperclipJar
|
||||
./gradlew applyAllPatches && ./gradlew createMojmapPaperclipJar
|
||||
```
|
||||
|
||||
After building, you can find the generated JAR file in the `lophine-server/build/libs` directory.
|
||||
@@ -62,16 +57,12 @@ After building, you can find the generated JAR file in the `lophine-server/build
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
url = "https://repo.bacteriawa.com/repository/maven-public/"
|
||||
url = "https://repo.menthamc.org/repository/maven-public/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
||||
compileOnly("fun.bm.lophine:lophine-api:$VERSION")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -80,16 +71,16 @@ java {
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repository</id>
|
||||
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
|
||||
<id>menthamc</id>
|
||||
<url>https://repo.menthamc.org/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fun.bm.lophine</groupId>
|
||||
<artifactId>lophine-api</artifactId>
|
||||
<version>[26.2.build,)</version>
|
||||
<artifactId>luminol-api</artifactId>
|
||||
<version>$VERSION</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -101,13 +92,15 @@ java {
|
||||
|
||||
### Join Our Community
|
||||
|
||||
- **QQ Group**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
|
||||
- **Discord**: [Join Here](https://discord.gg/UXSgPZczcy)
|
||||
- **QQ Group**: [1015048616](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=QML5kIVsniPi1PlZvnjHQT_02EHsZ5Jc&authKey=%2FTCJsZC7JFQ9sxAroPCKuYnlV57Z5fyqp36ewXZk3Sn4iJ9p4MB1JKdc%2FFcX3HOM&noverify=0&group_code=1015048616)
|
||||
- **QQ Channel**: [Join Here](https://pd.qq.com/s/eq9krf9j)
|
||||
- **Telegram**: [Join Here](https://t.me/LuminolMinecraft)
|
||||
- **Discord**: [Join Here](https://discord.gg/Qd7m3V6eDx)
|
||||
|
||||
### Get Help
|
||||
|
||||
- 📋 [Submit Issues](https://github.com/LophineLabs/Lophine/issues)
|
||||
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
|
||||
- 📋 [Submit Issues](https://github.com/LuminolMC/Lophine/issues)
|
||||
- 💬 [GitHub Discussions](https://github.com/LuminolMC/Lophine/discussions)
|
||||
- 📖 [Project Documentation](./docs/)
|
||||
|
||||
## 🐛 Bug Reports
|
||||
@@ -132,6 +125,34 @@ We welcome community contributions! For detailed contribution guidelines, please
|
||||
|
||||

|
||||
|
||||
## 🎉 Special Thanks
|
||||
|
||||
### Project Sponsors
|
||||
|
||||
<div align="center">
|
||||
<b>Thanks to <a href="https://github.com/LegacyLands">LegacyLands</a> for sponsoring this project</b>
|
||||
<br>
|
||||
<i>If you want to develop cross-Folia/non-Folia platform plugins, <a href="https://github.com/LegacyLands/legacy-lands-library/">legacy-lands-library</a> would be a great choice</i>
|
||||
<br><br>
|
||||
<img src="public/image/legacy-lands-logo.png" alt="LegacyLands Logo" width="200">
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ⭐ Give Us a Star!
|
||||
|
||||
> Every free ⭐Star you give is the motivation for our every step forward.
|
||||
|
||||
### Star History
|
||||
|
||||
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&LuminolMC/Lophine&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<div align="center">
|
||||
<b>If this project helps you, please don't forget to give us a ⭐Star!</b>
|
||||
</div>
|
||||
-139
@@ -1,139 +0,0 @@
|
||||
<div align="center">
|
||||
<img src="./public/image/lophine/lophine3.png" alt="Lophine Logo" width="300">
|
||||
|
||||
# Lophine
|
||||
|
||||
*Lophine 是一個基於 Folia 的 fork,具備許多好用的最佳化與可設定的原版特性,目標是在 Folia 上實現更多生電向的內容(完整生電支援請使用 Fabric)*
|
||||
|
||||

|
||||
[](LICENSE.md)
|
||||
[](https://github.com/LophineLabs/Lophine/issues)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
[English](./README_EN.md) | [中文(簡體)](./README.md) | **中文(繁體)**
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ✨ 核心特性
|
||||
|
||||
- 🔧 **可設定的原版特性** - 彈性調整遊戲機制,以符合不同伺服器的需求
|
||||
- 📊 **Tpsbar 支援** - 即時顯示伺服器 TPS 狀態
|
||||
- 🐛 **Folia Bug 修復** - 針對 Folia 已知問題的專項修復
|
||||
- 💾 **多種存檔格式支援** - 支援 linear 與 b_linear(linear 重新實作)存檔格式
|
||||
- 🔬 **生電功能強化** - 在 Folia 上實現更多生電內容(完整生電請使用 Fabric)
|
||||
- 🛠️ **更多實用功能** - 持續新增有用的伺服器功能
|
||||
|
||||
### 額外啟動參數
|
||||
|
||||
- morninggloryclip.useMojangSource 強制伺服器端使用 Mojang 官方來源下載檔案
|
||||
- morninggloryclip.enable.mixin 為伺服器插件啟用 mixin 支援
|
||||
|
||||
## 📥 下載
|
||||
|
||||
### 穩定版本
|
||||
所有正式發布版本都可以在 [Releases](https://github.com/LophineLabs/Lophine/releases) 頁面找到。
|
||||
|
||||
### 開發版本
|
||||
如果你想搶先體驗最新功能,可以照下面的步驟自行建置。
|
||||
|
||||
### 建置步驟
|
||||
|
||||
```bash
|
||||
# Clone 這個專案
|
||||
git clone https://github.com/LophineLabs/Lophine.git
|
||||
cd Lophine
|
||||
|
||||
# 套用 patch 並建置 Paperclip JAR
|
||||
./gradlew applyAllPatches && ./gradlew createPaperclipJar
|
||||
```
|
||||
|
||||
建置完成後,你可以在 `lophine-server/build/libs` 目錄中找到產生的 JAR 檔案。
|
||||
|
||||
## 🔌 API 使用
|
||||
|
||||
### Gradle 設定
|
||||
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
url = "https://repo.bacteriawa.com/repository/maven-public/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
||||
}
|
||||
```
|
||||
|
||||
### Maven 設定
|
||||
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repository</id>
|
||||
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fun.bm.lophine</groupId>
|
||||
<artifactId>lophine-api</artifactId>
|
||||
<version>[26.2.build,)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
## 💬 社群與支援
|
||||
|
||||
> 如果你對這個專案有興趣,或有任何問題,歡迎隨時來問我們。
|
||||
|
||||
### 加入我們的社群
|
||||
|
||||
- **QQ 群**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
|
||||
- **Discord**: [點我加入](https://discord.gg/UXSgPZczcy)
|
||||
|
||||
### 取得協助
|
||||
|
||||
- 📋 [提交 Issue](https://github.com/LophineLabs/Lophine/issues)
|
||||
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
|
||||
- 📖 [專案文件](./docs/)
|
||||
|
||||
## 🐛 問題回報
|
||||
|
||||
當你遇到任何問題時,歡迎來問我們,我們會盡力協助解決。請記得:
|
||||
|
||||
- 📝 **清楚描述問題** - 詳細說明問題的具體狀況
|
||||
- 📋 **提供完整記錄檔** - 附上錯誤記錄與相關設定資訊
|
||||
- 🔍 **環境資訊** - 說明伺服器版本、插件清單等環境細節
|
||||
- 🔄 **重現步驟** - 如果可以,請提供重現問題的具體步驟
|
||||
|
||||
## 🤝 貢獻程式碼
|
||||
|
||||
我們歡迎社群貢獻!詳細的貢獻指南請參考:
|
||||
|
||||
- 📖 [貢獻指南(English)](./docs/CONTRIBUTING_EN.md)
|
||||
- 📖 [貢獻指南(簡體中文)](./docs/CONTRIBUTING.md)
|
||||
- 📖 [貢獻指南(繁體中文)](./docs/CONTRIBUTING_ZH_TW.md)
|
||||
- 📖 [貢獻指南(日本語)](./docs/CONTRIBUTING_JP.md)
|
||||
|
||||
## 📊 專案統計
|
||||
|
||||
### BStats 資料
|
||||
|
||||

|
||||
|
||||
## ⭐ 給我們一個 Star 吧!
|
||||
|
||||
> 你給的每一個免費 ⭐Star,都是我們前進的動力。
|
||||
+17
-108
@@ -1,27 +1,26 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java // TODO java launcher tasks
|
||||
id("fun.bm.comfreyweight.patcher")
|
||||
id("moe.luminolmc.hyacinthusweight.patcher")
|
||||
}
|
||||
|
||||
paperweight {
|
||||
filterPatches = false
|
||||
upstreams.register("folia") {
|
||||
repo = github("PaperMC", "Folia")
|
||||
ref = providers.gradleProperty("foliaRef")
|
||||
upstreams.register("luminol") {
|
||||
repo = github("LuminolMC", "Luminol")
|
||||
ref = providers.gradleProperty("luminolRef")
|
||||
|
||||
println("Upstream commit ref: " + ref.get())
|
||||
|
||||
patchFile {
|
||||
path = "folia-server/build.gradle.kts"
|
||||
path = "luminol-server/build.gradle.kts"
|
||||
outputFile = file("lophine-server/build.gradle.kts")
|
||||
patchFile = file("lophine-server/build.gradle.kts.patch")
|
||||
}
|
||||
patchFile {
|
||||
path = "folia-api/build.gradle.kts"
|
||||
path = "luminol-api/build.gradle.kts"
|
||||
outputFile = file("lophine-api/build.gradle.kts")
|
||||
patchFile = file("lophine-api/build.gradle.kts.patch")
|
||||
}
|
||||
@@ -30,17 +29,22 @@ paperweight {
|
||||
patchesDir = file("lophine-api/paper-patches")
|
||||
outputDir = file("paper-api")
|
||||
}
|
||||
patchDir("foliaApi") {
|
||||
patchRepo("foliaApi") {
|
||||
upstreamPath = "folia-api"
|
||||
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
|
||||
patchesDir = file("lophine-api/folia-patches")
|
||||
outputDir = file("folia-api")
|
||||
}
|
||||
patchDir("luminolApi") {
|
||||
upstreamPath = "luminol-api"
|
||||
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
|
||||
patchesDir = file("lophine-api/luminol-patches")
|
||||
outputDir = file("luminol-api")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
val bacteriawaMavenPublicUrl = "https://repo.bacteriawa.com/repository/maven-public/";
|
||||
val menthaMavenPublicUrl = "https://repo.menthamc.org/repository/maven-public/";
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
@@ -55,7 +59,7 @@ subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(paperMavenPublicUrl)
|
||||
maven(bacteriawaMavenPublicUrl)
|
||||
maven(menthaMavenPublicUrl)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -87,8 +91,8 @@ subprojects {
|
||||
|
||||
extensions.configure<PublishingExtension> {
|
||||
repositories {
|
||||
maven("https://repo.bacteriawa.com/repository/maven-releases/") {
|
||||
name = "Bacteriawa"
|
||||
maven("https://repo.menthamc.org/repository/maven-snapshots/") {
|
||||
name = "MenthaMC"
|
||||
credentials(PasswordCredentials::class) {
|
||||
username = System.getenv("PRIVATE_MAVEN_REPO_USERNAME")
|
||||
password = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD")
|
||||
@@ -106,98 +110,3 @@ subprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort all JSON language files under the lang directory by key in ASCII order
|
||||
val langDir = layout.projectDirectory.dir("lophine-server/src/main/resources/assets/lophine/lang")
|
||||
tasks.register("sortLangKeys") {
|
||||
group = "lophine"
|
||||
description = "Sort all JSON language files by key in ASCII (ordinal) order"
|
||||
notCompatibleWithConfigurationCache("Inline task action references build script class")
|
||||
inputs.dir(langDir).optional()
|
||||
outputs.dir(langDir)
|
||||
doLast {
|
||||
val dir = langDir.asFile
|
||||
if (!dir.isDirectory) {
|
||||
logger.warn("Lang directory not found: $dir")
|
||||
return@doLast
|
||||
}
|
||||
val jsonFiles = dir.listFiles { f -> f.extension == "json" }?.sortedBy { it.name } ?: emptyList()
|
||||
if (jsonFiles.isEmpty()) {
|
||||
logger.lifecycle("No .json files found in: $dir")
|
||||
return@doLast
|
||||
}
|
||||
val slurper = JsonSlurper()
|
||||
for (file in jsonFiles) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val data = slurper.parse(file) as Map<String, Any?>
|
||||
val sorted = data.toSortedMap()
|
||||
val pretty = formatJson(sorted)
|
||||
file.writeText(pretty + "\n", charset = Charsets.UTF_8)
|
||||
logger.lifecycle("Processed: ${file.name} (${sorted.size} keys)")
|
||||
}
|
||||
logger.lifecycle("Done.")
|
||||
}
|
||||
}
|
||||
|
||||
// --- Pure-Kotlin JSON serializer that preserves non-ASCII characters (e.g. CJK) ---
|
||||
fun formatJson(value: Any?, indent: Int = 2): String {
|
||||
val sb = StringBuilder()
|
||||
appendJson(sb, value, indent, 0)
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
private fun appendJson(sb: StringBuilder, value: Any?, indent: Int, level: Int) {
|
||||
when (value) {
|
||||
null -> sb.append("null")
|
||||
is Boolean -> sb.append(value)
|
||||
is Number -> sb.append(value)
|
||||
is String -> sb.append('"').append(escapeJsonString(value)).append('"')
|
||||
is List<*> -> {
|
||||
if (value.isEmpty()) { sb.append("[]"); return }
|
||||
sb.append("[\n")
|
||||
value.forEachIndexed { i, v ->
|
||||
sb.append(" ".repeat(indent * (level + 1)))
|
||||
appendJson(sb, v, indent, level + 1)
|
||||
if (i < value.size - 1) sb.append(',')
|
||||
sb.append('\n')
|
||||
}
|
||||
sb.append(" ".repeat(indent * level)).append(']')
|
||||
}
|
||||
is Map<*, *> -> {
|
||||
if (value.isEmpty()) { sb.append("{}"); return }
|
||||
sb.append("{\n")
|
||||
val entries = value.entries.toList()
|
||||
entries.forEachIndexed { i, (k, v) ->
|
||||
sb.append(" ".repeat(indent * (level + 1)))
|
||||
sb.append('"').append(escapeJsonString(k.toString())).append('"')
|
||||
sb.append(": ")
|
||||
appendJson(sb, v, indent, level + 1)
|
||||
if (i < entries.size - 1) sb.append(',')
|
||||
sb.append('\n')
|
||||
}
|
||||
sb.append(" ".repeat(indent * level)).append('}')
|
||||
}
|
||||
else -> sb.append('"').append(escapeJsonString(value.toString())).append('"')
|
||||
}
|
||||
}
|
||||
|
||||
private fun escapeJsonString(s: String): String {
|
||||
val sb = StringBuilder(s.length)
|
||||
for (c in s) {
|
||||
when (c) {
|
||||
'"' -> sb.append("\\\"")
|
||||
'\\' -> sb.append("\\\\")
|
||||
'\b' -> sb.append("\\b")
|
||||
'\u000C' -> sb.append("\\f")
|
||||
'\n' -> sb.append("\\n")
|
||||
'\r' -> sb.append("\\r")
|
||||
'\t' -> sb.append("\\t")
|
||||
else -> if (c.code < 0x20) {
|
||||
sb.append("\\u").append(String.format("%04x", c.code))
|
||||
} else {
|
||||
sb.append(c) // preserve CJK and all other printable chars as-is
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
+6
-14
@@ -1,7 +1,7 @@
|
||||
为Lophine贡献代码
|
||||
===============
|
||||
|
||||
[English](./CONTRIBUTING_EN.md) | **中文(简体)** | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | [日本語](./CONTRIBUTING_JP.md)
|
||||
[English](./CONTRIBUTING_EN.md) | **中文**
|
||||
|
||||
我们很开心您想为我们的项目做出贡献!一般来说,我们对PR的审核是十分宽松的;
|
||||
但是如果您可以遵守下列的规则,我们可以更快地完成审核。
|
||||
@@ -21,7 +21,7 @@
|
||||
在开始开发之前,您首先需要拥有以下软件作为开发环境:
|
||||
|
||||
- `git`
|
||||
- `JDK 25 或更高版本`
|
||||
- `JDK 21 或更高版本`
|
||||
|
||||
特别提醒:在操作前,您需要启用系统和Git的长路径支持,以下为部分平台的相关描述。
|
||||
|
||||
@@ -41,7 +41,7 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
|
||||
1. 将你的仓库 clone 到本地;
|
||||
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`;
|
||||
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api` 和 `lophine-server` , `folia-api` 和 `folia-server` , 以及 `paper-api` 和 `paper-server`(下文称作 `*-api` 和 `*-server` );
|
||||
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api` 和 `lophine-server` , `luminol-api` 和 `luminol-server` , `folia-api` 和 `folia-server` , 以及 `paper-api` 和 `paper-server`(下文称作 `*-api` 和 `*-server` );
|
||||
4. 进入 仓库根目录下的 `*-api` 和 `*-server` 文件夹进行修改。
|
||||
|
||||
以下为对上述各个文件夹的简单描述,详细描述可以参考[这里](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
|
||||
@@ -49,12 +49,14 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
1. API部分
|
||||
|
||||
- `lophine-api` :对新增API的修改
|
||||
- `luminol-api` :对luminol-API的修改应当在此文件夹下进行
|
||||
- `folia-api` :对folia-API的修改应当在此文件夹下进行
|
||||
- `paper-api` :对paper-API/spigot-API/bukkit-API的修改应该在此文件夹下进行
|
||||
|
||||
2. Server部分
|
||||
|
||||
- `lophine-server` :对Minecraft原版服务器的修改和新增文件应当在此文件夹下进行
|
||||
- `luminol-server` :对luminol-server的修改应当在此文件夹下进行
|
||||
- `folia-server` :对folia-Server的修改应当在此文件夹下进行
|
||||
- `paper-server` :对于paper对服务器逻辑的修改应当在此文件夹下进行
|
||||
|
||||
@@ -62,7 +64,7 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
|
||||
- 在应用补丁前,基点将会指向未被更改的源码
|
||||
- 在基点后的每一个提交都是一个补丁
|
||||
- 只有在 Folia 最后一个提交后的提交才会被视为 lophine 补丁
|
||||
- 只有在 Luminol 最后一个提交后的提交才会被视为 lophine 补丁
|
||||
|
||||
## 增加补丁
|
||||
|
||||
@@ -88,13 +90,3 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在lophine新建文件的补丁(注意不要提交);
|
||||
5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
|
||||
6. 将修改后的补丁 PR 发回储存库。
|
||||
|
||||
## 为配置项提供本地化的注释支持
|
||||
|
||||
1. 在 `lophine-server/src/main/resources/assets/lophine/lang` 目录下创建或修改相应的语言文件,添加本地化的注释;
|
||||
- 文件的名字应当符合 `https://minecraft.wiki/w/Language` 页面下的格式,如 `en_us` `zh_cn` `zh_hk` `zh_tw`,文件以 `json` 为格式类型;
|
||||
2. 运行 Gradle 任务 `sortLangKeys` 来对你的语言文件内容进行重排序;
|
||||
3. 使用 `git commit -m <提交信息>` 进行提交;
|
||||
4. 将你修改的文件进行推送。
|
||||
|
||||
这样做以后,你就可以将你的修改进行 PR 提交。
|
||||
|
||||
+6
-14
@@ -1,7 +1,7 @@
|
||||
Contributing to Lophine
|
||||
=======================
|
||||
|
||||
**English** | [中文(简体)](./CONTRIBUTING.md) | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | [日本語](./CONTRIBUTING_JP.md)
|
||||
**English** | [中文](./CONTRIBUTING.md)
|
||||
|
||||
We're glad that you want to contribute to our project!
|
||||
In general, our review of pull requests is very lenient.
|
||||
@@ -23,7 +23,7 @@ See also [This issue](https://github.com/isaacs/github/issues/1681), and then yo
|
||||
Before coding, you need these pieces of software / tools as Dev Environment.
|
||||
|
||||
- `git`
|
||||
- `JDK 25 or higher`
|
||||
- `JDK 21 or higher`
|
||||
|
||||
PS: You need to enable long path support in your System and Git before start, some of the platform's resolution here.
|
||||
|
||||
@@ -44,7 +44,7 @@ If you have forked the main repository, then you should follow the steps below:
|
||||
|
||||
1. Clone your repository to local
|
||||
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: `lophine-api` and `lophine-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
|
||||
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `lophine-api` and `lophine-server` , `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.
|
||||
|
||||
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):
|
||||
@@ -52,12 +52,14 @@ The following is the simple description of the aforementioned folders, detailed
|
||||
1. API part
|
||||
|
||||
- `lophine-api` : Modifications to the new API
|
||||
- `luminol-api` : Modifications to Luminol API should be carried out in this folder
|
||||
- `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
|
||||
|
||||
- `lophine-server` : Changes and new files to the Minecraft vanilla server should be made in this folder
|
||||
- `luminol-server` : Changes to luminol-server should be made in this folder
|
||||
- `folia-server` : Changes to folia-server should be made in this folder
|
||||
- `paper-server` : Modifications to the server logic for paper should be made in this folder
|
||||
|
||||
@@ -65,7 +67,7 @@ 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 Folia will be considered as Lophine patches.
|
||||
- Only commits after the last commit of Luminol will be considered as Lophine patches.
|
||||
|
||||
## Adding new patches
|
||||
|
||||
@@ -91,13 +93,3 @@ You can modify an existing patch by following the steps below:
|
||||
4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate lophine-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
|
||||
|
||||
## Providing localized comment support for configuration entries
|
||||
|
||||
1. Create or modify the corresponding language file under the `lophine-server/src/main/resources/assets/lophine/lang` directory to add localized comments;
|
||||
- The file name should follow the format listed on the `https://minecraft.wiki/w/Language` page, such as `en_us`, `zh_cn`, `zh_hk`, `zh_tw`. The file format is `json`;
|
||||
2. Run the Gradle task `sortLangKeys` to re-sort the keys in your language file;
|
||||
3. Commit your changes using `git commit -m <Commit Message>`;
|
||||
4. Push your modified files to your repository.
|
||||
|
||||
After pushing, you can open a PR to submit your changes.
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
Lophine への貢献
|
||||
===============
|
||||
|
||||
[English](./CONTRIBUTING_EN.md) | [中文(簡體)](./CONTRIBUTING.md) | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | **日本語**
|
||||
|
||||
Lophine プロジェクトに貢献していただき、ありがとうございます!一般的に、PR(プルリクエスト)のレビュー基準は比較的緩やかです。
|
||||
以下のルールに従っていただければ、よりスムーズにレビューを進めることができます。
|
||||
|
||||
## 個人アカウントでフォークしてください
|
||||
|
||||
定期的に既存の PR をマージしています。軽微な問題であれば、こちらで直接修正したうえでマージする場合があります。
|
||||
|
||||
しかし、組織(Organization)アカウントでフォークしたリポジトリから作成された PR の場合、直接変更を加えることができないため、一度クローズしてから手動で再マージする必要が生じます。
|
||||
|
||||
そのため、**組織アカウントを使用してこのプロジェクトをフォークしないでください**。
|
||||
|
||||
組織アカウントの PR に直接変更を加えられない理由については、[こちらの Issue](https://github.com/isaacs/github/issues/1681) をご参照ください。
|
||||
|
||||
## 開発環境
|
||||
|
||||
コードを書き始める前に、以下の開発ツールと環境を準備する必要があります。
|
||||
|
||||
- `git`
|
||||
- `JDK 25` またはそれ以降のバージョン
|
||||
|
||||
注意: 作業を開始する前に、OS および Git で長いパス(Long Path)のサポートを有効にしてください。一部のプラットフォームの設定手順は以下をご参照ください。
|
||||
|
||||
[`Windows`](https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation)
|
||||
[`Git for Windows`](https://gitforwindows.org/faq.html#i-get-errors-trying-to-check-out-files-with-long-path-names)
|
||||
|
||||
## パッチ(Patch)システムについて
|
||||
|
||||
Lophine は Folia と同じパッチシステムを採用しており、修正箇所に応じて以下の 2 つのディレクトリに分かれています。
|
||||
|
||||
- `lophine-api` - `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` をベースにした修正。
|
||||
- `lophine-server` - Minecraft のバニラサーバーの既存ロジックに対する修正。
|
||||
|
||||
このパッチシステムは Git をベースに動作します。Git の基本操作についてはこちらをご覧ください:<https://git-scm.com/docs/gittutorial>
|
||||
|
||||
メインのリポジトリをフォークしたら、以下の手順に従って操作してください:
|
||||
|
||||
1. フォークしたリポジトリをローカルにクローンします。
|
||||
2. お使いの IDE またはターミナルで Gradle の `applyAllPatches` タスクを実行します。ターミナルで行う場合は、直接 `./gradlew applyAllPatches` を実行できます。
|
||||
3. 実行が完了すると、リポジトリのルートディレクトリに `lophine-api` と `lophine-server`、`folia-api` と `folia-server`、`paper-api` と `paper-server` の各ディレクトリが生成されます。
|
||||
4. リポジトリのルートディレクトリ下にある対応する `*-api` と `*-server` フォルダに移動し、そこで修正を行います。
|
||||
|
||||
上記各フォルダの簡単な説明は以下の通りです。より詳細な説明は[こちら](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md)をご参照ください:
|
||||
|
||||
1. API 部分
|
||||
|
||||
- `lophine-api`:新規 API の追加や変更はここで行ってください。
|
||||
- `folia-api`:Folia API に対する修正はここで行ってください。
|
||||
- `paper-api`:Paper API / Spigot API / Bukkit API に対する修正はここで行ってください。
|
||||
|
||||
2. Server 部分
|
||||
|
||||
- `lophine-server`:Minecraft のバニラサーバーに対する修正、および新規作成したファイルはすべてこのフォルダに配置してください。
|
||||
- `folia-server`:Folia Server に対する修正はここで行ってください。
|
||||
- `paper-server`:Paper サーバーのロジックに基づく修正はここで行ってください。
|
||||
|
||||
なお、リポジトリのルートディレクトリにある `*-api` と `*-server` は通常の Git リポジトリではありません:
|
||||
|
||||
- パッチを適用する前は、ベース(Base)は未修正のソースコードを指しています。
|
||||
- ベース以降のすべてのコミットが、1 つのパッチとして扱われます。
|
||||
- Folia の最後のコミット以降に追加されたコミットのみが、Lophine のパッチとして扱われます。
|
||||
|
||||
## 新規パッチの追加
|
||||
|
||||
新しいパッチを追加するのは非常に簡単です。以下の手順に従ってください:
|
||||
|
||||
1. `*-api` と `*-server` 内でコードを変更します。
|
||||
2. Git を使用して変更をステージングエリアに追加します(例:`git add .`。新しく作成したファイルを同時に追加しないでください)。
|
||||
3. `git commit -m <コミットメッセージ>` を実行してコミットします。
|
||||
4. Gradle タスク `fixupPaperApiFilePatches` を実行し、新しく作成されたファイルに対応するパッチファイルを生成します(注意:実行が完了する前にコミットしないでください)。
|
||||
5. Gradle タスク `rebuildAllServerPatches` を実行し、コミットをパッチに変換します。
|
||||
6. 生成されたパッチファイルを Git にコミットし、プッシュします。
|
||||
|
||||
上記の手順が完了したら、これらのパッチファイルを元に PR を作成して提出できます。
|
||||
|
||||
## パッチの修正
|
||||
|
||||
既存のパッチを修正する場合は、以下の手順に従ってください:
|
||||
|
||||
1. HEAD で直接修正を行います。
|
||||
2. `git commit -a --fixup <hash>` を実行して、fixup コミットを作成します(Lophine で新しく作成したファイルの変更を一緒にコミットしないでください)。
|
||||
- コミットメッセージも同時に変更したい場合は、`--fixup` の代わりに `--squash` を使用してください。
|
||||
3. `git rebase -i --autosquash base` を実行して、fixup コミットを自動的にまとめます。エディタが開いたら、`:q` と入力して終了します。
|
||||
4. Gradle タスク `fixupPaperApiFilePatches` を実行し、Lophine で新しく作成したファイルのパッチを再生成します(注意:実行が完了する前にコミットしないでください)。
|
||||
5. Gradle タスク `rebuildAllServerPatches` を実行し、修正を既存のパッチに反映させます。
|
||||
6. 修正したパッチを再度プッシュし、PR を更新します。
|
||||
|
||||
## 設定項目に対するローカライズされたコメントサポートの提供
|
||||
|
||||
1. `lophine-server/src/main/resources/assets/lophine/lang` ディレクトリ下に、対応する言語のファイルを作成または修正し、各言語に対応したコメントを追加します。
|
||||
- ファイル名は <https://minecraft.wiki/w/Language> ページに記載されている言語コード(例:`en_us`、`zh_cn`、`zh_hk`、`zh_tw`、`ja_jp` など)に従って命名してください。ファイル形式は `json` です。
|
||||
2. Gradle タスク `sortLangKeys` を実行し、修正した言語ファイルのキーの内容を並べ替えます。
|
||||
3. `git commit -m <コミットメッセージ>` を実行してコミットします。
|
||||
4. 修正したファイルをプッシュします。
|
||||
|
||||
上記の手順が完了したら、修正した内容を元に PR を作成して提出できます。
|
||||
@@ -1,100 +0,0 @@
|
||||
為 Lophine 貢獻程式碼
|
||||
===============
|
||||
|
||||
[English](./CONTRIBUTING_EN.md) | [中文(簡體)](./CONTRIBUTING.md) | **中文(繁體)** | [日本語](./CONTRIBUTING_JP.md)
|
||||
|
||||
很高興你願意為這個專案貢獻!一般來說,我們對 PR 的審核標準相當寬鬆;
|
||||
如果你可以照著下面的規則來,我們就能更快完成審核。
|
||||
|
||||
## 請使用個人帳號進行 Fork
|
||||
|
||||
我們會定期嘗試合併現有的 PR,如果內容有一些小問題,我們會直接幫你修改後合併。
|
||||
|
||||
但如果你的 PR 是用組織(organization)帳號 fork 出來的,我們就沒辦法直接修改你的 PR,只能先關閉、再手動合併一次。
|
||||
|
||||
所以,請不要用組織帳號來 fork 這個專案!
|
||||
|
||||
你可以參考[這個 Issue](https://github.com/isaacs/github/issues/1681),了解為什麼我們沒辦法直接修改組織帳號的 PR。
|
||||
|
||||
## 開發環境
|
||||
|
||||
在開始寫程式之前,你需要先準備好以下開發工具與環境:
|
||||
|
||||
- `git`
|
||||
- `JDK 25` 或更新版本
|
||||
|
||||
特別提醒:動手之前,請先在你的作業系統與 Git 裡啟用長路徑(long path)支援,以下是部分平台的設定說明。
|
||||
|
||||
[`Windows`](https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation)
|
||||
[`Git for Windows`](https://gitforwindows.org/faq.html#i-get-errors-trying-to-check-out-files-with-long-path-names)
|
||||
|
||||
## 認識 Patch(補丁)系統
|
||||
|
||||
Lophine 沿用了和 Folia 相同的 patch 系統,並依照修改的部分分成了兩個目錄:
|
||||
|
||||
- `lophine-api` - 基於 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` 所做出的修改。
|
||||
- `lophine-server` - 針對 Minecraft 原版伺服器既有邏輯所做的修改。
|
||||
|
||||
這套 patch 系統是以 git 為基礎運作的,你可以在這裡了解 git 的基本操作:<https://git-scm.com/docs/gittutorial>
|
||||
|
||||
如果你已經 fork 了主要的 repository,接下來請照以下步驟操作:
|
||||
|
||||
1. 把你 fork 出來的 repository clone 到本機;
|
||||
2. 在你的 IDE 或終端機(terminal)裡執行 Gradle 的 `applyAllPatches` 任務;如果是在終端機裡,可以直接執行 `./gradlew applyAllPatches`;
|
||||
3. 執行完成後,repository 的根目錄下應該會出現以下幾組目錄: `lophine-api` 與 `lophine-server`、`folia-api` 與 `folia-server` 以及 `paper-api` 與 `paper-server`(以下統稱為 `*-api` 與 `*-server`);
|
||||
4. 進入 repository 根目錄下對應的 `*-api` 與 `*-server` 資料夾,在裡面進行修改。
|
||||
|
||||
以下是對上述各個資料夾的簡單說明,更詳細的說明可以參考[這裡](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
|
||||
|
||||
1. API 部分
|
||||
|
||||
- `lophine-api`:新增 API 的修改請放在這裡
|
||||
- `folia-api`:針對 Folia API 的修改請放在這個資料夾
|
||||
- `paper-api`:對於 Paper API / Spigot API / Bukkit API 的修改請放在這個資料夾
|
||||
|
||||
2. Server 部分
|
||||
|
||||
- `lophine-server`:針對 Minecraft 原版伺服器的修改、以及新增的檔案,都請放在這個資料夾
|
||||
- `folia-server`:針對 folia-server 的修改請放在這個資料夾
|
||||
- `paper-server`:根據 Paper 伺服器邏輯的修改請放在這個資料夾
|
||||
|
||||
順帶一提,repository 根目錄下的 `*-api` 與 `*-server` 並不是一般的 git repository:
|
||||
|
||||
- 在套用 patch 之前,base(基準點)指向的是未經修改的原始程式碼;
|
||||
- base 之後的每一個 commit,都會被視為一個 patch;
|
||||
- 只有在 Folia 最後一個 commit 之後的 commit,才會被視為是 Lophine 的 patch。
|
||||
|
||||
## 新增 Patch
|
||||
|
||||
依照以下步驟新增一個 patch 非常簡單:
|
||||
|
||||
1. 在 `*-api` 與 `*-server` 裡進行修改;
|
||||
2. 用 git 把你的修改加入暫存區,例如執行 `git add .`(請不要把新建立的檔案一併加入);
|
||||
3. 執行 `git commit -m <提交訊息>` 進行 commit;
|
||||
4. 執行 Gradle 任務 `fixupPaperApiFilePatches`,用於新建立的檔案產生對應的 patch 檔(注意:執行完之前先不要 commit);
|
||||
5. 執行 Gradle 任務 `rebuildAllServerPatches`,用於把你的 commit 轉換成一個 patch;
|
||||
6. 把產生出來的 patch 檔 push 上去。
|
||||
|
||||
完成以上步驟後,你就可以拿這些 patch 檔開 PR 提交了。
|
||||
|
||||
## 修改 Patch
|
||||
|
||||
你可以用以下方法來修改一個既有 patch 的內容:
|
||||
|
||||
1. 直接在 HEAD 上進行修改;
|
||||
2. 執行 `git commit -a --fixup <hash>` ,做一個 fixup commit(請不要把 Lophine 新建立的檔案的修改一併 commit 進去);
|
||||
- 如果你想順便修改 commit 訊息,可以用 `--squash` 取代 `--fixup`。
|
||||
3. 執行 `git rebase -i --autosquash base` ,進行自動 rebase,接著只要輸入 `:q` 關掉確認頁面即可;
|
||||
4. 執行 Gradle 任務 `fixupPaperApiFilePatches`,用於重新產生 Lophine 新建立檔案的 patch(注意:執行完之前先不要 commit);
|
||||
5. 執行 Gradle 任務 `rebuildAllServerPatches`,把修改套用到既有的 patch 上;
|
||||
6. 把修改後的 patch 重新 push 回去,再開一次 PR。
|
||||
|
||||
## 為設定項目提供本地化的注解支援
|
||||
|
||||
1. 在 `lophine-server/src/main/resources/assets/lophine/lang` 目錄下新增或修改對應語言的檔案,加入本地化的注解;
|
||||
- 檔名請依照 <https://minecraft.wiki/w/Language> 頁面上列出的語言代碼來命名,例如 `en_us`、`zh_cn`、`zh_hk`、`zh_tw`,檔案格式為 `json`;
|
||||
2. 執行 Gradle 任務 `sortLangKeys`,把你修改的語言檔內容重新排序;
|
||||
3. 執行 `git commit -m <提交訊息>` 進行 commit;
|
||||
4. 把你修改的檔案 push 上去。
|
||||
|
||||
完成以上步驟後,你就可以拿修改後的內容開 PR 提交了。
|
||||
+7
-7
@@ -1,15 +1,15 @@
|
||||
group=fun.bm.lophine
|
||||
mcVersion=26.2
|
||||
apiVersion=26.2
|
||||
channel=STABLE
|
||||
clipVersion=1.0.1
|
||||
weightVersion=1.0.0
|
||||
mcVersion=26.1.2
|
||||
apiVersion=26.1.2
|
||||
channel=BETA
|
||||
clipVersion=3.0.17
|
||||
weightVersion=2.0.12
|
||||
# true for release, false for skip release, pre for pre-release
|
||||
release=true
|
||||
release=pre
|
||||
# true for push to repo, false for skip push repo, auto for detect by release value
|
||||
pushRepo=auto
|
||||
|
||||
foliaRef=24c5c95dc45e02caff98a97ed6ffee7565523464
|
||||
luminolRef=397a754b718e76edbe1a9d6d583054f885db5fde
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.caching=true
|
||||
|
||||
@@ -1,61 +1,27 @@
|
||||
--- a/folia-api/build.gradle.kts
|
||||
+++ b/folia-api/build.gradle.kts
|
||||
@@ -68,6 +_,7 @@
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
api("com.mojang:brigadier:1.3.10")
|
||||
+ api("io.sentry:sentry:8.0.0-rc.2") // Pufferfish
|
||||
|
||||
// Deprecate bungeecord-chat in favor of adventure
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") {
|
||||
@@ -109,7 +_,7 @@
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.0.3")
|
||||
|
||||
// checkstyle
|
||||
- checkstyle(project(":folia-checkstyle"))
|
||||
+ //checkstyle(project(":folia-checkstyle"))
|
||||
}
|
||||
|
||||
val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath()
|
||||
@@ -123,17 +_,21 @@
|
||||
java {
|
||||
--- a/luminol-api/build.gradle.kts
|
||||
+++ b/luminol-api/build.gradle.kts
|
||||
@@ -104,20 +_,24 @@
|
||||
srcDir(generatedDir)
|
||||
srcDir(file("../paper-api/src/main/java"))
|
||||
+ srcDir(file("../folia-api/src/main/java"))
|
||||
srcDir(file("../folia-api/src/main/java"))
|
||||
+ srcDir(file("../luminol-api/src/main/java"))
|
||||
}
|
||||
resources {
|
||||
srcDir(file("../paper-api/src/main/resources"))
|
||||
+ srcDir(file("../folia-api/src/main/resources"))
|
||||
srcDir(file("../folia-api/src/main/resources"))
|
||||
+ srcDir(file("../luminol-api/src/main/resources"))
|
||||
}
|
||||
}
|
||||
test {
|
||||
java {
|
||||
srcDir(file("../paper-api/src/test/java"))
|
||||
+ srcDir(file("../folia-api/src/test/java"))
|
||||
srcDir(file("../folia-api/src/test/java"))
|
||||
+ srcDir(file("../luminol-api/src/test/java"))
|
||||
}
|
||||
resources {
|
||||
srcDir(file("../paper-api/src/test/resources"))
|
||||
+ srcDir(file("../folia-api/src/test/resources"))
|
||||
srcDir(file("../folia-api/src/test/resources"))
|
||||
+ srcDir(file("../luminol-api/src/test/resources"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,3 +_,19 @@
|
||||
tasks.check {
|
||||
dependsOn(scanJarForBadCalls)
|
||||
}
|
||||
+
|
||||
+// Pufferfish Start
|
||||
+tasks.withType<JavaCompile> {
|
||||
+ val compilerArgs = options.compilerArgs
|
||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||
+}
|
||||
+// Pufferfish End
|
||||
+
|
||||
+// Lophine start - Hide unnecessary warnings
|
||||
+tasks.withType<JavaCompile> {
|
||||
+ val compilerArgs = options.compilerArgs
|
||||
+ compilerArgs.add("-Xlint:-module")
|
||||
+ compilerArgs.add("-Xlint:-removal")
|
||||
+ compilerArgs.add("-Xlint:-dep-ann")
|
||||
+}
|
||||
+// Lophine end
|
||||
|
||||
@@ -5,24 +5,14 @@ Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
index 4e099b584c3435ba1ebce492011d35ae1ac0cdf8..ed558bea1f939ab902d3c45417573fba83307abc 100644
|
||||
index db5e2f10278c20286779362cfdfadb2f42c724e0..c18c0cb45a193883aa12b5d1abe690e95d289f82 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
@@ -17,6 +17,17 @@ public interface ServerBuildInfo {
|
||||
@@ -29,6 +29,7 @@ public interface ServerBuildInfo {
|
||||
*/
|
||||
Key BRAND_PAPER_ID = Key.key("papermc", "paper");
|
||||
Key BRAND_LUMINOL_ID = Key.key("luminolmc", "luminol");
|
||||
// Luminol end
|
||||
+ Key BRAND_LOPHINE_ID = Key.key("luminolmc", "lophine"); // Lophine
|
||||
|
||||
+ // Lophine start
|
||||
+ /**
|
||||
+ * The brand id for folia
|
||||
+ */
|
||||
+ Key BRAND_FOLIA_ID = Key.key("papermc", "folia");
|
||||
+ /**
|
||||
+ * The brand id for Lophine.
|
||||
+ */
|
||||
+ Key BRAND_LOPHINE_ID = Key.key("lophinelabs", "lophine");
|
||||
+ // Lophine end
|
||||
+
|
||||
/**
|
||||
* Gets the {@code ServerBuildInfo}.
|
||||
*
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 14 Jun 2026 18:10:20 +0800
|
||||
Subject: [PATCH] Luminol Config System
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 067d901c69a54c4b6ae5a00488f0dacc5fde7961..209d1968f4bff3b33785fd8bfbeea5ae231e581a 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2774,6 +2774,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
||||
// Paper end - API to check if the server is sleeping
|
||||
+
|
||||
+ // Luminol start - Luminol Config API
|
||||
+ me.earthme.luminol.api.config.LuminolConfigsInstance getLuminolConfigs(String name);
|
||||
+ me.earthme.luminol.api.config.LuminolConfigBuilder getLuminolConfigBuilder();
|
||||
+ // Luminol end - Luminol Config API
|
||||
+
|
||||
// Folia start - region TPS API
|
||||
/**
|
||||
* Gets the TPS from the region which owns the specified location, or {@code null} if no region owns
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Bacteriawa <A3167717663@hotmail.com>
|
||||
Date: Sat, 8 Aug 2026 01:25:33 +0800
|
||||
Subject: [PATCH] KioCG Chunk API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
|
||||
index d873b78f6935a23ff8f6092b80968267b182cc0f..b4323370859dd4d9e86614484cdb9d2e35c45b40 100644
|
||||
--- a/src/main/java/org/bukkit/Chunk.java
|
||||
+++ b/src/main/java/org/bukkit/Chunk.java
|
||||
@@ -392,4 +392,6 @@ public interface Chunk extends PersistentDataHolder {
|
||||
*/
|
||||
UNLOADED;
|
||||
}
|
||||
+
|
||||
+ long getChunkHotAvg(); // KioCG
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 65e83e171ab4c514662b9344e08f7065fa9efaa1..274af6397b5f7c0b6787e2669de80e54858950a2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -4050,4 +4050,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* clearing any fixed pose in the process.
|
||||
*/
|
||||
void unsetFixedPose();
|
||||
+
|
||||
+ long getNearbyChunkHot(); // KioCG
|
||||
}
|
||||
+4
-4
@@ -8,10 +8,10 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index e922a0eefb03db5e33f3306aaea558b6ed61b42a..7120bbea89c1c240b09562c73833f21a9980886f 100644
|
||||
index 8e96326c55510642df01ef15e1a3edb1e81176cb..592a3c59bf5edbc65c7c0472e2382593b7b22086 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -3051,4 +3051,15 @@ public final class Bukkit {
|
||||
@@ -3048,4 +3048,15 @@ public final class Bukkit {
|
||||
return server.getFeatureManager();
|
||||
}
|
||||
// Leaves end - Feature API
|
||||
@@ -28,10 +28,10 @@ index e922a0eefb03db5e33f3306aaea558b6ed61b42a..7120bbea89c1c240b09562c73833f21a
|
||||
+ // Leaves end - Bot API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index c037307f926d64bac3b51a91aa61f63d0357770c..6c91cabdcacf7a9bf6421fbb7d52aa17516100f8 100644
|
||||
index 473b0e02c003d5317ef798c320e5c845124f4e12..978e015e91408503b4ec84ec5b3c5193255ba7db 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2825,4 +2825,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2813,4 +2813,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
double @Nullable [] getRegionTPS(@NotNull World world, int chunkX, int chunkZ);
|
||||
// Folia end - region TPS API
|
||||
@@ -1,45 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 12:22:53 +0800
|
||||
Subject: [PATCH] Disable timings warn msg and commands
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
||||
index 89017af09ce32e7a66014fc3aeb50155921252a5..b862779b48176dd7e67a2f1a3e7f24bc8c84e993 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -147,7 +147,7 @@ public final class Timings {
|
||||
public static void setTimingsEnabled(boolean enabled) {
|
||||
enabled = false; // Folia - region threading - disable timings
|
||||
if (enabled && !warnedAboutDeprecationOnEnable) {
|
||||
- Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
|
||||
+ // Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage())); // Luminol - Disable timings warn msg and commands
|
||||
warnedAboutDeprecationOnEnable = true;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index ad1330d87223dfcf3c9da40aa5ece8c21141f0d6..22edf161ba1ca8c31140e25e8c4fe1503c44dba8 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -34,7 +34,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
final ReloadCommand reload = new ReloadCommand("reload");
|
||||
this.knownCommands.put("bukkit:reload", reload);
|
||||
this.knownCommands.put("bukkit:rl", reload);
|
||||
- register("bukkit", new co.aikar.timings.TimingsCommand("timings"));
|
||||
+ //register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Luminol - Disable timings warn msg and commands
|
||||
}
|
||||
|
||||
public void setFallbackCommands() {
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index 457e75bbecb70ac3da4c21382f97d68de5a00547..cf22ea227f6dcc13702fb5f6f94bba5b6e326b97 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -960,7 +960,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public void useTimings(boolean use) {
|
||||
- co.aikar.timings.Timings.setTimingsEnabled(use); // Paper
|
||||
+ // co.aikar.timings.Timings.setTimingsEnabled(use); // Paper // Luminol - Disable timings warn msg and commands
|
||||
}
|
||||
|
||||
// Paper start
|
||||
+4
-4
@@ -8,10 +8,10 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 7120bbea89c1c240b09562c73833f21a9980886f..b114df0dde2e5bede7bb2956359fdd4ca25ac3da 100644
|
||||
index 592a3c59bf5edbc65c7c0472e2382593b7b22086..838ad878528267b57b69d2938aee0eb6326948eb 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -3062,4 +3062,10 @@ public final class Bukkit {
|
||||
@@ -3059,4 +3059,10 @@ public final class Bukkit {
|
||||
return server.getBotManager();
|
||||
}
|
||||
// Leaves end - Bot API
|
||||
@@ -23,10 +23,10 @@ index 7120bbea89c1c240b09562c73833f21a9980886f..b114df0dde2e5bede7bb2956359fdd4c
|
||||
+ // Leaves end - Photographer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 6c91cabdcacf7a9bf6421fbb7d52aa17516100f8..e6295c4bb86286aa893b55b77ddbfb2f63fdd05c 100644
|
||||
index 978e015e91408503b4ec84ec5b3c5193255ba7db..d054926f6082bba7d0b59e610e5d725ff5f9ffa4 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2834,4 +2834,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2822,4 +2822,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull org.leavesmc.leaves.entity.bot.BotManager getBotManager();
|
||||
// Leaves end - Bot API
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Thu, 23 Jan 2025 12:04:04 +0800
|
||||
Subject: [PATCH] Force disable reload command
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index 22edf161ba1ca8c31140e25e8c4fe1503c44dba8..50384eb221ad96e766b91335ff57b082410885e9 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -31,9 +31,9 @@ public class SimpleCommandMap implements CommandMap {
|
||||
}
|
||||
|
||||
private void setDefaultCommands() {
|
||||
- final ReloadCommand reload = new ReloadCommand("reload");
|
||||
- this.knownCommands.put("bukkit:reload", reload);
|
||||
- this.knownCommands.put("bukkit:rl", reload);
|
||||
+ //final ReloadCommand reload = new ReloadCommand("reload"); // Luminol - Force disable reload command
|
||||
+ //this.knownCommands.put("bukkit:reload", reload); // Luminol - Force disable reload command
|
||||
+ //this.knownCommands.put("bukkit:rl", reload); // Luminol - Force disable reload command
|
||||
//register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Luminol - Disable timings warn msg and commands
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 13:27:38 +0800
|
||||
Subject: [PATCH] Pufferfish: Sentry
|
||||
|
||||
As part of: Pufferfish
|
||||
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index cf22ea227f6dcc13702fb5f6f94bba5b6e326b97..71ef6055df30506bb0d6648a2300d1cab7b0d026 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -596,7 +596,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
// Paper start
|
||||
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, msg, ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
|
||||
}
|
||||
// Paper end
|
||||
@@ -666,9 +668,11 @@ public final class SimplePluginManager implements PluginManager {
|
||||
));
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
|
||||
// Paper start - error reporting
|
||||
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
|
||||
server.getLogger().log(Level.SEVERE, msg, ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
|
||||
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
|
||||
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
index 9023a39c6481710478747482f0b16c21274afd15..0755065f86aba3ef5ecdf045620878eb045f4999 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
@@ -329,7 +329,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
try {
|
||||
jPlugin.setEnabled(true);
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
+ // Paper start - Disable plugins that fail to load
|
||||
+ this.server.getPluginManager().disablePlugin(jPlugin);
|
||||
+ return;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
// Perhaps abort here, rather than continue going, but as it stands,
|
||||
@@ -354,7 +360,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
try {
|
||||
jPlugin.setEnabled(false);
|
||||
} catch (Throwable ex) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
|
||||
server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
|
||||
}
|
||||
|
||||
if (cloader instanceof PluginClassLoader) {
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 14:00:28 +0800
|
||||
Subject: [PATCH] Pufferfish: SIMD Utilities
|
||||
|
||||
As part of: Pufferfish
|
||||
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
index 76ae2750ff7b04a281d4b794dc1f48dd832db2b6..fc9cd106b1ed2e92aced783e9cb0bc8867828df3 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
@@ -35,7 +35,7 @@ public final class MapPalette {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
- static final Color[] colors = {
|
||||
+ public static final Color[] colors = { // Luminol - package-private -> public
|
||||
// Start generate - MapPalette#colors
|
||||
new Color(0x00000000, true),
|
||||
new Color(0x00000000, true),
|
||||
@@ -394,9 +394,11 @@ public final class MapPalette {
|
||||
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
|
||||
|
||||
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
|
||||
+ if ((mapColorCache != null && mapColorCache.isCached()) || !gg.pufferfish.pufferfish.simd.SIMDDetection.isEnabled) { // Luminol - Pufferfish - vectorized map color conversion
|
||||
for (int i = 0; i < pixels.length; i++) {
|
||||
result[i] = matchColor(new Color(pixels[i], true));
|
||||
}
|
||||
+ } else gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result); // Luminol - Pufferfish - vectorized map color conversion
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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:59 +0800
|
||||
Subject: [PATCH] Tick regions api
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index bf2f7c4959f9f2cd43bbd4d4310e7eedf10cf892..bccb33456d84384bd90887822e16cbad65986106 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4719,4 +4719,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Luminol start - Tick regions api
|
||||
+ me.earthme.luminol.api.ThreadedRegionizer getThreadedRegionizer();
|
||||
+ // Luminol end - Tick regions api
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 22 Apr 2026 12:59:08 +0800
|
||||
Subject: [PATCH] Leaves: Leaves plugin
|
||||
|
||||
Co-authored by: MC_XiaoHei <xiaohei.xor7@outlook.com>
|
||||
As part of: Leaves (https://github.com/HyacinthHaru/Leaves/blob/90080d238e2fcfc14a9293150dc351a4f0f696e6/leaves-api/paper-patches/features/0009-Leaves-Plugin.patch)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 325d797766de527268eb18bcf9db594ca3a0c519..e922a0eefb03db5e33f3306aaea558b6ed61b42a 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -3045,4 +3045,10 @@ public final class Bukkit {
|
||||
public static void restart() {
|
||||
server.restart();
|
||||
}
|
||||
+
|
||||
+ // Leaves start - Feature API
|
||||
+ public static org.leavesmc.leaves.plugin.FeatureManager getFeatureManager() {
|
||||
+ return server.getFeatureManager();
|
||||
+ }
|
||||
+ // Leaves end - Feature API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 209d1968f4bff3b33785fd8bfbeea5ae231e581a..ac19fd1b6b8e48313c79d9fb26c3df50f67b64b8 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2780,6 +2780,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
me.earthme.luminol.api.config.LuminolConfigBuilder getLuminolConfigBuilder();
|
||||
// Luminol end - Luminol Config API
|
||||
|
||||
+ // Leaves start - Feature API
|
||||
+ org.leavesmc.leaves.plugin.FeatureManager getFeatureManager();
|
||||
+ // Leaves End - Feature API
|
||||
+
|
||||
// Folia start - region TPS API
|
||||
/**
|
||||
* Gets the TPS from the region which owns the specified location, or {@code null} if no region owns
|
||||
@@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Thu, 12 Jun 2025 08:00:15 +0800
|
||||
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/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index a2024b5dda030a7724c13b2446224903ae837339..71f34a40b136f7f08a4820056c00692b986f63bd 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -405,4 +405,13 @@ public interface Villager extends AbstractVillager {
|
||||
* Demand is still updated even if all events are canceled.
|
||||
*/
|
||||
public void restock();
|
||||
+ // Purpur start
|
||||
+
|
||||
+ /**
|
||||
+ * Check if villager is currently lobotomized
|
||||
+ *
|
||||
+ * @return True if lobotomized
|
||||
+ */
|
||||
+ boolean isLobotomized();
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 5 Jun 2026 09:12:20 +0800
|
||||
Subject: [PATCH] World load/unload APIs
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index ac19fd1b6b8e48313c79d9fb26c3df50f67b64b8..c037307f926d64bac3b51a91aa61f63d0357770c 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -775,6 +775,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
* @throws IllegalStateException when {@link #isTickingWorlds() isTickingWorlds} is true
|
||||
*/
|
||||
public boolean unloadWorld(@NotNull World world, boolean save);
|
||||
+ // Luminol start - Async world unloading api
|
||||
+
|
||||
+ /**
|
||||
+ * Unloads the given world asynchronously
|
||||
+ *
|
||||
+ * @param world the world to unload
|
||||
+ * @param save whether to save the chunks before unloading
|
||||
+ * @param callback the callback to accept the result, true if successful, false otherwise
|
||||
+ */
|
||||
+ public void unloadWorld(World world, boolean save, java.util.concurrent.CompletableFuture<Boolean> callback);
|
||||
+ // Luminol end
|
||||
|
||||
/**
|
||||
* Gets the world that players respawn in.
|
||||
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
*
|
||||
* Pufferfish is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Pufferfish 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package gg.pufferfish.pufferfish.sentry;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.logging.log4j.ThreadContext;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredListener;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class SentryContext {
|
||||
|
||||
private static final Gson GSON = new Gson();
|
||||
|
||||
public static void setPluginContext(@Nullable Plugin plugin) {
|
||||
if (plugin != null) {
|
||||
ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
|
||||
ThreadContext.put("pufferfishsentry_pluginversion", plugin.getPluginMeta().getVersion());
|
||||
}
|
||||
}
|
||||
|
||||
public static void removePluginContext() {
|
||||
ThreadContext.remove("pufferfishsentry_pluginname");
|
||||
ThreadContext.remove("pufferfishsentry_pluginversion");
|
||||
}
|
||||
|
||||
public static void setSenderContext(@Nullable CommandSender sender) {
|
||||
if (sender != null) {
|
||||
ThreadContext.put("pufferfishsentry_playername", sender.getName());
|
||||
if (sender instanceof Player player) {
|
||||
ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeSenderContext() {
|
||||
ThreadContext.remove("pufferfishsentry_playername");
|
||||
ThreadContext.remove("pufferfishsentry_playerid");
|
||||
}
|
||||
|
||||
public static void setEventContext(Event event, RegisteredListener registration) {
|
||||
setPluginContext(registration.getPlugin());
|
||||
|
||||
try {
|
||||
// Find the player that was involved with this event
|
||||
Player player = null;
|
||||
if (event instanceof PlayerEvent) {
|
||||
player = ((PlayerEvent) event).getPlayer();
|
||||
} else {
|
||||
Class<? extends Event> eventClass = event.getClass();
|
||||
|
||||
Field playerField = null;
|
||||
|
||||
for (Field field : eventClass.getDeclaredFields()) {
|
||||
if (field.getType().equals(Player.class)) {
|
||||
playerField = field;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (playerField != null) {
|
||||
playerField.setAccessible(true);
|
||||
player = (Player) playerField.get(event);
|
||||
}
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
setSenderContext(player);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} // We can't really safely log exceptions.
|
||||
|
||||
ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
|
||||
}
|
||||
|
||||
public static void removeEventContext() {
|
||||
removePluginContext();
|
||||
removeSenderContext();
|
||||
ThreadContext.remove("pufferfishsentry_eventdata");
|
||||
}
|
||||
|
||||
private static Map<String, String> serializeFields(Object object) {
|
||||
Map<String, String> fields = new TreeMap<>();
|
||||
fields.put("_class", object.getClass().getName());
|
||||
for (Field declaredField : object.getClass().getDeclaredFields()) {
|
||||
try {
|
||||
if (Modifier.isStatic(declaredField.getModifiers())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String fieldName = declaredField.getName();
|
||||
if (fieldName.equals("handlers")) {
|
||||
continue;
|
||||
}
|
||||
declaredField.setAccessible(true);
|
||||
Object value = declaredField.get(object);
|
||||
if (value != null) {
|
||||
fields.put(fieldName, value.toString());
|
||||
} else {
|
||||
fields.put(fieldName, "<null>");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
} // We can't really safely log exceptions.
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
public static class State {
|
||||
|
||||
private Plugin plugin;
|
||||
private Command command;
|
||||
private String commandLine;
|
||||
private Event event;
|
||||
private RegisteredListener registeredListener;
|
||||
|
||||
public Plugin getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public Command getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
public void setCommand(Command command) {
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
public String getCommandLine() {
|
||||
return commandLine;
|
||||
}
|
||||
|
||||
public void setCommandLine(String commandLine) {
|
||||
this.commandLine = commandLine;
|
||||
}
|
||||
|
||||
public Event getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
public void setEvent(Event event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public RegisteredListener getRegisteredListener() {
|
||||
return registeredListener;
|
||||
}
|
||||
|
||||
public void setRegisteredListener(RegisteredListener registeredListener) {
|
||||
this.registeredListener = registeredListener;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
*
|
||||
* Pufferfish is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Pufferfish 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package gg.pufferfish.pufferfish.simd;
|
||||
|
||||
import jdk.incubator.vector.FloatVector;
|
||||
import jdk.incubator.vector.IntVector;
|
||||
import jdk.incubator.vector.VectorSpecies;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* Basically, java is annoying, and we have to push this out to its own class.
|
||||
*/
|
||||
@Deprecated
|
||||
public class SIMDChecker {
|
||||
|
||||
@Deprecated
|
||||
public static boolean canEnable(Logger logger) {
|
||||
try {
|
||||
SIMDDetection.testRun = true;
|
||||
|
||||
VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
|
||||
VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
|
||||
|
||||
logger.info("Max SIMD vector size on this system is {} bits (int)", ISPEC.vectorBitSize());
|
||||
logger.info("Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
|
||||
|
||||
if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
|
||||
logger.warn("SIMD is not properly supported on this system!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (NoClassDefFoundError | Exception ignored) {
|
||||
} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
*
|
||||
* Pufferfish is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Pufferfish 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package gg.pufferfish.pufferfish.simd;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@Deprecated
|
||||
public class SIMDDetection {
|
||||
|
||||
public static boolean isEnabled = false;
|
||||
public static boolean testRun = false;
|
||||
|
||||
@Deprecated
|
||||
public static boolean canEnable(Logger logger) {
|
||||
try {
|
||||
return SIMDChecker.canEnable(logger);
|
||||
} catch (NoClassDefFoundError | Exception ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getJavaVersion() {
|
||||
// https://stackoverflow.com/a/2591122
|
||||
String version = System.getProperty("java.version");
|
||||
if (version.startsWith("1.")) {
|
||||
version = version.substring(2, 3);
|
||||
} else {
|
||||
int dot = version.indexOf(".");
|
||||
if (dot != -1) {
|
||||
version = version.substring(0, dot);
|
||||
}
|
||||
}
|
||||
version = version.split("-")[0]; // Azul is stupid
|
||||
return Integer.parseInt(version);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
*
|
||||
* Pufferfish is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Pufferfish 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package gg.pufferfish.pufferfish.simd;
|
||||
|
||||
import jdk.incubator.vector.FloatVector;
|
||||
import jdk.incubator.vector.IntVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
import jdk.incubator.vector.VectorSpecies;
|
||||
import org.bukkit.map.MapPalette;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@Deprecated
|
||||
public class VectorMapPalette {
|
||||
|
||||
private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
|
||||
private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
|
||||
|
||||
@Deprecated
|
||||
public static void matchColorVectorized(int[] in, byte[] out) {
|
||||
int speciesLength = I_SPEC.length();
|
||||
int i;
|
||||
for (i = 0; i < in.length - speciesLength; i += speciesLength) {
|
||||
float[] redsArr = new float[speciesLength];
|
||||
float[] bluesArr = new float[speciesLength];
|
||||
float[] greensArr = new float[speciesLength];
|
||||
int[] alphasArr = new int[speciesLength];
|
||||
|
||||
for (int j = 0; j < speciesLength; j++) {
|
||||
alphasArr[j] = (in[i + j] >> 24) & 0xFF;
|
||||
redsArr[j] = (in[i + j] >> 16) & 0xFF;
|
||||
greensArr[j] = (in[i + j] >> 8) & 0xFF;
|
||||
bluesArr[j] = (in[i + j] >> 0) & 0xFF;
|
||||
}
|
||||
|
||||
IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
|
||||
FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
|
||||
FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
|
||||
FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
|
||||
IntVector resultIndex = IntVector.zero(I_SPEC);
|
||||
VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
|
||||
|
||||
modificationMask = modificationMask.and(alphas.lt(128).not());
|
||||
FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
|
||||
|
||||
for (int c = 4; c < MapPalette.colors.length; c++) {
|
||||
// We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
|
||||
// For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
|
||||
FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
|
||||
FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
|
||||
FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
|
||||
|
||||
FloatVector rMean = reds.add(compReds).div(2.0f);
|
||||
FloatVector rDiff = reds.sub(compReds);
|
||||
FloatVector gDiff = greens.sub(compGreens);
|
||||
FloatVector bDiff = blues.sub(compBlues);
|
||||
|
||||
FloatVector weightR = rMean.div(256.0f).add(2);
|
||||
FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
|
||||
FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
|
||||
|
||||
FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
|
||||
|
||||
// Now we compare to the best distance we've found.
|
||||
// This mask contains a "1" if better, and a "0" otherwise.
|
||||
VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
|
||||
bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
|
||||
|
||||
// Update the result array
|
||||
// We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
|
||||
resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
|
||||
}
|
||||
|
||||
for (int j = 0; j < speciesLength; j++) {
|
||||
int index = resultIndex.lane(j);
|
||||
out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
|
||||
}
|
||||
}
|
||||
|
||||
// For the final ones, fall back to the regular method
|
||||
for (; i < in.length; i++) {
|
||||
out[i] = MapPalette.matchColor(new Color(in[i], true));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package me.earthme.luminol.api;
|
||||
|
||||
/**
|
||||
* A simple package of folia's tick region state.It linked to the RegionStats of the nms part so that</br>
|
||||
* You could call these methods to get the status of this tick region</br>
|
||||
*/
|
||||
public interface RegionStats {
|
||||
/**
|
||||
* Get the entity count in this tick region
|
||||
*
|
||||
* @return the entity count
|
||||
*/
|
||||
int getEntityCount();
|
||||
|
||||
/**
|
||||
* Get the player count in this tick region
|
||||
*
|
||||
* @return the player count
|
||||
*/
|
||||
int getPlayerCount();
|
||||
|
||||
/**
|
||||
* Get the chunk count in this tick region
|
||||
*
|
||||
* @return the chunk count
|
||||
*/
|
||||
int getChunkCount();
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package me.earthme.luminol.api;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A mirror of folia's ThreadedRegion</br>
|
||||
* Including some handy methods to get the information of the tick region</br>
|
||||
* Note: You should call these methods inside this tick region's thread context
|
||||
*/
|
||||
public interface ThreadedRegion {
|
||||
/**
|
||||
* Get the center chunk pos of this tick region</br>
|
||||
* Note:</br>
|
||||
* 1.Global region will return a null value(But we don't finish the global region yet()</br>
|
||||
* 2.You should call these methods inside this tick region's thread context
|
||||
*
|
||||
* @return The center chunk pos
|
||||
*/
|
||||
@Nullable
|
||||
Location getCenterChunkPos();
|
||||
|
||||
/**
|
||||
* Get the dead section percent of this tick region
|
||||
* Note: </br>
|
||||
* 1.Dead percent is mean the percent of the unloaded chunk count of this tick region, which is also used for determine
|
||||
* that the tick region should or not check for splitting</br>
|
||||
* 2.You should call these methods inside this tick region's thread context
|
||||
*
|
||||
* @return The dead section percent
|
||||
*/
|
||||
double getDeadSectionPercent();
|
||||
|
||||
/**
|
||||
* Get the tick region data of this tick region</br>
|
||||
* Note:</br>
|
||||
* 1.You should call this method inside this tick region's thread context</br>
|
||||
* 2.You should call these methods inside this tick region's thread context
|
||||
*
|
||||
* @return The tick region data
|
||||
*/
|
||||
TickRegionData getTickRegionData();
|
||||
|
||||
/**
|
||||
* Get the world of this tick region</br>
|
||||
* Note: Global region will return a null value too
|
||||
*
|
||||
* @return The world of this tick region
|
||||
*/
|
||||
@Nullable
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* Get the id of the tick region</br>
|
||||
*
|
||||
* @return The id of the tick region
|
||||
*/
|
||||
long getId();
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package me.earthme.luminol.api;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A mirror of folia's ThreadedRegionizer
|
||||
*/
|
||||
public interface ThreadedRegionizer {
|
||||
/**
|
||||
* Get all the tick regions
|
||||
*
|
||||
* @return Temporary copied collection of all tick regions
|
||||
*/
|
||||
Collection<ThreadedRegion> getAllRegions();
|
||||
|
||||
/**
|
||||
* Get the tick region at the given chunk coordinates
|
||||
*
|
||||
* @param chunkX Chunk X
|
||||
* @param chunkZ Chunk Z
|
||||
* @return The tick region at the given chunk coordinates
|
||||
*/
|
||||
@Nullable
|
||||
ThreadedRegion getAtSynchronized(int chunkX, int chunkZ);
|
||||
|
||||
/**
|
||||
* Get the tick region at the given chunk coordinates
|
||||
*
|
||||
* @param chunkX Chunk X
|
||||
* @param chunkZ Chunk Z
|
||||
* @return The tick region at the given chunk coordinates
|
||||
*/
|
||||
@Nullable
|
||||
ThreadedRegion getAtUnSynchronized(int chunkX, int chunkZ);
|
||||
|
||||
/**
|
||||
* Get the tick region at the given location
|
||||
*
|
||||
* @param pos The location
|
||||
* @return The tick region at the given location
|
||||
*/
|
||||
@Nullable
|
||||
default ThreadedRegion getAtSynchronized(@NotNull Location pos) {
|
||||
return this.getAtSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tick region at the given location
|
||||
*
|
||||
* @param pos The location
|
||||
* @return The tick region at the given location
|
||||
*/
|
||||
@Nullable
|
||||
default ThreadedRegion getAtUnSynchronized(@NotNull Location pos) {
|
||||
return this.getAtUnSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package me.earthme.luminol.api;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
/**
|
||||
* A mirror of folia's tick region data
|
||||
*/
|
||||
public interface TickRegionData {
|
||||
/**
|
||||
* Get the world it's currently holding
|
||||
*
|
||||
* @return the world
|
||||
*/
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* Get the current tick count
|
||||
*
|
||||
* @return the current tick count
|
||||
*/
|
||||
long getCurrentTickCount();
|
||||
|
||||
/**
|
||||
* Get the region stats
|
||||
*
|
||||
* @return the region stats
|
||||
*/
|
||||
RegionStats getRegionStats();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package me.earthme.luminol.api.config;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
public record ConfigDataPair(
|
||||
String key,
|
||||
Object value,
|
||||
@Nullable String comment,
|
||||
@Nullable String[] suggestions
|
||||
) {
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package me.earthme.luminol.api.config;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Builder interface for creating {@link LuminolConfigsInstance} instances.
|
||||
* <p>
|
||||
* Provides multiple overloaded factory methods to construct configuration instances
|
||||
* with varying levels of customization, including custom base directories,
|
||||
* file names, and command names.
|
||||
*/
|
||||
public interface LuminolConfigBuilder {
|
||||
/**
|
||||
* Creates a configuration instance using the default base directory and file name.
|
||||
*
|
||||
* @param loader the class loader used to load configuration resources
|
||||
* @param name the configuration name identifier
|
||||
* @param pack the package path where configuration classes are located
|
||||
* @return a new {@link LuminolConfigsInstance}
|
||||
*/
|
||||
LuminolConfigsInstance of(
|
||||
@NotNull ClassLoader loader,
|
||||
@NotNull String name,
|
||||
@NotNull String pack
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates a configuration instance with a custom base directory.
|
||||
*
|
||||
* @param loader the class loader used to load configuration resources
|
||||
* @param base the base directory where the configuration file is stored
|
||||
* @param name the configuration name identifier
|
||||
* @param pack the package path where configuration classes are located
|
||||
* @return a new {@link LuminolConfigsInstance}
|
||||
*/
|
||||
LuminolConfigsInstance of(
|
||||
@NotNull ClassLoader loader,
|
||||
@NotNull File base,
|
||||
@NotNull String name,
|
||||
@NotNull String pack
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates a configuration instance with a custom base directory and file name.
|
||||
*
|
||||
* @param loader the class loader used to load configuration resources
|
||||
* @param base the base directory where the configuration file is stored
|
||||
* @param name the configuration name identifier
|
||||
* @param file_name the configuration file name (without extension)
|
||||
* @param pack the package path where configuration classes are located
|
||||
* @return a new {@link LuminolConfigsInstance}
|
||||
*/
|
||||
LuminolConfigsInstance of(
|
||||
@NotNull ClassLoader loader,
|
||||
@NotNull File base,
|
||||
@NotNull String name,
|
||||
@NotNull String file_name,
|
||||
@NotNull String pack
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates a configuration instance with full customization options.
|
||||
*
|
||||
* @param loader the class loader used to load configuration resources
|
||||
* @param base the base directory where the configuration file is stored
|
||||
* @param name the configuration name identifier
|
||||
* @param file_name the configuration file name (without extension)
|
||||
* @param command_name the command name associated with this configuration
|
||||
* @param pack the package path where configuration classes are located
|
||||
* @return a new {@link LuminolConfigsInstance}
|
||||
*/
|
||||
LuminolConfigsInstance of(
|
||||
@NotNull ClassLoader loader,
|
||||
@NotNull File base,
|
||||
@NotNull String name,
|
||||
@NotNull String file_name,
|
||||
@NotNull String command_name,
|
||||
@NotNull String pack
|
||||
);
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
package me.earthme.luminol.api.config;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Interface for managing configuration instances and operations.
|
||||
* Provides methods for loading, saving, modifying, and querying configuration values.
|
||||
*/
|
||||
public interface LuminolConfigsInstance {
|
||||
/**
|
||||
* Initialize the configuration subsystem for this instance.
|
||||
* Implementations should load configuration files, apply defaults and
|
||||
* prepare any internal caches or state needed for subsequent operations.
|
||||
* This method may perform I/O and therefore can throw an {@link IOException}
|
||||
* if initialization fails.
|
||||
*
|
||||
* @throws IOException if an I/O error occurs while initializing
|
||||
*/
|
||||
void initialize() throws IOException;
|
||||
|
||||
/**
|
||||
* Reloads all configurations asynchronously
|
||||
*
|
||||
* @param keepComments whether to preserve existing comments in the config file
|
||||
* @return CompletableFuture that completes when reload is finished
|
||||
*/
|
||||
@NotNull CompletableFuture<Void> reloadAsync(boolean keepComments);
|
||||
|
||||
/**
|
||||
* Sets a configuration value by key
|
||||
*
|
||||
* @param key the configuration key (dot-separated path)
|
||||
* @param value the value to set
|
||||
* @return true if the key exists and value was set, false otherwise
|
||||
*/
|
||||
boolean setConfig(String key, Object value);
|
||||
|
||||
/**
|
||||
* Saves all pending configuration changes to disk
|
||||
*/
|
||||
void saveConfigs();
|
||||
|
||||
/**
|
||||
* Resets a configuration value to its default
|
||||
*
|
||||
* @param key the configuration key to reset
|
||||
*/
|
||||
void resetConfig(String key);
|
||||
|
||||
/**
|
||||
* Gets the default value of a configuration as string
|
||||
*
|
||||
* @param key the configuration key
|
||||
* @return the default value as string
|
||||
*/
|
||||
String getDefaultConfig(String key);
|
||||
|
||||
/**
|
||||
* Gets the current value of a configuration as string
|
||||
*
|
||||
* @param key the configuration key
|
||||
* @return the current value as string
|
||||
*/
|
||||
String getConfig(String key);
|
||||
|
||||
/**
|
||||
* Gets the original (untransformed) value of a configuration
|
||||
*
|
||||
* @param key the configuration key
|
||||
* @param <T> the expected type of the value
|
||||
* @return the original configuration value
|
||||
*/
|
||||
<T> T getConfigOrigin(String key);
|
||||
|
||||
/**
|
||||
* Gets available suggestions for a configuration key
|
||||
*
|
||||
* @param key the configuration key
|
||||
* @return array of suggestion strings, or null if no suggestions available
|
||||
*/
|
||||
String[] getConfigSuggestions(String key);
|
||||
|
||||
/**
|
||||
* Completes a partial configuration path by finding matching keys
|
||||
*
|
||||
* @param partialPath the partial path to complete
|
||||
* @return list of possible completions
|
||||
*/
|
||||
List<String> completeConfigPath(String partialPath);
|
||||
|
||||
/**
|
||||
* Completes a partial configuration path with specific depth
|
||||
*
|
||||
* @param partialPath the partial path to complete
|
||||
* @param dotIndex the maximum number of dots (depth) in the result
|
||||
* @return list of possible completions
|
||||
*/
|
||||
List<String> completeConfigPath(String partialPath, int dotIndex);
|
||||
|
||||
/**
|
||||
* Gets all configuration paths that start with the given prefix
|
||||
*
|
||||
* @param currentPath the prefix to search for
|
||||
* @return list of matching configuration paths
|
||||
*/
|
||||
List<String> getAllConfigPaths(String currentPath);
|
||||
|
||||
/**
|
||||
* Gets all configuration data pairs without prefix filter
|
||||
*
|
||||
* @return set of all configuration data
|
||||
*/
|
||||
Set<ConfigDataPair> getAllData();
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs filtered by prefix
|
||||
*
|
||||
* @param prefix the prefix to filter by
|
||||
* @return set of matching configuration data
|
||||
*/
|
||||
Set<ConfigDataPair> getData(String prefix);
|
||||
|
||||
/**
|
||||
* Gets all configuration data pairs with full information (comments and suggestions)
|
||||
*
|
||||
* @return set of all configuration data with full details
|
||||
*/
|
||||
Set<ConfigDataPair> getAllDataFull();
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs with full information filtered by prefix
|
||||
*
|
||||
* @param prefix the prefix to filter by
|
||||
* @return set of matching configuration data with full details
|
||||
*/
|
||||
Set<ConfigDataPair> getDataFull(String prefix);
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs with optional comments and suggestions
|
||||
*
|
||||
* @param prefix the prefix to filter by
|
||||
* @param _comment whether to include comments
|
||||
* @param _withSuggestions whether to include suggestions
|
||||
* @return set of matching configuration data
|
||||
*/
|
||||
Set<ConfigDataPair> getData(String prefix, boolean _comment, boolean _withSuggestions);
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs for specified keys
|
||||
*
|
||||
* @param list list of configuration keys
|
||||
* @return set of configuration data for the specified keys
|
||||
*/
|
||||
Set<ConfigDataPair> getData(List<String> list);
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs with comments for specified keys
|
||||
*
|
||||
* @param list list of configuration keys
|
||||
* @return set of configuration data with comments
|
||||
*/
|
||||
Set<ConfigDataPair> getDataWithComment(List<String> list);
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs with full information for specified keys
|
||||
*
|
||||
* @param list list of configuration keys
|
||||
* @return set of configuration data with full details
|
||||
*/
|
||||
Set<ConfigDataPair> getDataFull(List<String> list);
|
||||
|
||||
/**
|
||||
* Gets configuration data pairs for specified keys with optional features
|
||||
*
|
||||
* @param list list of configuration keys
|
||||
* @param _comment whether to include comments
|
||||
* @param _withSuggestions whether to include suggestions
|
||||
* @return set of configuration data
|
||||
*/
|
||||
Set<ConfigDataPair> getData(List<String> list, boolean _comment, boolean _withSuggestions);
|
||||
|
||||
/**
|
||||
* Remove a configuration entry by its key.
|
||||
* If the key does not exist this should be a no-op.
|
||||
*
|
||||
* @param key the configuration key to remove
|
||||
*/
|
||||
void removeConfig(String key);
|
||||
|
||||
/**
|
||||
* Remove multiple configuration entries by their keys.
|
||||
* Implementations should attempt to remove each key provided. If some
|
||||
* keys do not exist they may be ignored.
|
||||
*
|
||||
* @param keys an array of configuration keys to remove
|
||||
*/
|
||||
void removeConfig(String[] keys);
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package me.earthme.luminol.api.entity;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A simple event fired when a teleportAsync was called
|
||||
*
|
||||
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)
|
||||
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location)
|
||||
* (Also fired when teleportAsync called from nms)
|
||||
*/
|
||||
public class EntityTeleportAsyncEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Entity entity;
|
||||
private final PlayerTeleportEvent.TeleportCause teleportCause;
|
||||
private final Location destination;
|
||||
|
||||
public EntityTeleportAsyncEvent(Entity entity, PlayerTeleportEvent.TeleportCause teleportCause, Location destination) {
|
||||
Validate.notNull(entity, "entity cannot be a null value!");
|
||||
Validate.notNull(teleportCause, "teleportCause cannot be a null value!");
|
||||
Validate.notNull(destination, "destination cannot be a null value!");
|
||||
|
||||
this.entity = entity;
|
||||
this.teleportCause = teleportCause;
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entity is about to be teleported
|
||||
*
|
||||
* @return that entity
|
||||
*/
|
||||
public @NotNull Entity getEntity() {
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cause of the teleport
|
||||
*
|
||||
* @return the cause
|
||||
*/
|
||||
public @NotNull PlayerTeleportEvent.TeleportCause getTeleportCause() {
|
||||
return this.teleportCause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the destination of the teleport
|
||||
*
|
||||
* @return the destination
|
||||
*/
|
||||
public @NotNull Location getDestination() {
|
||||
return this.destination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package me.earthme.luminol.api.entity;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A simple event created for missing teleport events api of folia
|
||||
* This event is fired when the entity portal process has been done
|
||||
*/
|
||||
public class PostEntityPortalEvent extends Event {
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
private final Entity teleportedEntity;
|
||||
|
||||
public PostEntityPortalEvent(Entity teleportedEntity) {
|
||||
Validate.notNull(teleportedEntity, "teleportedEntity cannot be null!");
|
||||
|
||||
this.teleportedEntity = teleportedEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entity which was teleported
|
||||
*
|
||||
* @return the entity which was teleported
|
||||
*/
|
||||
public Entity getTeleportedEntity() {
|
||||
return this.teleportedEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package me.earthme.luminol.api.entity;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A simple event created for missing teleport events api of folia
|
||||
* This event will be fired when a portal teleportation is about to happen
|
||||
*/
|
||||
public class PreEntityPortalEvent extends Event implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Entity entity;
|
||||
private final Location portalPos;
|
||||
private final World destination;
|
||||
|
||||
private boolean cancelled = false;
|
||||
|
||||
public PreEntityPortalEvent(Entity entity, Location portalPos, World destination) {
|
||||
Validate.notNull(entity, "entity cannot be null!");
|
||||
Validate.notNull(portalPos, "portalPos cannot be null!");
|
||||
Validate.notNull(destination, "destination cannot be null!");
|
||||
|
||||
this.entity = entity;
|
||||
this.portalPos = portalPos;
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entity that is about to teleport
|
||||
*
|
||||
* @return the entity
|
||||
*/
|
||||
public @NotNull Entity getEntity() {
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location of the portal
|
||||
*
|
||||
* @return the portal location
|
||||
*/
|
||||
public @NotNull Location getPortalPos() {
|
||||
return this.portalPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the destination world
|
||||
*
|
||||
* @return the destination world
|
||||
*/
|
||||
public @NotNull World getDestination() {
|
||||
return this.destination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
package me.earthme.luminol.api.entity.player;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A simple event fired when the respawn process of player is done
|
||||
*/
|
||||
public class PostPlayerRespawnEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
|
||||
public PostPlayerRespawnEvent(Player player) {
|
||||
Validate.notNull(player, "Player cannot be a null value!");
|
||||
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the respawned player
|
||||
*
|
||||
* @return the player
|
||||
*/
|
||||
public @NotNull Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package me.earthme.luminol.api.portal;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A event fired when an end platform is created.
|
||||
*/
|
||||
public class EndPlatformCreateEvent extends Event implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private boolean cancelled = false;
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package me.earthme.luminol.api.portal;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* A event fired when the portal process started locating the destination position
|
||||
* Notice: If you changed the destination to an another position in end teleportation.The end platform won't create under the entity and won't create
|
||||
* if the position is out of current tick region
|
||||
*/
|
||||
public class PortalLocateEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Location original;
|
||||
private final Location destination;
|
||||
|
||||
public PortalLocateEvent(Location original, Location destination) {
|
||||
Validate.notNull(original, "original couldn't be null!");
|
||||
Validate.notNull(destination, "destination couldn't be null!");
|
||||
|
||||
this.original = original;
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the destination position of this teleportation
|
||||
*
|
||||
* @return the destination position
|
||||
*/
|
||||
public Location getDestination() {
|
||||
return this.destination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the original portal position of this teleportation
|
||||
*
|
||||
* @return the original portal position
|
||||
*/
|
||||
public Location getOriginal() {
|
||||
return this.original;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package org.leavesmc.leaves.event.bot;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.entity.bot.Bot;
|
||||
|
||||
public class BotActionGuiOpenEvent extends BotEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private boolean cancel = false;
|
||||
|
||||
public BotActionGuiOpenEvent(@NotNull Bot who, @Nullable Player player) {
|
||||
super(who);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Player getOpenPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* This file is licensed under the MIT license.
|
||||
* Origin : Leaves (https://github.com/LeavesMC/Leaves)
|
||||
*/
|
||||
|
||||
package org.leavesmc.leaves.plugin;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface FeatureManager {
|
||||
Set<String> getAvailableFeatures();
|
||||
|
||||
boolean isFeatureAvailable(String feature);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* This file is licensed under the MIT license.
|
||||
* Origin : Leaves (https://github.com/LeavesMC/Leaves)
|
||||
*/
|
||||
|
||||
package org.leavesmc.leaves.plugin;
|
||||
|
||||
public class Features {
|
||||
public static final String MIXIN = "mixin";
|
||||
public static final String FAKEPLAYER = "fakeplayer";
|
||||
public static final String PHOTOGRAPHER = "photographer";
|
||||
public static final String RECORDER = "recorder";
|
||||
public static final String BYTEBUF = "bytebuf";
|
||||
public static final String UPDATE_SUPPRESSION_EVENT = "update_suppression_event";
|
||||
}
|
||||
@@ -1,151 +1,72 @@
|
||||
--- a/folia-server/build.gradle.kts
|
||||
+++ b/folia-server/build.gradle.kts
|
||||
@@ -7,15 +_,16 @@
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
idea
|
||||
- id("io.papermc.paperweight.core")
|
||||
+ id("fun.bm.comfreyweight.core")
|
||||
id("io.papermc.fill.gradle") version "1.0.12"
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
+val bacteriawaMavenPublicUrl = "https://repo.bacteriawa.com/repository/maven-public/"
|
||||
|
||||
dependencies {
|
||||
mache("io.papermc:mache:26.2+build.1")
|
||||
- paperclip("io.papermc:paperclip:3.0.4")
|
||||
+ morninggloryclip("fun.bm:morninggloryclip:${providers.gradleProperty("clipVersion").get()}")
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -23,7 +_,8 @@
|
||||
filterPatches = false
|
||||
gitFilePatches = false
|
||||
|
||||
- val fork = forks.register("folia") {
|
||||
+ val folia = forks.register("folia") {
|
||||
+ rootDirectory = upstreamsDirectory().map { it.dir("folia") }
|
||||
upstream.patchDir("paperServer") {
|
||||
upstreamPath = "paper-server"
|
||||
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
||||
@@ -32,7 +_,23 @@
|
||||
--- a/luminol-server/build.gradle.kts
|
||||
+++ b/luminol-server/build.gradle.kts
|
||||
@@ -50,7 +_,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
- activeFork = fork
|
||||
- activeFork = luminol
|
||||
+ val lophine = forks.register("lophine") {
|
||||
+ forks = folia
|
||||
+ forks = luminol
|
||||
+ upstream.patchRepo("paperServer") {
|
||||
+ upstreamRepo = folia.patchedRepo("paperServer")
|
||||
+ upstreamRepo = luminol.patchedRepo("paperServer")
|
||||
+ patchesDir = rootDirectory.dir("lophine-server/paper-patches")
|
||||
+ outputDir = rootDirectory.dir("paper-server")
|
||||
+ }
|
||||
+
|
||||
+ upstream.patchDir("foliaServer") {
|
||||
+ upstreamPath = "folia-server"
|
||||
+ upstream.patchDir("luminolServer") {
|
||||
+ upstreamPath = "luminol-server"
|
||||
+ excludes = setOf("src/minecraft", "paper-patches", "minecraft-patches", "build.gradle.kts", "build.gradle.kts.patch")
|
||||
+ patchesDir = rootDirectory.dir("lophine-server/folia-patches")
|
||||
+ outputDir = rootDirectory.dir("folia-server")
|
||||
+ patchesDir = rootDirectory.dir("lophine-server/luminol-patches")
|
||||
+ outputDir = rootDirectory.dir("luminol-server")
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ activeFork = lophine
|
||||
|
||||
|
||||
updatingMinecraft {
|
||||
@@ -44,6 +_,7 @@
|
||||
libraryRepositories.addAll(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
paperMavenPublicUrl,
|
||||
+ bacteriawaMavenPublicUrl
|
||||
)
|
||||
}
|
||||
|
||||
@@ -103,10 +_,14 @@
|
||||
main {
|
||||
java { srcDir("../paper-server/src/main/java") }
|
||||
@@ -125,12 +_,16 @@
|
||||
resources { srcDir("../paper-server/src/main/resources") }
|
||||
+ java { srcDir("../folia-server/src/main/java") }
|
||||
+ resources { srcDir("../folia-server/src/main/resources") }
|
||||
java { srcDir("../folia-server/src/main/java") }
|
||||
resources { srcDir("../folia-server/src/main/resources") }
|
||||
+ java { srcDir("../luminol-server/src/main/java") }
|
||||
+ resources { srcDir("../luminol-server/src/main/resources") }
|
||||
}
|
||||
test {
|
||||
java { srcDir("../paper-server/src/test/java") }
|
||||
resources { srcDir("../paper-server/src/test/resources") }
|
||||
+ java { srcDir("../folia-server/src/test/java") }
|
||||
+ resources { srcDir("../folia-server/src/test/resources") }
|
||||
java { srcDir("../folia-server/src/test/java") }
|
||||
resources { srcDir("../folia-server/src/test/resources") }
|
||||
+ java { srcDir("../luminol-server/src/main/java") }
|
||||
+ resources { srcDir("../luminol-server/src/main/resources") }
|
||||
}
|
||||
}
|
||||
val log4jPlugins = sourceSets.create("log4jPlugins") {
|
||||
@@ -134,7 +_,21 @@
|
||||
@@ -158,7 +_,7 @@
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":folia-api"))
|
||||
+ implementation(project(":lophine-api")) // Lophine - api update
|
||||
+ // Lophine start - Dependenices insert
|
||||
+ implementation("net.objecthunter:exp4j:0.4.8")
|
||||
+ implementation("com.electronwill.night-config:toml:3.8.4") // Night config
|
||||
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
|
||||
+ implementation("net.openhft:zero-allocation-hashing:0.16")
|
||||
+ implementation("io.github.classgraph:classgraph:4.8.158")
|
||||
+ implementation("net.openhft:affinity:3.23.3")
|
||||
+ // Leaves start - leaves plugin
|
||||
+ implementation("org.spongepowered:configurate-gson:4.2.0-SNAPSHOT") {
|
||||
+ exclude(group = "com.google.code.gson", module = "gson")
|
||||
+ exclude(group = "com.google.guava", module = "guava")
|
||||
+ }
|
||||
+ // Leaves end - leaves plugin
|
||||
+ // Lophine end
|
||||
implementation("ca.spottedleaf:leafpile:1.0.0")
|
||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||
@@ -189,21 +_,21 @@
|
||||
val git = Git(rootProject.layout.projectDirectory.path)
|
||||
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
||||
val build = System.getenv("BUILD_NUMBER") ?: null
|
||||
- val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
|
||||
+ val buildTime = Instant.now() // Always use current as build time
|
||||
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
|
||||
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
|
||||
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
|
||||
- implementation(project(":luminol-api"))
|
||||
+ implementation(project(":lophine-api"))
|
||||
// Luminol start - Dependenices insert
|
||||
implementation("net.objecthunter:exp4j:0.4.8")
|
||||
implementation("com.electronwill.night-config:toml:3.8.3") // Night config
|
||||
@@ -234,14 +_,14 @@
|
||||
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
- "Implementation-Title" to "Folia",
|
||||
+ "Implementation-Title" to "Lophine", // Lophine - Rebrand
|
||||
- "Implementation-Title" to "Luminol", // Luminol - Rebrand
|
||||
+ "Implementation-Title" to "Lophine", // Luminol - Rebrand
|
||||
"Implementation-Version" to implementationVersion,
|
||||
"Implementation-Vendor" to date,
|
||||
- "Specification-Title" to "Folia",
|
||||
+ "Specification-Title" to "Lophine", // Lophine - Rebrand
|
||||
- "Specification-Title" to "Luminol", // Luminol - Rebrand
|
||||
+ "Specification-Title" to "Lophine", // Luminol - Rebrand
|
||||
"Specification-Version" to project.version,
|
||||
- "Specification-Vendor" to "Paper Team",
|
||||
- "Brand-Id" to "papermc:folia",
|
||||
- "Brand-Name" to "Folia",
|
||||
+ "Specification-Vendor" to "LophineLabs", // Lophine - Rebrand
|
||||
+ "Brand-Id" to "lophinelabs:lophine", // Lophine - Rebrand
|
||||
+ "Brand-Name" to "Lophine", // Lophine - Rebrand
|
||||
"Specification-Vendor" to "LuminoLMC", // Luminol - Rebrand
|
||||
- "Brand-Id" to "luminolmc:luminol", // Luminol - Rebrand
|
||||
- "Brand-Name" to "Luminol", // Luminol - Rebrand
|
||||
+ "Brand-Id" to "luminolmc:lophine", // Luminol - Rebrand
|
||||
+ "Brand-Name" to "Lophine", // Luminol - Rebrand
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to buildTime.toString(),
|
||||
"Git-Branch" to gitBranch,
|
||||
@@ -214,6 +_,20 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+// Pufferfish Start
|
||||
+tasks.withType<JavaCompile> {
|
||||
+ val compilerArgs = options.compilerArgs
|
||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||
+}
|
||||
+// Pufferfish End
|
||||
+// Lophine start - Hide unnecessary warnings
|
||||
+tasks.withType<JavaCompile> {
|
||||
+ val compilerArgs = options.compilerArgs
|
||||
+ compilerArgs.add("-Xlint:-module")
|
||||
+ compilerArgs.add("-Xlint:-removal")
|
||||
+ compilerArgs.add("-Xlint:-dep-ann")
|
||||
+}
|
||||
+// Lophine end
|
||||
|
||||
// Compile tests with -parameters for better junit parameterized test names
|
||||
tasks.compileTestJava {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 8 Jun 2025 00:58:13 +0800
|
||||
Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
index 490316c7d5cbb77e988039cfa7a7cc0aa3849730..f5fb4e210c07f32e52eb8c1ba166d1571a6778c7 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
@@ -24,6 +24,7 @@ public class ConfigManager {
|
||||
|
||||
public static void initConfigs() {
|
||||
configfiles.put("luminol", ConfigsInstance.of("luminol", "me.earthme.luminol.config.modules"));
|
||||
+ configfiles.put("lophine", ConfigsInstance.of("lophine", "fun.bm.lophine.config.modules")); // add lophine global config
|
||||
preLoad();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
index e4022494b050b68d54bac3cde87bdfc9e908859c..a4188ef831825764c0756b826651e2e7a9f99c5b 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
@@ -8,7 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "server_mod_name")
|
||||
public class ServerModNameConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "name", comments = "Decides the server mod name shown in your F3 debug screen.")
|
||||
- public static String serverModName = "Luminol";
|
||||
+ public static String serverModName = "Lophine";
|
||||
|
||||
@ConfigInfo(name = "vanilla_spoof", comments = "Ignore any plugin's modification and server mod name set in this config block, only force sending brand name of vanilla")
|
||||
public static boolean fakeVanilla = false;
|
||||
@@ -0,0 +1,141 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 16 Mar 2026 15:51:40 +0800
|
||||
Subject: [PATCH] Diff in auto-update patch
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
|
||||
index ce01352b637547c1cf8308d56d4b3f9c48fcca70..9b5623ce1de3d68c949c3c00b966cedab3a4c986 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
|
||||
@@ -16,13 +16,13 @@ import java.util.Set;
|
||||
category = EnumConfigCategory.MISC,
|
||||
name = "auto_update",
|
||||
comments = """
|
||||
- Checks GitHub Releases for newer Luminol jars on a schedule.
|
||||
- Downloads are staged under auto_update/luminol and written to auto_update/core.path,
|
||||
+ Checks GitHub Releases for newer version's jars on a schedule.
|
||||
+ Downloads are staged under auto_update/lophine and written to auto_update/core.path,
|
||||
which Hyacinthusclip can consume on the next restart.
|
||||
- If target_jar_path is set, Luminol will also try to replace that launcher jar directly."""
|
||||
+ If target_jar_path is set, server will also try to replace that launcher jar directly."""
|
||||
)
|
||||
public class AutoUpdateConfig implements IConfigModule {
|
||||
- @ConfigInfo(name = "enabled", comments = "Whether Luminol should check for updates automatically.")
|
||||
+ @ConfigInfo(name = "enabled", comments = "Whether the server should check for updates automatically.")
|
||||
public static boolean enabled = false;
|
||||
|
||||
@ConfigInfo(name = "check_times", comments = "List of daily check times in HH:mm, based on the server's local time zone.")
|
||||
@@ -33,7 +33,7 @@ public class AutoUpdateConfig implements IConfigModule {
|
||||
|
||||
@ConfigInfo(name = "target_jar_path", comments = """
|
||||
Optional launcher jar path to replace after a successful download.
|
||||
- Leave this blank to keep the downloaded jar staged in auto_update/luminol
|
||||
+ Leave this blank to keep the downloaded jar staged in auto_update/lophine
|
||||
and let Hyacinthusclip switch to it through auto_update/core.path on restart.""")
|
||||
public static String targetJarPath = "";
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java b/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java
|
||||
index 94a25cd681c9352d6931edafd9ec67fd7ba8a777..d0d0cf5e5ff8d4b8efa4d9778c27267b41cf8cf8 100644
|
||||
--- a/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java
|
||||
+++ b/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java
|
||||
@@ -35,10 +35,10 @@ public final class AutoUpdateHelper {
|
||||
private final Logger LOGGER = LogUtils.getClassLogger();
|
||||
private final Gson GSON = new Gson();
|
||||
|
||||
- private final String GITHUB_API_BASE = "https://api.github.com/repos/LuminolMC/Luminol";
|
||||
+ private final String GITHUB_API_BASE = "https://api.github.com/repos/lophineMC/lophine";
|
||||
private final Path AUTO_UPDATE_DIR = Path.of("auto_update");
|
||||
private final Path CORE_PATH_FILE = AUTO_UPDATE_DIR.resolve("core.path");
|
||||
- private final Path LUMINOL_UPDATE_DIR = AUTO_UPDATE_DIR.resolve("luminol");
|
||||
+ private final Path LUMINOL_UPDATE_DIR = AUTO_UPDATE_DIR.resolve("lophine");
|
||||
private final Path LATEST_PATH_FILE = LUMINOL_UPDATE_DIR.resolve("latest.path");
|
||||
private final long DAILY_TASK_PERIOD_MILLIS = TimeUnit.DAYS.toMillis(1);
|
||||
|
||||
@@ -51,13 +51,13 @@ public final class AutoUpdateHelper {
|
||||
ensureWorkingDirectories();
|
||||
|
||||
scheduler = Executors.newSingleThreadScheduledExecutor(task -> {
|
||||
- final Thread thread = new Thread(task, "Luminol Auto Update Scheduler");
|
||||
+ final Thread thread = new Thread(task, "Lophine Auto Update Scheduler");
|
||||
thread.setDaemon(true);
|
||||
return thread;
|
||||
});
|
||||
|
||||
if (AutoUpdateConfig.checkTimes.isEmpty()) {
|
||||
- LOGGER.warn("Luminol auto-update is enabled, but misc.auto_update.check_times is empty.");
|
||||
+ LOGGER.warn("Lophine auto-update is enabled, but misc.auto_update.check_times is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,14 +95,14 @@ public final class AutoUpdateHelper {
|
||||
|
||||
private void checkForUpdatesSafely() {
|
||||
if (!UPDATE_RUNNING.compareAndSet(false, true)) {
|
||||
- LOGGER.info("A Luminol auto-update check is already running, skipping this schedule.");
|
||||
+ LOGGER.info("A Lophine auto-update check is already running, skipping this schedule.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
checkForUpdates();
|
||||
} catch (Exception e) {
|
||||
- LOGGER.warn("Luminol auto-update failed.", e);
|
||||
+ LOGGER.warn("Lophine auto-update failed.", e);
|
||||
} finally {
|
||||
UPDATE_RUNNING.set(false);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public final class AutoUpdateHelper {
|
||||
|
||||
final ReleaseAssetInfo latestRelease = getLatestCompatibleRelease(mcVersion, gitBranch);
|
||||
if (latestRelease == null) {
|
||||
- LOGGER.warn("No compatible Luminol release was found for Minecraft {}{}.",
|
||||
+ LOGGER.warn("No compatible Lophine release was found for Minecraft {}{}.",
|
||||
mcVersion,
|
||||
gitBranch == null ? "" : " on branch " + gitBranch
|
||||
);
|
||||
@@ -132,7 +132,7 @@ public final class AutoUpdateHelper {
|
||||
|
||||
final UpdateStatus updateStatus = compareReleaseWithCurrentBuild(latestRelease.releaseCommitHash(), currentGitHash);
|
||||
if (updateStatus == UpdateStatus.UP_TO_DATE) {
|
||||
- LOGGER.info("You are already running the latest compatible Luminol release: {}", latestRelease.tagName());
|
||||
+ LOGGER.info("You are already running the latest compatible Lophine release: {}", latestRelease.tagName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public final class AutoUpdateHelper {
|
||||
return;
|
||||
}
|
||||
|
||||
- LOGGER.info("Found a newer Luminol release: {}", latestRelease.tagName());
|
||||
+ LOGGER.info("Found a newer Lophine release: {}", latestRelease.tagName());
|
||||
|
||||
final Path stagedJar = downloadAndStageRelease(latestRelease);
|
||||
final Path finalJarPath = tryApplyTargetJar(stagedJar);
|
||||
@@ -163,7 +163,7 @@ public final class AutoUpdateHelper {
|
||||
|
||||
if (finalJarPath.equals(stagedJar)) {
|
||||
LOGGER.info(
|
||||
- "Downloaded the latest Luminol jar to {} and refreshed auto_update/core.path for Hyacinthusclip. Please restart your server.",
|
||||
+ "Downloaded the latest Lophine jar to {} and refreshed auto_update/core.path for Hyacinthusclip. Please restart your server.",
|
||||
finalJarPath.toAbsolutePath()
|
||||
);
|
||||
} else {
|
||||
@@ -179,7 +179,7 @@ public final class AutoUpdateHelper {
|
||||
try {
|
||||
Files.createDirectories(LUMINOL_UPDATE_DIR);
|
||||
} catch (IOException e) {
|
||||
- throw new RuntimeException("Failed to create Luminol auto update directory", e);
|
||||
+ throw new RuntimeException("Failed to create Lophine auto update directory", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ public final class AutoUpdateHelper {
|
||||
private @NotNull HttpURLConnection openConnection(String url) throws IOException, URISyntaxException {
|
||||
final HttpURLConnection connection = (HttpURLConnection) new URI(url).toURL().openConnection();
|
||||
connection.setRequestProperty("Accept", "application/vnd.github+json");
|
||||
- connection.setRequestProperty("User-Agent", "Luminol Auto Update");
|
||||
+ connection.setRequestProperty("User-Agent", "Lophine Auto Update");
|
||||
connection.setConnectTimeout(10000);
|
||||
connection.setReadTimeout(10000);
|
||||
return connection;
|
||||
@@ -0,0 +1,190 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 13 Aug 2025 22:23:46 +0800
|
||||
Subject: [PATCH] Leaves: Item overstack util
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java b/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
|
||||
index a5df7e40369cf2c309f4d37fede6615f34a467e2..84d0e1a7cd687ac4ed9f1bf824ca28940c2fab1e 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
|
||||
@@ -17,10 +17,98 @@
|
||||
|
||||
package org.leavesmc.leaves.util;
|
||||
|
||||
+import fun.bm.lophine.config.modules.function.ContainerExpansionConfig;
|
||||
+import net.minecraft.core.component.DataComponents;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.world.entity.item.ItemEntity;
|
||||
+import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.component.CustomData;
|
||||
+import net.minecraft.world.item.component.ItemContainerContents;
|
||||
+import net.minecraft.world.level.block.ShulkerBoxBlock;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.List;
|
||||
+import java.util.Objects;
|
||||
+import java.util.Optional;
|
||||
|
||||
// Only used part of the original code was copied
|
||||
public class ItemOverstackUtils {
|
||||
+
|
||||
+ private static final List<ItemUtil> overstackUtils = List.of(
|
||||
+ new ShulkerBox()
|
||||
+ );
|
||||
+
|
||||
+ public static int getItemStackMaxCount(ItemStack stack) {
|
||||
+ int size;
|
||||
+ for (ItemUtil util : overstackUtils) {
|
||||
+ if (util.isEnabled() && (size = util.getMaxServerStackCount(stack)) != -1) {
|
||||
+ return size;
|
||||
+ }
|
||||
+ }
|
||||
+ return stack.getMaxStackSize();
|
||||
+ }
|
||||
+
|
||||
+ public static int getNetworkMaxCount(ItemStack stack) {
|
||||
+ int size;
|
||||
+ for (ItemUtil util : overstackUtils) {
|
||||
+ if (util.isEnabled() && (size = util.getMaxClientStackCount(stack)) != -1) {
|
||||
+ return size;
|
||||
+ }
|
||||
+ }
|
||||
+ return stack.getMaxStackSize();
|
||||
+ }
|
||||
+
|
||||
+ public static boolean tryStackItems(ItemEntity self, ItemEntity other) {
|
||||
+ for (ItemUtil util : overstackUtils) {
|
||||
+ if (util.isEnabled() && util.tryStackItems(self, other)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ public static boolean hasOverstackingItem() {
|
||||
+ for (ItemUtil util : overstackUtils) {
|
||||
+ if (util.isEnabled()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ public static int getItemStackMaxCountReal(ItemStack stack) {
|
||||
+ CompoundTag nbt = Optional.ofNullable(stack.get(DataComponents.CUSTOM_DATA)).orElse(CustomData.EMPTY).copyTag();
|
||||
+ return nbt.getInt("Leaves.RealStackSize").orElse(stack.getMaxStackSize());
|
||||
+ }
|
||||
+
|
||||
+ public static ItemStack encodeMaxStackSize(ItemStack itemStack) {
|
||||
+ int realMaxStackSize = getItemStackMaxCountReal(itemStack);
|
||||
+ int modifiedMaxStackSize = getNetworkMaxCount(itemStack);
|
||||
+ if (itemStack.getMaxStackSize() != modifiedMaxStackSize) {
|
||||
+ itemStack.set(DataComponents.MAX_STACK_SIZE, modifiedMaxStackSize);
|
||||
+ CompoundTag nbt = itemStack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag();
|
||||
+ nbt.putInt("Leaves.RealStackSize", realMaxStackSize);
|
||||
+ itemStack.set(DataComponents.CUSTOM_DATA, CustomData.of(nbt));
|
||||
+ }
|
||||
+ return itemStack;
|
||||
+ }
|
||||
+
|
||||
+ public static ItemStack decodeMaxStackSize(ItemStack itemStack) {
|
||||
+ int realMaxStackSize = getItemStackMaxCountReal(itemStack);
|
||||
+ if (itemStack.getMaxStackSize() != realMaxStackSize) {
|
||||
+ itemStack.set(DataComponents.MAX_STACK_SIZE, realMaxStackSize);
|
||||
+ CompoundTag nbt = itemStack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag();
|
||||
+ nbt.remove("Leaves.RealStackSize");
|
||||
+ if (nbt.isEmpty()) {
|
||||
+ itemStack.remove(DataComponents.CUSTOM_DATA);
|
||||
+ } else {
|
||||
+ itemStack.set(DataComponents.CUSTOM_DATA, CustomData.of(nbt));
|
||||
+ }
|
||||
+ }
|
||||
+ return itemStack;
|
||||
+ }
|
||||
+
|
||||
public static float getItemStackSignalStrength(int maxStackSize, ItemStack itemStack) {
|
||||
float result = (float) itemStack.getCount() / Math.min(maxStackSize, itemStack.getMaxStackSize());
|
||||
/*if (LeavesConfig.modify.oldMC.allowGrindstoneOverstacking && CurseEnchantedBook.isCursedEnchantedBook(itemStack)) { // Luminol
|
||||
@@ -28,4 +116,80 @@ public class ItemOverstackUtils {
|
||||
}*/ // Luminol
|
||||
return Math.clamp(result, 0f, 1f);
|
||||
}
|
||||
+
|
||||
+ public static boolean isStackable(ItemStack itemStack) {
|
||||
+ return getItemStackMaxCount(itemStack) > 1 && (!itemStack.isDamageableItem() || !itemStack.isDamaged());
|
||||
+ }
|
||||
+
|
||||
+ private interface ItemUtil {
|
||||
+ boolean isEnabled();
|
||||
+
|
||||
+ boolean tryStackItems(ItemEntity self, ItemEntity other);
|
||||
+
|
||||
+ // number -> modified count, -1 -> I don't care
|
||||
+ int getMaxServerStackCount(ItemStack stack);
|
||||
+
|
||||
+ // number -> modified count, -1 -> I don't care
|
||||
+ default int getMaxClientStackCount(ItemStack stack) {
|
||||
+ return getMaxServerStackCount(stack);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static class ShulkerBox implements ItemUtil {
|
||||
+ public static boolean shulkerBoxCheck(@NotNull ItemStack stack1, @NotNull ItemStack stack2) {
|
||||
+ if (ContainerExpansionConfig.nbtShulkerStackable) {
|
||||
+ return Objects.equals(stack1.getComponents(), stack2.getComponents());
|
||||
+ }
|
||||
+ return shulkerBoxNoItem(stack1) && shulkerBoxNoItem(stack2) && Objects.equals(stack1.getComponents(), stack2.getComponents());
|
||||
+ }
|
||||
+
|
||||
+ public static boolean shulkerBoxNoItem(@NotNull ItemStack stack) {
|
||||
+ // Leaves - Paper 26.1: ItemContainerContents#stream() removed, use nonEmptyItemCopyStream()
|
||||
+ return stack.getComponents().getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).nonEmptyItemCopyStream().findAny().isEmpty();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isEnabled() {
|
||||
+ return ContainerExpansionConfig.shulkerCount > 1;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean tryStackItems(ItemEntity self, ItemEntity other) {
|
||||
+ ItemStack selfStack = self.getItem();
|
||||
+ if (!(selfStack.getItem() instanceof BlockItem blockItem) || !(blockItem.getBlock() instanceof ShulkerBoxBlock)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ ItemStack otherStack = other.getItem();
|
||||
+ if (selfStack.getItem() == otherStack.getItem()
|
||||
+ && shulkerBoxCheck(selfStack, otherStack)
|
||||
+ && selfStack.getCount() != ContainerExpansionConfig.shulkerCount) {
|
||||
+ int amount = Math.min(otherStack.getCount(), ContainerExpansionConfig.shulkerCount - selfStack.getCount());
|
||||
+
|
||||
+ selfStack.grow(amount);
|
||||
+ self.setItem(selfStack);
|
||||
+
|
||||
+ self.pickupDelay = Math.max(other.pickupDelay, self.pickupDelay);
|
||||
+ self.age = Math.min(other.getAge(), self.age);
|
||||
+
|
||||
+ otherStack.shrink(amount);
|
||||
+ if (otherStack.isEmpty()) {
|
||||
+ other.discard();
|
||||
+ } else {
|
||||
+ other.setItem(otherStack);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getMaxServerStackCount(ItemStack stack) {
|
||||
+ if (stack.getItem() instanceof BlockItem bi &&
|
||||
+ bi.getBlock() instanceof ShulkerBoxBlock && (ContainerExpansionConfig.nbtShulkerStackable || shulkerBoxNoItem(stack))) {
|
||||
+ return ContainerExpansionConfig.shulkerCount;
|
||||
+ }
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 18 Feb 2026 00:15:08 +0800
|
||||
Subject: [PATCH] Leaves: Fakeplayer
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java b/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||
index 0a20c6f03625391201e5ced167707e54ed27daa1..2872b22e44cba48442c526f0a53e1fc6c5ce760f 100644
|
||||
--- a/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||
+++ b/src/main/java/me/earthme/luminol/utils/FoliaServerWaypointManager.java
|
||||
@@ -46,6 +46,12 @@ public class FoliaServerWaypointManager implements WaypointManager<@NotNull Wayp
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Leaves start - fakeplayer
|
||||
+ if (waypoint instanceof org.leavesmc.leaves.bot.ServerBot bot && !bot.getConfigValue(org.leavesmc.leaves.bot.agent.Configs.ENABLE_LOCATOR_BAR)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Leaves end - fakeplayer
|
||||
+
|
||||
this.waypoints.add(waypoint);
|
||||
|
||||
for (ServerPlayer toCreateFor : this.trackingPlayers) {
|
||||
@@ -101,7 +107,13 @@ public class FoliaServerWaypointManager implements WaypointManager<@NotNull Wayp
|
||||
scheduleIfOffTarget(player, () -> {
|
||||
this.trackingPlayers.add(player);
|
||||
|
||||
- for (WaypointTransmitter transmitter : this.waypoints) {
|
||||
+ // Leaves start - fakeplayer
|
||||
+ if (player instanceof org.leavesmc.leaves.bot.ServerBot) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Leaves end - fakeplayer
|
||||
+
|
||||
+ for (WaypointTransmitter transmitter : this.waypoints) {
|
||||
this.createConnection(player, transmitter);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java b/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
index 8f0548908a9e43ce29c4476f2707f6898e540aec..8b7c66785a06eb4782de0b0a9b542221d6258220 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
@@ -11,14 +11,7 @@ public class ServerFeatureManager implements FeatureManager {
|
||||
private final Set<String> availableFeatures = new HashSet<>();
|
||||
|
||||
private ServerFeatureManager() {
|
||||
- if (false) { // Luminol not provide this
|
||||
- availableFeatures.addAll(Set.of(
|
||||
- FAKEPLAYER,
|
||||
- PHOTOGRAPHER,
|
||||
- BYTEBUF,
|
||||
- UPDATE_SUPPRESSION_EVENT
|
||||
- ));
|
||||
- }
|
||||
+ availableFeatures.add(FAKEPLAYER); // Lophine - fakeplayer support
|
||||
if (Boolean.getBoolean("leavesclip.enable.mixin")) {
|
||||
availableFeatures.add(MIXIN);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 17 May 2026 05:33:21 +0800
|
||||
Subject: [PATCH] Leaves: Replay Mod API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java b/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
index 8b7c66785a06eb4782de0b0a9b542221d6258220..1f3fe7f786bb8f7c59e3a0235dcc572f3171ee6b 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/plugin/ServerFeatureManager.java
|
||||
@@ -12,6 +12,7 @@ public class ServerFeatureManager implements FeatureManager {
|
||||
|
||||
private ServerFeatureManager() {
|
||||
availableFeatures.add(FAKEPLAYER); // Lophine - fakeplayer support
|
||||
+ availableFeatures.add(PHOTOGRAPHER); // Lophine - Replay Mod API support
|
||||
if (Boolean.getBoolean("leavesclip.enable.mixin")) {
|
||||
availableFeatures.add(MIXIN);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Bacteriawa <A3167717663@hotmail.com>
|
||||
Date: Sun, 22 Mar 2026 01:39:17 +0800
|
||||
Subject: [PATCH] Carpet features
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
index f5fb4e210c07f32e52eb8c1ba166d1571a6778c7..e990c147e1b632ef5a33e4f3c37b5cd608040ac7 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
@@ -25,6 +25,13 @@ public class ConfigManager {
|
||||
public static void initConfigs() {
|
||||
configfiles.put("luminol", ConfigsInstance.of("luminol", "me.earthme.luminol.config.modules"));
|
||||
configfiles.put("lophine", ConfigsInstance.of("lophine", "fun.bm.lophine.config.modules")); // add lophine global config
|
||||
+ configfiles.put("lophine_carpet", ConfigsInstance.of(
|
||||
+ new java.io.File("lophine_config"),
|
||||
+ "lophine_carpet",
|
||||
+ "lophine_carpet_config.toml",
|
||||
+ "lophinecarpetconfig",
|
||||
+ "fun.bm.lophine.carpet.config.modules"
|
||||
+ )); // add lophine carpet config
|
||||
preLoad();
|
||||
}
|
||||
|
||||
+6
-6
@@ -5,7 +5,7 @@ Subject: [PATCH] Server I18n
|
||||
|
||||
|
||||
diff --git a/net/minecraft/locale/Language.java b/net/minecraft/locale/Language.java
|
||||
index 47cd33bce908744e64356b585853d6a8ecf82443..bb4011d3c6a1d2a5aa66e68fe719cd5eea2c0dd2 100644
|
||||
index 49c7f8194be8222e329fc3215a6aa6db0b221b11..c6c968d28e0d14a4c50e66bdd5176a000944b707 100644
|
||||
--- a/net/minecraft/locale/Language.java
|
||||
+++ b/net/minecraft/locale/Language.java
|
||||
@@ -37,6 +37,7 @@ public abstract class Language {
|
||||
@@ -24,12 +24,12 @@ index 47cd33bce908744e64356b585853d6a8ecf82443..bb4011d3c6a1d2a5aa66e68fe719cd5e
|
||||
+ public static void parseTranslations(final BiConsumer<String, String> output, final String path) { // Lophine - private -> public
|
||||
try (InputStream stream = Language.class.getResourceAsStream(path)) {
|
||||
loadFromJson(stream, output);
|
||||
} catch (IOException | JsonParseException e) {
|
||||
} catch (JsonParseException | IOException var7) {
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index 4385488983a7544eb6d9193d913dc55294f4620d..9269f9918c4f1eda8ae9cc487da2826ca09a10fb 100644
|
||||
index 5b46b224bb0fea3a7e0f721ce9770657ffe0c71d..44d594da98615a8bbfb2560e0a63d2e7aab3cc7e 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -167,6 +167,8 @@ public class Main {
|
||||
@@ -154,6 +154,8 @@ public class Main {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ index 4385488983a7544eb6d9193d913dc55294f4620d..9269f9918c4f1eda8ae9cc487da2826c
|
||||
String awtException = io.papermc.paper.util.ServerEnvironment.awtDependencyCheck();
|
||||
if (awtException != null) {
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 81934fb56744dbbb3fdd100e8ec83cb634034d04..2dae0f4249eade60ac55c9fa289dd146dc3675e1 100644
|
||||
index 3707b03b6d7ebdf47a38f4feff5b738eb41f38e1..1bc1e9a77dca7acfe5f989f6439f185d0d2e20a6 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -239,6 +239,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -283,6 +283,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
me.earthme.luminol.config.ConfigManager.loadConfigFiles(); // Luminol - load config file
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 12 Aug 2026 03:44:13 +0800
|
||||
Subject: [PATCH] Set Lophine logo
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/gui/MinecraftServerGui.java b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 79518cbca7760f710130509d93d27fb017d67159..05d17e35803adacb6efb594ad90d6254f4a1b09c 100644
|
||||
--- a/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -58,7 +58,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
// Paper start - Improve ServerGUI
|
||||
frame.setName("Minecraft server");
|
||||
try {
|
||||
- frame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("folia-logo.png"))));
|
||||
+ frame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("lophine-logo.png"))));
|
||||
} catch (java.io.IOException ignore) {
|
||||
}
|
||||
// Paper end - Improve ServerGUI
|
||||
+39
-17
@@ -1,28 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 2 Jul 2025 23:36:25 +0800
|
||||
Subject: [PATCH] Add back read-only datapack command & Fix datapack command
|
||||
save function
|
||||
Subject: [PATCH] Fix datapack command save function
|
||||
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 9b1dcfadd6d5ae868b087a18983d03e8bb86b56a..21f2b9866e1cf36421e10a945fb6fbaa251009ed 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -205,7 +205,7 @@ public class Commands {
|
||||
if(me.earthme.luminol.config.modules.experiment.CommandConfig.data) { // Luminol - Config for data command
|
||||
DataCommands.register(this.dispatcher); // Folia - region threading - TODO // Luminol - Config for data command
|
||||
} // Luminol - Config for data command
|
||||
- //DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
+ DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO // Luminol - Add back read-only datapack command
|
||||
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
DefaultGameModeCommands.register(this.dispatcher);
|
||||
//DialogCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index daf45761bdc88848ba81b7595b5abd5635dfd607..b9ff4628421ba0c5bdaec13c9dc1b35e8d194d92 100644
|
||||
index 35c1b7f40563823401ca204ec41ef57220b5ad55..f993a4de22558e7b9598aa7500cd3cc1225e4c5b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2428,6 +2428,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2472,6 +2472,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return this.reloadResources(packsToEnable, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
||||
}
|
||||
|
||||
@@ -39,6 +25,42 @@ index daf45761bdc88848ba81b7595b5abd5635dfd607..b9ff4628421ba0c5bdaec13c9dc1b35e
|
||||
public CompletableFuture<Void> reloadResources(
|
||||
final Collection<String> packsToEnable, final io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause
|
||||
) {
|
||||
diff --git a/net/minecraft/server/commands/DataPackCommand.java b/net/minecraft/server/commands/DataPackCommand.java
|
||||
index 0c7c829270d3cd3dd05a3dc7dfe82ee01d5c6bd8..04fa1c5bb1c0b025a56941aae7d2151d1087e257 100644
|
||||
--- a/net/minecraft/server/commands/DataPackCommand.java
|
||||
+++ b/net/minecraft/server/commands/DataPackCommand.java
|
||||
@@ -98,7 +98,7 @@ public class DataPackCommand {
|
||||
dispatcher.register(
|
||||
Commands.literal("datapack")
|
||||
.requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS))
|
||||
- /*.then( // Luminol - Add back read-only datapack command
|
||||
+ .then(
|
||||
Commands.literal("enable")
|
||||
.then(
|
||||
Commands.argument("name", StringArgumentType.string())
|
||||
@@ -145,11 +145,11 @@ public class DataPackCommand {
|
||||
.suggests(SELECTED_PACKS)
|
||||
.executes(c -> disablePack(c.getSource(), getPack(c, "name", false)))
|
||||
)
|
||||
- )*/ // Luminol - Add back read-only datapack command
|
||||
+ )
|
||||
.then(
|
||||
Commands.literal("list")
|
||||
.executes(c -> listPacks(c.getSource()))
|
||||
- //.then(Commands.literal("available").executes(c -> listAvailablePacks(c.getSource()))) // Luminol - Add back read-only datapack command
|
||||
+ .then(Commands.literal("available").executes(c -> listAvailablePacks(c.getSource()))) // Luminol - Add back read-only datapack command
|
||||
.then(Commands.literal("enabled").executes(c -> listEnabledPacks(c.getSource())))
|
||||
)
|
||||
.then(
|
||||
@@ -235,7 +235,7 @@ public class DataPackCommand {
|
||||
}
|
||||
|
||||
private static int listPacks(final CommandSourceStack source) {
|
||||
- return listEnabledPacks(source) ;// + listAvailablePacks(source); // Luminol - Add back read-only datapack command
|
||||
+ return listEnabledPacks(source) + listAvailablePacks(source);
|
||||
}
|
||||
|
||||
private static int listAvailablePacks(final CommandSourceStack source) {
|
||||
diff --git a/net/minecraft/server/commands/ReloadCommand.java b/net/minecraft/server/commands/ReloadCommand.java
|
||||
index 80fef4277b9e986c17a4cb895e130726bdb63229..4bed8d0432508cbe5c0d1fc7d68052ec2af7260f 100644
|
||||
--- a/net/minecraft/server/commands/ReloadCommand.java
|
||||
@@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 14 Jun 2026 18:10:20 +0800
|
||||
Subject: [PATCH] Luminol Config System
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index 693ce1c23c7be6406eda22da57aa4a1b86a08f5f..4385488983a7544eb6d9193d913dc55294f4620d 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -110,6 +110,7 @@ public class Main {
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
+ me.earthme.luminol.config.ConfigManager.initConfigs(); // Luminol - Luminol config
|
||||
io.papermc.paper.plugin.PluginInitializerManager.load(options); // Paper
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index be15a671e0b39b455cd5983f4b90f8f3022a2ebc..56d26866cb8f413684e62558e5609b273efb8552 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1168,6 +1168,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ca.spottedleaf.moonrise.common.util.MoonriseCommon.haltExecutors();
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
+ // Luminol start - Config Systems
|
||||
+ me.earthme.luminol.config.ConfigManager.saveConfigs(false);
|
||||
+ // Luminol end
|
||||
// Paper start - Improved watchdog support - move final shutdown items here
|
||||
Util.shutdownExecutors();
|
||||
this.onServerExit();
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index cd5551c0221ad2a7b5c7d452d8d91ffc9711c3ee..1ad4704523a3d90414ac514488207b1b5def9afd 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -238,6 +238,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
+ me.earthme.luminol.config.ConfigManager.loadConfigFiles(); // Luminol - load config file
|
||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
@@ -1,45 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 28 Jun 2026 17:56:30 +0800
|
||||
Subject: [PATCH] Correct player respawn place
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 16f49ae6736c475207f31392307e280ec06edbc3..a2e40bc7a15ba0663314a288f4a9b3ec3a39dc4d 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -511,8 +511,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);
|
||||
}
|
||||
@@ -523,10 +525,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
|
||||
private static BlockPos findSpawnAround(ServerLevel world, BlockPos selected) {
|
||||
+ // Luminol start - Correct player respawn place
|
||||
+ BlockPos inChunk = PlayerSpawnFinder.getLevelRespawnPos(world, selected.getX(), selected.getZ());
|
||||
+ if (inChunk != null) {
|
||||
+ AABB checkVolume = PlayerSpawnFinder.PLAYER_DIMENSIONS.makeBoundingBox((double)inChunk.getX() + 0.5, (double)inChunk.getY(), (double)inChunk.getZ() + 0.5);
|
||||
+
|
||||
+ if (world.noCollision(null, checkVolume, true)) {
|
||||
+ 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 = PlayerSpawnFinder.getLevelRespawnPos(world, selected.getX() + dx, selected.getZ() + dz);
|
||||
+ inChunk = PlayerSpawnFinder.getLevelRespawnPos(world, selected.getX() + dx, selected.getZ() + dz); // Luminol - Correct player respawn place
|
||||
if (inChunk == null) {
|
||||
continue;
|
||||
}
|
||||
+19
-19
@@ -8,7 +8,7 @@ As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/dc46f46d28dcdcaf33bb
|
||||
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/dc46f46d28dcdcaf33bb533f9571a107db98c1d7/LICENSE)
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index a98c9b287885e2c353cf75dbb7f004cf67c0d802..1dcb4fe3e2c250554e4f065caf21b37ea659e621 100644
|
||||
index 63b81f30b8d813a7986ae72842fdc2d3097fa103..527c495bb4f6007aee760b99cc0e9aa589931f4b 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -961,6 +961,10 @@ public abstract class PlayerList {
|
||||
@@ -23,10 +23,10 @@ index a98c9b287885e2c353cf75dbb7f004cf67c0d802..1dcb4fe3e2c250554e4f065caf21b37e
|
||||
|
||||
// Paper start - whitelist verify event / login event
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index 5e4f2061aecef57d89acc456acfc347953a386aa..e7b6c83a4e7bd83f6c5a1d772c42c51bf1d1bed1 100644
|
||||
index c157aa170d5879206810f4852a96120396b69db7..b9cc33198efceb75dfef333c018b1296944451cb 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -175,6 +175,7 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
@@ -174,6 +174,7 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
public float hurtDir;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
@@ -94,15 +94,15 @@ index 4df3a32faf85595372f4b250482d852c985ea3ab..101b3711bfb98888837ebed323561cac
|
||||
this.activeChest = activeChest;
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/EnderChestBlock.java b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
index f1a5b9670dd04b800a8d755f32364458a16d924a..bfc34508937befc0f7610176ebe625563f7a4fe0 100644
|
||||
index 24a2c411da0ebbb7f97d621bb76ff686621f9aae..a9f511a549681a76a962855c26b9af5980f36df7 100644
|
||||
--- a/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
+++ b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
@@ -90,7 +90,15 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
// Paper start - Fix InventoryOpenEvent cancellation - moved up;
|
||||
container.setActiveChest(enderChest); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
|
||||
if (level instanceof ServerLevel serverLevel && player.openMenu(
|
||||
- new SimpleMenuProvider((containerId, inventory, p) -> ChestMenu.threeRows(containerId, inventory, container), CONTAINER_TITLE)
|
||||
+ new SimpleMenuProvider(
|
||||
@@ -88,7 +88,15 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
// Paper start - Fix InventoryOpenEvent cancellation - moved up;
|
||||
container.setActiveChest(enderChest); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
|
||||
if (level instanceof ServerLevel serverLevel && player.openMenu(
|
||||
- new SimpleMenuProvider((containerId, inventory, p) -> ChestMenu.threeRows(containerId, inventory, container), CONTAINER_TITLE)
|
||||
+ new SimpleMenuProvider(
|
||||
+ (containerId, inventory, p) -> switch (fun.bm.lophine.config.modules.function.ContainerExpansionConfig.enderchestRows) {
|
||||
+ case 6 -> ChestMenu.sixRows(containerId, inventory, container);
|
||||
+ case 5 -> ChestMenu.fiveRows(containerId, inventory, container);
|
||||
@@ -111,14 +111,14 @@ index f1a5b9670dd04b800a8d755f32364458a16d924a..bfc34508937befc0f7610176ebe62556
|
||||
+ case 1 -> ChestMenu.oneRow(containerId, inventory, container);
|
||||
+ default -> ChestMenu.threeRows(containerId, inventory, container);
|
||||
+ }, CONTAINER_TITLE) // Purpur - Barrels and enderchests 6 rows
|
||||
).isPresent()) {
|
||||
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
).isPresent()) {
|
||||
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index 00aa2d0269f636f6e4c12c1be98cf901e9be8558..e8c83037700a179a43b0dc3882a67622a2e95640 100644
|
||||
index 61e39a18c0fba22699750e5c0187d19a0433b9a2..98c48426fcbb4aeba479e87ab27b03e17b50d7f5 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -59,7 +59,17 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -60,7 +60,17 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
}
|
||||
// CraftBukkit end
|
||||
private static final Component DEFAULT_NAME = Component.translatable("container.barrel");
|
||||
@@ -135,9 +135,9 @@ index 00aa2d0269f636f6e4c12c1be98cf901e9be8558..e8c83037700a179a43b0dc3882a67622
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
|
||||
// Paper start - delay open/close callbacks
|
||||
@Override
|
||||
@@ -118,7 +128,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
{
|
||||
Objects.requireNonNull(BarrelBlockEntity.this);
|
||||
@@ -123,7 +133,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
@@ -155,7 +155,7 @@ index 00aa2d0269f636f6e4c12c1be98cf901e9be8558..e8c83037700a179a43b0dc3882a67622
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,7 +158,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -144,7 +163,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
|
||||
@Override
|
||||
protected AbstractContainerMenu createMenu(final int containerId, final Inventory inventory) {
|
||||
+6
-6
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config to disable some check for operators
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4be8ef7acd34c4768a86422063eb07075d35583c..57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5 100644
|
||||
index aa9e99358e5f3a5d07d9902708bcfa6255d26b97..47beff71ed33e7fbd6fe6cd47aa955233af41f04 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -402,7 +402,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -399,7 +399,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.tickCount++;
|
||||
this.knownMovePacketCount = this.receivedMovePacketCount;
|
||||
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
|
||||
@@ -17,7 +17,7 @@ index 4be8ef7acd34c4768a86422063eb07075d35583c..57c2748dccf3bcb4f8464f3bc0fe3df3
|
||||
// LOGGER.warn("{} was kicked for floating too long!", this.player.getPlainTextName()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect()
|
||||
this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_PLAYER); // Paper - use configurable kick message & kick event cause
|
||||
return true;
|
||||
@@ -421,7 +421,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -418,7 +418,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.vehicleLastGoodY = this.lastVehicle.getY();
|
||||
this.vehicleLastGoodZ = this.lastVehicle.getZ();
|
||||
if (this.clientVehicleIsFloating && this.lastVehicle.getControllingPassenger() == this.player) {
|
||||
@@ -26,7 +26,7 @@ index 4be8ef7acd34c4768a86422063eb07075d35583c..57c2748dccf3bcb4f8464f3bc0fe3df3
|
||||
// LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getPlainTextName()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect()
|
||||
this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_VEHICLE); // Paper - use configurable kick message & kick event cause
|
||||
return true;
|
||||
@@ -674,7 +674,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -671,7 +671,7 @@ public class ServerGamePacketListenerImpl
|
||||
zDist = targetZ - vehicle.getZ();
|
||||
movedDist = xDist * xDist + yDist * yDist + zDist * zDist;
|
||||
boolean fail = false;
|
||||
@@ -35,7 +35,7 @@ index 4be8ef7acd34c4768a86422063eb07075d35583c..57c2748dccf3bcb4f8464f3bc0fe3df3
|
||||
fail = true;
|
||||
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", vehicle.getPlainTextName(), this.player.getPlainTextName(), Math.sqrt(movedDist));
|
||||
}
|
||||
@@ -1620,7 +1620,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1603,7 +1603,7 @@ public class ServerGamePacketListenerImpl
|
||||
// Paper start - Add fail move event
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
||||
targetX, targetY, targetZ, targetYRot, targetXRot, true);
|
||||
@@ -44,7 +44,7 @@ index 4be8ef7acd34c4768a86422063eb07075d35583c..57c2748dccf3bcb4f8464f3bc0fe3df3
|
||||
if (event.getLogWarning()) {
|
||||
LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getPlainTextName(), xDist, yDist, zDist);
|
||||
}
|
||||
@@ -1686,7 +1686,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1682,7 +1682,7 @@ public class ServerGamePacketListenerImpl
|
||||
// Paper start - Add fail move event
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY,
|
||||
targetX, targetY, targetZ, targetYRot, targetXRot, true);
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:01:59 +0800
|
||||
Subject: [PATCH] Correct volatile reference get in RegionizedTaskQueue
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedTaskQueue.java b/io/papermc/paper/threadedregions/RegionizedTaskQueue.java
|
||||
index d1a045d47dcd12f246d95ecdfc202da357897cbf..b264dbd13a392cde3f24ff75c0034985fda68ccc 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedTaskQueue.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedTaskQueue.java
|
||||
@@ -533,7 +533,7 @@ public final class RegionizedTaskQueue {
|
||||
}
|
||||
|
||||
private ReferenceCountData getReferenceCounterVolatile() {
|
||||
- return (ReferenceCountData)REFERENCE_COUNTER_HANDLE.get(this);
|
||||
+ return (ReferenceCountData)REFERENCE_COUNTER_HANDLE.getVolatile(this); // Luminol - Correct volatile reference get in RegionizedTaskQueue
|
||||
}
|
||||
|
||||
private ReferenceCountData compareAndExchangeReferenceCounter(final ReferenceCountData expect, final ReferenceCountData update) {
|
||||
+16
-15
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config to enable save-all command
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index a96da8ab0d8ca8241df79fbfca33f3e6072db367..f881d10d63a665a73aefe03ba1305ca9ae956513 100644
|
||||
index 3416445888860746c15a978f401c87245609b64a..fc6402dd0a47f5b2792aa8a21703bfee18dd2388 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -265,6 +265,8 @@ public final class RegionizedServer {
|
||||
@@ -359,6 +359,8 @@ public final class RegionizedServer {
|
||||
// tick player ping sample
|
||||
this.tickPlayerSample();
|
||||
|
||||
@@ -18,7 +18,7 @@ index a96da8ab0d8ca8241df79fbfca33f3e6072db367..f881d10d63a665a73aefe03ba1305ca9
|
||||
for (final ServerLevel world : this.worlds) {
|
||||
this.globalTick(world, tickCount);
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegions.java b/io/papermc/paper/threadedregions/TickRegions.java
|
||||
index 97c514673a454b752ab86b944fd143725ca8090d..ba91d40d6d91588a4b39abfefcb17a362bfc5490 100644
|
||||
index 02c004bc7f9a0203523ce4b27cd766d6bdc478c0..3d86e21198f2888422330b6f7c27712f40a6aabc 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegions.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegions.java
|
||||
@@ -190,6 +190,8 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
|
||||
@@ -31,10 +31,10 @@ index 97c514673a454b752ab86b944fd143725ca8090d..ba91d40d6d91588a4b39abfefcb17a36
|
||||
private final Reference2ReferenceOpenHashMap<RegionizedData<?>, Object> regionizedData = new Reference2ReferenceOpenHashMap<>();
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 5a5f7f7fefacaa0d77ec389d6eb332eff519496a..f0f6175569100589102d9d76b3ff8f5546030060 100644
|
||||
index bcb1a5ec17269529ef0f9556043a7183df846eab..4503e62a72e67d35db5b091c91e903058157bdbd 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -299,7 +299,11 @@ public class Commands {
|
||||
@@ -295,7 +295,11 @@ public class Commands {
|
||||
PardonCommand.register(this.dispatcher);
|
||||
PardonIpCommand.register(this.dispatcher);
|
||||
//PerfCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
@@ -48,10 +48,10 @@ index 5a5f7f7fefacaa0d77ec389d6eb332eff519496a..f0f6175569100589102d9d76b3ff8f55
|
||||
SaveOnCommand.register(this.dispatcher);
|
||||
SetPlayerIdleTimeoutCommand.register(this.dispatcher);
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 908cff4caa1457e07d809fb793d00d367ae42320..143b7a167dcbf015a7318f2fe5e0798418fa2572 100644
|
||||
index f993a4de22558e7b9598aa7500cd3cc1225e4c5b..82315368d5580563fc77548f22a65d04ec73b622 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1651,6 +1651,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1683,6 +1683,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Folia start - region threading
|
||||
public void tickServer(final long startTime, final long scheduledEnd, final long targetBuffer,
|
||||
final io.papermc.paper.threadedregions.TickRegions.TickRegionData region) {
|
||||
@@ -64,10 +64,10 @@ index 908cff4caa1457e07d809fb793d00d367ae42320..143b7a167dcbf015a7318f2fe5e07984
|
||||
// Folia end - region threading
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
diff --git a/net/minecraft/server/commands/SaveAllCommand.java b/net/minecraft/server/commands/SaveAllCommand.java
|
||||
index 299991905c24a7018f8ac60d0c16e56fa43cd710..39c1b67e457c26a7e8d87be21658bbe6e802440c 100644
|
||||
index bc6d01996dde0870f6ebbda14176352777938a0c..8314d239435debf7aff947b7dd3bab83e3c80dc6 100644
|
||||
--- a/net/minecraft/server/commands/SaveAllCommand.java
|
||||
+++ b/net/minecraft/server/commands/SaveAllCommand.java
|
||||
@@ -22,14 +22,21 @@ public class SaveAllCommand {
|
||||
@@ -21,7 +21,9 @@ public class SaveAllCommand {
|
||||
}
|
||||
|
||||
private static int saveAll(final CommandSourceStack source, final boolean flush) throws CommandSyntaxException {
|
||||
@@ -78,12 +78,13 @@ index 299991905c24a7018f8ac60d0c16e56fa43cd710..39c1b67e457c26a7e8d87be21658bbe6
|
||||
MinecraftServer server = source.getServer();
|
||||
boolean success = server.saveEverything(true, flush, true);
|
||||
if (!success) {
|
||||
throw ERROR_FAILED.create();
|
||||
}
|
||||
|
||||
- source.sendSuccess(() -> Component.translatable("commands.save.success"), true);
|
||||
+ source.sendSuccess(() -> Component.translatable("commands.save.success"), true);*/
|
||||
return Command.SINGLE_SUCCESS;
|
||||
@@ -29,6 +31,12 @@ public class SaveAllCommand {
|
||||
} else {
|
||||
source.sendSuccess(() -> Component.translatable("commands.save.success"), true);
|
||||
return 1;
|
||||
- }
|
||||
+ }*/
|
||||
+ return 1;
|
||||
}
|
||||
+
|
||||
+ public static SimpleCommandExceptionType getErrorFailed() {
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Tue, 30 Jun 2026 22:34:00 +0800
|
||||
Subject: [PATCH] Correct thread unsafe random sources
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
||||
index 01b3cda3da79abd30860eb33491ac00f9e958767..dd35e72757b1be1a73e67b272c138bb4e3b6336a 100644
|
||||
--- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
||||
+++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
||||
@@ -30,7 +30,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
||||
private static final int SPAWN_CHANCE_INCREASE = 25;
|
||||
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
|
||||
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
|
||||
- private final RandomSource random = RandomSource.create();
|
||||
+ private final RandomSource random = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Luminol - Correct thread unsafe random sources
|
||||
private final SavedDataStorage savedDataStorage;
|
||||
// Folia - moved to global data
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
||||
index 22b9f70f76ff8f592359e958fa439e9806a29fcc..818598ed4e498bf3f177faac03336097b41915ee 100644
|
||||
--- a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
||||
@@ -28,7 +28,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
|
||||
public float rot;
|
||||
public float oRot;
|
||||
public float tRot;
|
||||
- private static final RandomSource RANDOM = RandomSource.create();
|
||||
+ private static final RandomSource RANDOM = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Luminol - Correct thread unsafe random sources
|
||||
private @Nullable Component name;
|
||||
|
||||
public EnchantingTableBlockEntity(final BlockPos worldPosition, final BlockState blockState) {
|
||||
+23
-23
@@ -5,28 +5,28 @@ 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 82ffe2cd08f3187a69d81b65d6903c5b8deeba0d..dcd1b874b68bc2e780f5a5a2ba8ac7a6a16a65f4 100644
|
||||
index 6cedc129f31289eaf4e3580219fc1988c0f3c5a1..5f1fad59a26e3fe29f9000a92be5d6c4422dcd01 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1448,6 +1448,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1464,6 +1464,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.awardStat(Stats.ENTITY_KILLED_BY.get(killer.getType()));
|
||||
killer.awardKillScore(this, source);
|
||||
this.createWitherRose(killer);
|
||||
+ // Lophine Start - Cross Region Damage trace
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ } else if (fun.bm.lophine.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
|
||||
+ if (entitylivingnew != null) {
|
||||
+ this.damageTransferToAsync(entitylivingnew, source);
|
||||
+ }
|
||||
+ // Lophine End - Cross Region Damage trace
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
}
|
||||
|
||||
this.level().broadcastEntityEvent(this, EntityEvent.DEATH);
|
||||
@@ -1462,6 +1469,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.connection.markClientUnloadedAfterDeath();
|
||||
@@ -1487,6 +1494,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
// Leaves end - exp fix
|
||||
|
||||
+ // Lophine Start - Cross Region Damage trace
|
||||
+ // 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()));
|
||||
@@ -42,34 +42,34 @@ index 82ffe2cd08f3187a69d81b65d6903c5b8deeba0d..dcd1b874b68bc2e780f5a5a2ba8ac7a6
|
||||
+ }
|
||||
+ }, null, 1L);
|
||||
+ }
|
||||
+ // Lophine End - Cross Region Damage trace
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
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 fcaeb471dada57e9ba4d224693cefbff2fa631be..5762eed9e99d918bee02d77c0ddd70be0aa0e2ec 100644
|
||||
index 17483ffff6cb2a9e86db7079e7c3a9a800654c62..29919b8f3c05c8ffaf66f86e441778eeefb293b1 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1855,6 +1855,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
Runnable afterEvent = () -> { // Paper
|
||||
@@ -1961,6 +1961,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
final LivingEntity killer = this.getKillCredit();
|
||||
if (killer != null) {
|
||||
killer.awardKillScore(this, source);
|
||||
+ // Lophine Start - Cross Region Damage trace
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ } else if (fun.bm.lophine.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ final LivingEntity killernew = this.getKillCreditOrigin();
|
||||
+ if (killernew != null) {
|
||||
+ this.damageTransferToAsync(killernew, source);
|
||||
+ }
|
||||
+ // Lophine End - Cross Region Damage trace
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
}
|
||||
|
||||
if (this.isSleeping()) {
|
||||
@@ -1943,6 +1950,19 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
this.postDeathEventTasks.add(() -> this.dropExperience(level, source.getEntity())); // Paper
|
||||
}); // Paper end
|
||||
this.postDeathDropItems(deathEvent); // Paper
|
||||
@@ -1971,6 +1978,19 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
return deathEvent; // Paper
|
||||
}
|
||||
|
||||
+ // Lophine Start - Cross Region Damage trace
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ private void damageTransferToAsync(LivingEntity entity, DamageSource damageSource) {
|
||||
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
|
||||
+ try {
|
||||
@@ -80,16 +80,16 @@ index fcaeb471dada57e9ba4d224693cefbff2fa631be..5762eed9e99d918bee02d77c0ddd70be
|
||||
+ }
|
||||
+ }, null, 1L );
|
||||
+ }
|
||||
+ // Lophine End - Cross Region Damage trace
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
protected void dropEquipment(final ServerLevel level) {
|
||||
}
|
||||
|
||||
@@ -2609,6 +2629,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
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
|
||||
@@ -2629,6 +2649,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
+ // Lophine Start - Cross Region Damage trace
|
||||
+ // Luminol Start - Cross Region Damage trace
|
||||
+ @Nullable
|
||||
+ public LivingEntity getKillCreditOrigin() {
|
||||
+ if (this.lastHurtByPlayer != null) {
|
||||
@@ -99,7 +99,7 @@ index fcaeb471dada57e9ba4d224693cefbff2fa631be..5762eed9e99d918bee02d77c0ddd70be
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Lophine End - Cross Region Damage trace
|
||||
+ // Luminol End - Cross Region Damage trace
|
||||
+
|
||||
public final float getMaxHealth() {
|
||||
return (float)this.getAttributeValue(Attributes.MAX_HEALTH);
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Thu, 2 Jul 2026 22:31:15 +0800
|
||||
Subject: [PATCH] Correct portal logic of some projectile entities
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/projectile/ShulkerBullet.java b/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
||||
index d5506bfc84912ec50cd5391225b9b5291435d3aa..6339a770526324bdc1bcc0c0e3bacc0a10f359ab 100644
|
||||
--- a/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
||||
@@ -229,7 +229,7 @@ public class ShulkerBullet extends Projectile {
|
||||
this.setPos(this.position().add(movement));
|
||||
this.applyEffectsFromBlocks();
|
||||
if (this.portalProcess != null && this.portalProcess.isInsidePortalThisTick()) {
|
||||
- this.handlePortal();
|
||||
+ if (this.handlePortal()) return; // Luminol - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
|
||||
}
|
||||
|
||||
if (hitResult != null && this.isAlive() && hitResult.getType() != HitResult.Type.MISS) {
|
||||
diff --git a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java
|
||||
index 88c2f0f927bd8376522eb9aed184abd6f09230f6..d66a4826400eca835645e1115c4fefc61715f336 100644
|
||||
--- a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java
|
||||
@@ -276,7 +276,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
.clipIncludingBorder(
|
||||
new ClipContext(originalPosition, originalPosition.add(movement), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)
|
||||
);
|
||||
- this.stepMoveAndHit(blockHitResult);
|
||||
+ if (this.stepMoveAndHit(blockHitResult)) return; // Luminol - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
|
||||
} else {
|
||||
this.setPos(originalPosition.add(movement));
|
||||
this.applyEffectsFromBlocks();
|
||||
@@ -299,7 +299,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
return 0.99F;
|
||||
}
|
||||
|
||||
- private void stepMoveAndHit(final BlockHitResult blockHitResult) {
|
||||
+ private boolean stepMoveAndHit(final BlockHitResult blockHitResult) { // Luminol - Correct portal logic of some projectile entities
|
||||
while (this.isAlive()) {
|
||||
Vec3 initialPosition = this.position();
|
||||
ArrayList<EntityHitResult> entitiesHit = new ArrayList<>(this.findHitEntities(initialPosition, blockHitResult.getLocation()));
|
||||
@@ -309,7 +309,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
this.setPos(nextLocation);
|
||||
this.applyEffectsFromBlocks(initialPosition, nextLocation);
|
||||
if (this.portalProcess != null && this.portalProcess.isInsidePortalThisTick()) {
|
||||
- this.handlePortal();
|
||||
+ if (this.handlePortal()) return true; // Luminol - Correct portal logic of some projectile entities (Should not be ticking anymore after portal logics)
|
||||
}
|
||||
|
||||
if (entitiesHit.isEmpty()) {
|
||||
@@ -327,6 +327,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ return false; // Luminol - Correct portal logic of some projectile entities
|
||||
}
|
||||
|
||||
private ProjectileDeflection hitTargetsOrDeflectSelf(final Collection<EntityHitResult> entityHitResults) {
|
||||
+2
-4
@@ -5,19 +5,17 @@ Subject: [PATCH] Add config to enable function command
|
||||
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index f0f6175569100589102d9d76b3ff8f5546030060..ddd656e147cdaeb8f91865117e6f9c268b0fd9bc 100644
|
||||
index 4503e62a72e67d35db5b091c91e903058157bdbd..86866a9fa92d2e1ac0026e5764f459cc73e0b266 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -217,7 +217,11 @@ public class Commands {
|
||||
@@ -217,7 +217,9 @@ public class Commands {
|
||||
FillCommand.register(this.dispatcher, context);
|
||||
FillBiomeCommand.register(this.dispatcher, context);
|
||||
ForceLoadCommand.register(this.dispatcher);
|
||||
- //FunctionCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
+ // Lophine start - Add config to enable function command
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.function) {
|
||||
+ FunctionCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
+ }
|
||||
+ // Lophine end - Add config to enable function command
|
||||
GameModeCommand.register(this.dispatcher);
|
||||
GameRuleCommand.register(this.dispatcher, context);
|
||||
GiveCommand.register(this.dispatcher, context);
|
||||
-391
@@ -1,391 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 28 Jun 2026 18:54:50 +0800
|
||||
Subject: [PATCH] Anonymous Object: Configurable region format framework
|
||||
|
||||
As requested by the original author, this patch will be anonymous and hide the original commit address.
|
||||
This patch is used with permission from the original author.
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||
index a814512fcfb85312474ae2c2c21443843bf57831..9d69a022872e06b320bee46329cd8889f74fbbaa 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/ChunkSystemRegionFileStorage.java
|
||||
@@ -8,9 +8,9 @@ public interface ChunkSystemRegionFileStorage {
|
||||
|
||||
public boolean moonrise$doesRegionFileNotExistNoIO(final int chunkX, final int chunkZ);
|
||||
|
||||
- public RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ);
|
||||
+ public io.anonymous.anonymous.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // Anonymous - Configurable region file format
|
||||
|
||||
- public RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException;
|
||||
+ public io.anonymous.anonymous.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // Anonymous - Configurable region file format
|
||||
|
||||
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 3bb9b58ee97464687e348e23b99159226415c267..4c3ad63f17bb4a04f982b36ad3f53d3c0f58bdb5 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||
@@ -1273,7 +1273,7 @@ public final class MoonriseRegionFileIO {
|
||||
this.regionDataController.finishWrite(this.chunkX, this.chunkZ, writeData);
|
||||
// Paper start - flush regionfiles on save
|
||||
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
|
||||
- final RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ);
|
||||
+ final io.anonymous.anonymous.data.RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // Anonymous - Configurable region file format
|
||||
if (regionFile != null) {
|
||||
regionFile.flush();
|
||||
} // else: evicted from cache, which should have called flush
|
||||
@@ -1489,7 +1489,7 @@ public final class MoonriseRegionFileIO {
|
||||
|
||||
public static interface IORunnable {
|
||||
|
||||
- public void run(final RegionFile regionFile) throws IOException;
|
||||
+ public void run(final io.anonymous.anonymous.data.RegionFile regionFile) throws IOException; // Anonymous - Configurable region file format
|
||||
|
||||
}
|
||||
}
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||
index 51c126735ace8fdde89ad97b5cab62f244212db0..ea2f45964fb8c617f90938597c230b50d83744aa 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/storage/ChunkSystemChunkBuffer.java
|
||||
@@ -8,5 +8,5 @@ public interface ChunkSystemChunkBuffer {
|
||||
|
||||
public void moonrise$setWriteOnClose(final boolean value);
|
||||
|
||||
- public void moonrise$write(final RegionFile regionFile) throws IOException;
|
||||
+ public void moonrise$write(final io.anonymous.anonymous.data.RegionFile regionFile) throws IOException; // Anonymous - Configurable region file format
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 56d26866cb8f413684e62558e5609b273efb8552..dd63f14cf6b857202146348b2242673af1883cb7 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -986,10 +986,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (flush) {
|
||||
for (ServerLevel level : this.getAllLevels()) {
|
||||
String storageName = level.getChunkSource().chunkMap.getStorageName();
|
||||
- LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", LEGACY_WORLD_NAMES_FOR_REALMS_LOG.getOrDefault(storageName, storageName));
|
||||
+ LOGGER.info("ThreadedChunkStorage ({}): All chunks are saved", LEGACY_WORLD_NAMES_FOR_REALMS_LOG.getOrDefault(storageName, storageName)); // Anonymous - Configurable region format
|
||||
}
|
||||
|
||||
- LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
|
||||
+ LOGGER.info("ThreadedChunkStorage: All dimensions are saved"); // Anonymous - configurable region format
|
||||
}
|
||||
|
||||
return result;
|
||||
diff --git a/net/minecraft/util/worldupdate/FileToUpgrade.java b/net/minecraft/util/worldupdate/FileToUpgrade.java
|
||||
index a7f2cfa9277c898038f6b9e0a3401db51012b64c..7b96f3ec2738875a3ed7aa34347c0f174b6579c5 100644
|
||||
--- a/net/minecraft/util/worldupdate/FileToUpgrade.java
|
||||
+++ b/net/minecraft/util/worldupdate/FileToUpgrade.java
|
||||
@@ -4,5 +4,5 @@ import java.util.List;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.chunk.storage.RegionFile;
|
||||
|
||||
-public record FileToUpgrade(RegionFile file, List<ChunkPos> chunksToUpgrade) {
|
||||
+public record FileToUpgrade(io.anonymous.anonymous.data.RegionFile file, List<ChunkPos> chunksToUpgrade) { // Anonymous - Configurable region file format
|
||||
}
|
||||
diff --git a/net/minecraft/util/worldupdate/RegionStorageUpgrader.java b/net/minecraft/util/worldupdate/RegionStorageUpgrader.java
|
||||
index b228cd6c54e8c8998923ab332882d99092769c67..2dd3d0afd8f58e5e68a361dd38c95da06b4d133b 100644
|
||||
--- a/net/minecraft/util/worldupdate/RegionStorageUpgrader.java
|
||||
+++ b/net/minecraft/util/worldupdate/RegionStorageUpgrader.java
|
||||
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
|
||||
public class RegionStorageUpgrader {
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final String NEW_DIRECTORY_PREFIX = "new_";
|
||||
- private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
|
||||
+ private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\." + me.earthme.luminol.config.modules.function.RegionFormatConfig.regionFormat.getArgument() + "$"); // Anonymous - Configurable region file format
|
||||
private final DataFixer dataFixer;
|
||||
private final UpgradeProgress upgradeProgress;
|
||||
private final String type;
|
||||
@@ -176,7 +176,8 @@ public class RegionStorageUpgrader {
|
||||
int zOffset = Integer.parseInt(regex.group(2)) << 5;
|
||||
List<ChunkPos> chunkPositions = Lists.newArrayList();
|
||||
|
||||
- try (RegionFile regionSource = new RegionFile(info, regionFile.toPath(), regionFolder, true)) {
|
||||
+ var regionFileInfo = new io.anonymous.anonymous.utils.RegionCreatorInfo(info, regionFile.toPath(), regionFolder, true); // Anonymous - Configurable region file format
|
||||
+ try (io.anonymous.anonymous.data.RegionFile regionSource = me.earthme.luminol.config.modules.function.RegionFormatConfig.regionFormat.getCreator().newFile(regionFileInfo)) { // Anonymous - Configurable region file format
|
||||
for (int x = 0; x < 32; x++) {
|
||||
for (int z = 0; z < 32; z++) {
|
||||
ChunkPos pos = new ChunkPos(x + xOffset, z + zOffset);
|
||||
@@ -253,7 +254,7 @@ public class RegionStorageUpgrader {
|
||||
return storage.upgradeChunkTag(chunkTag, this.defaultVersion, this.dataFixContextTag, targetVersion);
|
||||
}
|
||||
|
||||
- private void onFileFinished(final RegionFile regionFile) {
|
||||
+ private void onFileFinished(final io.anonymous.anonymous.data.RegionFile regionFile) { // Anonymous - Configurable region file format
|
||||
if (this.recreateRegionFiles) {
|
||||
if (this.previousWriteFuture != null) {
|
||||
this.previousWriteFuture.join();
|
||||
diff --git a/net/minecraft/world/level/chunk/storage/RegionFile.java b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..821924f85a507589a039832be8657e1dc3c0ce0c 100644
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.world.level.ChunkPos;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
-public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile { // Paper - rewrite chunk system
|
||||
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile , io.anonymous.anonymous.data.RegionFile{ // Paper - rewrite chunk system // Anonymous - Configurable region file format
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final int MAX_CHUNK_SIZE = 500 * 1024 * 1024; // Paper - don't write garbage data to disk if writing serialization fails
|
||||
private static final int SECTOR_BYTES = 4096;
|
||||
@@ -130,7 +130,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
return this.recalculateCount.get();
|
||||
}
|
||||
|
||||
- boolean recalculateHeader() throws IOException {
|
||||
+ public boolean recalculateHeader() throws IOException { // Anonymous - Configurable region file format
|
||||
if (!this.canRecalcHeader) {
|
||||
return false;
|
||||
}
|
||||
@@ -789,7 +789,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
}
|
||||
}
|
||||
|
||||
- protected synchronized void write(final ChunkPos pos, final ByteBuffer data) throws IOException {
|
||||
+ public synchronized void write(final ChunkPos pos, final ByteBuffer data) throws IOException { // Anonymous - Configurable region file format
|
||||
int offsetIndex = getOffsetIndex(pos);
|
||||
int offset = this.offsets.get(offsetIndex);
|
||||
int sectorNumber = getSectorNumber(offset);
|
||||
@@ -907,7 +907,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
}
|
||||
|
||||
@Override
|
||||
- public final void moonrise$write(final RegionFile regionFile) throws IOException {
|
||||
+ public final void moonrise$write(final io.anonymous.anonymous.data.RegionFile regionFile) throws IOException { // Anonymous - Configurable region file format
|
||||
regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count));
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
@@ -973,11 +973,11 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
return (x & 31) + (z & 31) * 32;
|
||||
}
|
||||
|
||||
- synchronized boolean isOversized(int x, int z) {
|
||||
+ public synchronized boolean isOversized(int x, int z) { // Anonymous - Configurable region file format
|
||||
return this.oversized[getChunkIndex(x, z)] == 1;
|
||||
}
|
||||
|
||||
- synchronized void setOversized(int x, int z, boolean oversized) throws IOException {
|
||||
+ public synchronized void setOversized(int x, int z, boolean oversized) throws IOException { // Anonymous - Configurable region file format
|
||||
final int offset = getChunkIndex(x, z);
|
||||
boolean previous = this.oversized[offset] == 1;
|
||||
this.oversized[offset] = (byte) (oversized ? 1 : 0);
|
||||
@@ -1016,7 +1016,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
return this.path.getParent().resolve(this.path.getFileName().toString().replaceAll("\\.mca$", "") + "_oversized_" + x + "_" + z + ".nbt");
|
||||
}
|
||||
|
||||
- synchronized net.minecraft.nbt.CompoundTag getOversizedData(int x, int z) throws IOException {
|
||||
+ public synchronized net.minecraft.nbt.CompoundTag getOversizedData(int x, int z) throws IOException { // Anonymous - Configurable region file format
|
||||
Path file = getOversizedFile(x, z);
|
||||
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new java.util.zip.InflaterInputStream(Files.newInputStream(file))))) {
|
||||
return net.minecraft.nbt.NbtIo.read((java.io.DataInput) out);
|
||||
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index 63b40c420030d935bb81a219fb33defe0946e21f..e0e19f091f6b85d7788259cfcc53cc3db848b68e 100644
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -19,7 +19,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
|
||||
public static final String ANVIL_EXTENSION = ".mca";
|
||||
private static final int MAX_CACHE_SIZE = 256;
|
||||
- private final Long2ObjectLinkedOpenHashMap<RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>();
|
||||
+ private final Long2ObjectLinkedOpenHashMap<io.anonymous.anonymous.data.RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // Anonymous - Configurable region file format
|
||||
private final RegionStorageInfo info;
|
||||
private final Path folder;
|
||||
private final boolean sync;
|
||||
@@ -30,7 +30,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
@Nullable
|
||||
public static ChunkPos getRegionFileCoordinates(Path file) {
|
||||
String fileName = file.getFileName().toString();
|
||||
- if (!fileName.startsWith("r.") || !fileName.endsWith(".mca")) {
|
||||
+ if (!fileName.startsWith("r.") || !fileName.endsWith(getExtensionName())) { // Anonymous - Configurable region file format
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -55,8 +55,32 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
private static final int MAX_NON_EXISTING_CACHE = 1024 * 4;
|
||||
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet nonExistingRegionFiles = new it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet();
|
||||
private static String getRegionFileName(final int chunkX, final int chunkZ) {
|
||||
- return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".mca";
|
||||
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + getExtensionName(); // Anonymous - Configurable region file format
|
||||
}
|
||||
+ // Anonymous start - Configurable region file format
|
||||
+ public static io.anonymous.anonymous.data.RegionFile createNew(RegionStorageInfo info, Path filePath, Path folder, boolean sync) throws IOException{
|
||||
+ final io.anonymous.anonymous.enums.EnumRegionFormat regionFormat = me.earthme.luminol.config.modules.function.RegionFormatConfig.regionFormat;
|
||||
+ final String fullFileName = filePath.getFileName().toString();
|
||||
+ final String[] fullNameSplit = fullFileName.split("\\.");
|
||||
+ final String extensionName = fullNameSplit[fullNameSplit.length - 1];
|
||||
+
|
||||
+ if (!regionFormat.getArgument().equalsIgnoreCase(extensionName)) {
|
||||
+ // raise a delayed crash
|
||||
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(() -> {
|
||||
+ throw new RuntimeException("Invalid region file format: " + extensionName + " expected " + regionFormat.getArgument());
|
||||
+ });
|
||||
+
|
||||
+
|
||||
+ throw new IOException("Invalid region file format: " + extensionName + " expected " + regionFormat.getArgument());
|
||||
+ }
|
||||
+
|
||||
+ return regionFormat.getCreator().newFile(new io.anonymous.anonymous.utils.RegionCreatorInfo(info, filePath, folder, sync));
|
||||
+ }
|
||||
+
|
||||
+ public static String getExtensionName() {
|
||||
+ return "." + me.earthme.luminol.config.modules.function.RegionFormatConfig.regionFormat.getArgument();
|
||||
+ }
|
||||
+ // Anonymous end
|
||||
|
||||
private boolean doesRegionFilePossiblyExist(final long position) {
|
||||
synchronized (this.nonExistingRegionFiles) {
|
||||
@@ -90,15 +114,15 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
}
|
||||
|
||||
@Override
|
||||
- public synchronized final RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) {
|
||||
+ public synchronized final io.anonymous.anonymous.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // Anonymous - Configurable region file format
|
||||
return this.regionCache.getAndMoveToFirst(ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT));
|
||||
}
|
||||
|
||||
@Override
|
||||
- public synchronized final RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException {
|
||||
+ public synchronized final io.anonymous.anonymous.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // Anonymous - Configurable region file format
|
||||
final long key = ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT);
|
||||
|
||||
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
||||
+ io.anonymous.anonymous.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Anonymous - Configurable region file format
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
@@ -124,7 +148,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
FileUtil.createDirectoriesSafe(this.folder);
|
||||
|
||||
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
||||
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Anonymous - Configurable region file format
|
||||
|
||||
this.regionCache.putAndMoveToFirst(key, ret);
|
||||
|
||||
@@ -143,7 +167,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
}
|
||||
|
||||
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
||||
- final RegionFile regionFile = this.getRegionFile(pos);
|
||||
+ final io.anonymous.anonymous.data.RegionFile regionFile = this.getRegionFile(pos); // Anonymous - Configurable region file format
|
||||
|
||||
// note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input
|
||||
// (and, the regionfile parameter is unused for writing until the write call)
|
||||
@@ -177,7 +201,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
) throws IOException {
|
||||
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
||||
if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) {
|
||||
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
||||
+ final io.anonymous.anonymous.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Anonymous - Configurable region file format
|
||||
if (regionFile != null) {
|
||||
regionFile.clear(pos);
|
||||
} // else: didn't exist
|
||||
@@ -192,7 +216,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
public final ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.ReadData moonrise$readData(
|
||||
final int chunkX, final int chunkZ
|
||||
) throws IOException {
|
||||
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
|
||||
+ final io.anonymous.anonymous.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Anonymous - Configurable region file format
|
||||
|
||||
final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ));
|
||||
|
||||
@@ -237,7 +261,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
|
||||
final ChunkPos headerChunkPos = SerializableChunkData.getChunkCoordinate(ret);
|
||||
- final RegionFile regionFile = this.getRegionFile(pos);
|
||||
+ final io.anonymous.anonymous.data.RegionFile regionFile = this.getRegionFile(pos); // Anonymous - Configurable region file format
|
||||
|
||||
if (regionFile.getRecalculateCount() != readData.recalculateCount()) {
|
||||
return null;
|
||||
@@ -261,7 +285,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
// Paper start - rewrite chunk system
|
||||
- public RegionFile getRegionFile(ChunkPos pos) throws IOException {
|
||||
+ public io.anonymous.anonymous.data.RegionFile getRegionFile(ChunkPos pos) throws IOException { // Anonymous - Configurable region file format
|
||||
return this.getRegionFile(pos, false);
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
@@ -273,7 +297,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
this.isChunkData = info.dfuType()[0] == net.minecraft.util.datafix.DataFixTypes.CHUNK; // Paper - recalculate region file headers
|
||||
}
|
||||
|
||||
- @org.jetbrains.annotations.Contract("_, false -> !null") private @Nullable RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit
|
||||
+ @org.jetbrains.annotations.Contract("_, false -> !null") private io.anonymous.anonymous.data.RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit // Anonymous - Configurable region file format
|
||||
// Paper start - rewrite chunk system
|
||||
if (existingOnly) {
|
||||
return this.moonrise$getRegionFileIfExists(pos.x(), pos.z());
|
||||
@@ -281,7 +305,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
synchronized (this) {
|
||||
final long key = ChunkPos.pack(pos.x() >> REGION_SHIFT, pos.z() >> REGION_SHIFT);
|
||||
|
||||
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
|
||||
+ io.anonymous.anonymous.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Anonymous - Configurable region file format
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
@@ -298,7 +322,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
FileUtil.createDirectoriesSafe(this.folder);
|
||||
|
||||
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
|
||||
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Anonymous - Configurable region file format
|
||||
|
||||
this.regionCache.putAndMoveToFirst(key, ret);
|
||||
|
||||
@@ -312,7 +336,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
LOGGER.error("{} ({} - {},{}) Go clean it up to remove this message. /minecraft:tp {} 128 {} - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.", msg, file.toString().replaceAll(".+[\\\\/]", ""), x, z, x << 4, z << 4);
|
||||
}
|
||||
|
||||
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
+ private static CompoundTag readOversizedChunk(io.anonymous.anonymous.data.RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // Anonymous - Configurable region file format
|
||||
synchronized (regionfile) {
|
||||
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x(), chunkCoordinate.z());
|
||||
@@ -346,7 +370,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
public @Nullable CompoundTag read(final ChunkPos pos) throws IOException {
|
||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||
- RegionFile region = this.getRegionFile(pos, true);
|
||||
+ io.anonymous.anonymous.data.RegionFile region = this.getRegionFile(pos, true); // Anonymous - Configurable region file format
|
||||
if (region == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -383,7 +407,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
public void scanChunk(final ChunkPos pos, final StreamTagVisitor scanner) throws IOException {
|
||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||
- RegionFile region = this.getRegionFile(pos, true);
|
||||
+ io.anonymous.anonymous.data.RegionFile region = this.getRegionFile(pos, true); // Anonymous - Configurable region file format
|
||||
if (region == null) {
|
||||
return;
|
||||
}
|
||||
@@ -398,7 +422,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
public void write(final ChunkPos pos, final @Nullable CompoundTag value) throws IOException {
|
||||
if (!SharedConstants.DEBUG_DONT_SAVE_WORLD) {
|
||||
- RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system
|
||||
+ io.anonymous.anonymous.data.RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system // Anonymous - Configurable region file format
|
||||
// Paper start - rewrite chunk system
|
||||
if (region == null) {
|
||||
// if the RegionFile doesn't exist, no point in deleting from it
|
||||
@@ -430,7 +454,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
// Paper start - rewrite chunk system
|
||||
synchronized (this) {
|
||||
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
||||
- for (final RegionFile regionFile : this.regionCache.values()) {
|
||||
+ for (final io.anonymous.anonymous.data.RegionFile regionFile : this.regionCache.values()) { // Anonymous - Configurable region file format
|
||||
try {
|
||||
regionFile.close();
|
||||
} catch (final IOException ex) {
|
||||
@@ -446,7 +470,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
// Paper start - rewrite chunk system
|
||||
synchronized (this) {
|
||||
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
|
||||
- for (final RegionFile regionFile : this.regionCache.values()) {
|
||||
+ for (final io.anonymous.anonymous.data.RegionFile regionFile : this.regionCache.values()) { // Anonymous - Configurable region file format
|
||||
try {
|
||||
regionFile.flush();
|
||||
} catch (final IOException ex) {
|
||||
+3
-3
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config to enable scoreboard command
|
||||
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index ddd656e147cdaeb8f91865117e6f9c268b0fd9bc..5fda3083f73744b0df3aab47b3c378dba41b904c 100644
|
||||
index 86866a9fa92d2e1ac0026e5764f459cc73e0b266..f54f6047f326189329e11338b17105f5555dde12 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -246,7 +246,11 @@ public class Commands {
|
||||
@@ -244,7 +244,11 @@ public class Commands {
|
||||
RotateCommand.register(this.dispatcher);
|
||||
SayCommand.register(this.dispatcher);
|
||||
//ScheduleCommand.register(this.dispatcher); // Folia - region threading
|
||||
@@ -17,7 +17,7 @@ index ddd656e147cdaeb8f91865117e6f9c268b0fd9bc..5fda3083f73744b0df3aab47b3c378db
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.scoreboard) {
|
||||
+ ScoreboardCommand.register(this.dispatcher, context); // Folia - region threading
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable scoreboard command
|
||||
+ // Lophine start - Add a config to enable scoreboard command
|
||||
SeedCommand.register(this.dispatcher, commandSelection != Commands.CommandSelection.INTEGRATED);
|
||||
VersionCommand.register(this.dispatcher, commandSelection != Commands.CommandSelection.INTEGRATED);
|
||||
SetBlockCommand.register(this.dispatcher, context);
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:00:48 +0800
|
||||
Subject: [PATCH] Do not enable any debug subscriptions
|
||||
|
||||
Really this would really crash the server by accident when the operators used F3 + J or toggled the debug synchronizer
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index a2e40bc7a15ba0663314a288f4a9b3ec3a39dc4d..216c9263999f05c36fb4c5598b41ff70e5759f5e 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -3483,7 +3483,8 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
|
||||
public Set<DebugSubscription<?>> debugSubscriptions() {
|
||||
- return !this.server.debugSubscribers().hasRequiredPermissions(this) ? Set.of() : this.requestedDebugSubscriptions;
|
||||
+ // return !this.server.debugSubscribers().hasRequiredPermissions(this) ? Set.of() : this.requestedDebugSubscriptions; // Luminol - Do not enable any debug subscriptions
|
||||
+ return Set.of(); // Luminol - Do not enable any debug subscriptions
|
||||
}
|
||||
|
||||
public record RespawnConfig(LevelData.RespawnData respawnData, boolean forced) {
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:25:45 +0800
|
||||
Subject: [PATCH] Do not load too far poi chunk in poi compete scan
|
||||
|
||||
Beeeeeeeeeeeeeeee
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java b/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java
|
||||
index 53131c1b8d5562f9a1b45dfab4fdbdd37b655139..0e9c19a820aefa802d6df134b21f5128a5e8d656 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java
|
||||
@@ -24,8 +24,18 @@ public class PoiCompetitorScan {
|
||||
return true;
|
||||
}
|
||||
// Folia end - region threading
|
||||
- level.getPoiManager()
|
||||
- .getType(pos.pos())
|
||||
+ // Luminol start - POI fixes
|
||||
+ var blockPosOfJobSite = pos.pos();
|
||||
+ var sectionPosOfJobSite = net.minecraft.core.SectionPos.asLong(blockPosOfJobSite);
|
||||
+ var poiManager = level.getPoiManager();
|
||||
+ // we don't care if we should clear the memory of JOB_SITE
|
||||
+ // as it will be automatically removed in SetWalkTargetFromBlockMemory
|
||||
+ // so simply break down if it's not loaded
|
||||
+ var poiChunk = me.earthme.luminol.config.modules.fixes.POIRangeFixes.doNotCompetePOIIfUnloaded ? poiManager.get(sectionPosOfJobSite) : poiManager.getOrLoad(sectionPosOfJobSite);
|
||||
+ poiChunk.flatMap(poiSection -> poiSection.getType(blockPosOfJobSite))
|
||||
+ // Luminol end - POI fixes
|
||||
+ /*level.getPoiManager() // Luminol - POI fixes
|
||||
+ .getType(pos.pos())*/ // Luminol - POI fixes
|
||||
.ifPresent(
|
||||
// Paper start - Improve performance of PoiCompetitorScan by unrolling stream
|
||||
// The previous logic used Stream#reduce to simulate a form of single-iteration bubble sort
|
||||
+2
-2
@@ -9,10 +9,10 @@ individual items may never reach their destination.
|
||||
This configuration option is added to fix this behavior.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 6f5d3ebb7adc567e5106a3c76fccdbee93f51c27..b1d5d59718e5748b164f0885d4152e795c5d572d 100644
|
||||
index aed1641b4e09384d40da1ac6e66c1641ca34b063..44b06b1585e7630fa17d8dfb01f737b14efebcbc 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -289,7 +289,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish
|
||||
@@ -287,7 +287,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish
|
||||
ItemStack thisItemStack = this.getItem();
|
||||
ItemStack otherItemStack = other.getItem();
|
||||
if (Objects.equals(this.target, other.target) && areMergable(thisItemStack, otherItemStack)) {
|
||||
+13
-17
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config to enable raytracing tracker
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
||||
index e9307ef10502856378d7831fb7800dd77230130c..6bca982627cf6a865820df75be2814a7289f98dc 100644
|
||||
index 0c0775bbb0c0ba0c37d1b884bb106b5250e94750..0dfb25ad032429a2aea7aa441dd5fd1848a6c617 100644
|
||||
--- a/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1375,7 +1375,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
|
||||
@@ -1350,7 +1350,7 @@ public class ChunkMap extends SimpleRegionStorage implements ChunkHolder.PlayerP
|
||||
double distanceSquared = deltaToPlayerX * deltaToPlayerX + deltaToPlayerZ * deltaToPlayerZ; // Paper
|
||||
double rangeSquared = visibleRange * visibleRange;
|
||||
// Paper start - Configurable entity tracking range by Y
|
||||
@@ -18,10 +18,10 @@ index e9307ef10502856378d7831fb7800dd77230130c..6bca982627cf6a865820df75be2814a7
|
||||
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 9d2e62c4c5cd0668a9083c7af9abed96b4589f7f..939ad903434aa3766a6bf647743086693b8c3d19 100644
|
||||
index 0e543348e48fdf2131dfa1460e37db238d02988c..b69698f47ccb0f1ac3eeea05a02ab9d798319b44 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -164,7 +164,7 @@ public abstract class Entity
|
||||
@@ -167,7 +167,7 @@ public abstract class Entity
|
||||
ItemOwner,
|
||||
SlotProvider,
|
||||
DebugValueSource,
|
||||
@@ -30,11 +30,10 @@ index 9d2e62c4c5cd0668a9083c7af9abed96b4589f7f..939ad903434aa3766a6bf64774308669
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
static boolean isLevelAtLeast(ValueInput input, int level) {
|
||||
@@ -6597,4 +6597,48 @@ public abstract class Entity
|
||||
// Paper end
|
||||
@@ -6412,4 +6412,46 @@ public abstract class Entity
|
||||
// Paper end - Expose entity id counter
|
||||
|
||||
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
||||
+ // Lophine start - Add config to enable raytracing tracker
|
||||
+
|
||||
+ private long lasttime = 0;
|
||||
+ private boolean culled = false;
|
||||
@@ -77,29 +76,26 @@ index 9d2e62c4c5cd0668a9083c7af9abed96b4589f7f..939ad903434aa3766a6bf64774308669
|
||||
+ return this.outOfCamera;
|
||||
+ }
|
||||
+
|
||||
+ // Lophine end - Add config to enable raytracing tracker
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
|
||||
index 31619890f1bd4f458b6f9a31fac8cefaafe09e8e..50643bd0b546a1ff70031ea39e2610f219ef8a79 100644
|
||||
index cb0a52dc3795e1cf54069bcbe82abf7877a658b8..1440946665f41ebf534d701515f982bbbf4c9686 100644
|
||||
--- a/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/net/minecraft/world/entity/EntityType.java
|
||||
@@ -85,6 +85,11 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T>,
|
||||
@@ -1252,6 +1252,9 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T>,
|
||||
public final int passengerTickTimerId;
|
||||
public final int passengerInactiveTickTimerId;
|
||||
// Folia end - profiler
|
||||
+ // Lophine start - Add config to enable raytracing tracker
|
||||
+ // Luminol - Raytracing entity tracker
|
||||
+ public boolean skipRaytracningCheck = false;
|
||||
+ // Luminol end
|
||||
+ // Lophine end - Add config to enable raytracing tracker
|
||||
|
||||
public EntityType(
|
||||
final EntityType.EntityFactory<T> factory,
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index e7b6c83a4e7bd83f6c5a1d772c42c51bf1d1bed1..449a2904fb1190f68de72bc47eb8220f50002577 100644
|
||||
index b9cc33198efceb75dfef333c018b1296944451cb..f6f6d21f3393a3ab79a84212b0d66d83d0e817f1 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -186,6 +186,25 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
@@ -185,6 +185,25 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -124,8 +120,8 @@ index e7b6c83a4e7bd83f6c5a1d772c42c51bf1d1bed1..449a2904fb1190f68de72bc47eb8220f
|
||||
+ // Luminol end
|
||||
|
||||
public Player(final Level level, final GameProfile gameProfile) {
|
||||
super(EntityTypes.PLAYER, level);
|
||||
@@ -245,6 +264,26 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
super(EntityType.PLAYER, level);
|
||||
@@ -240,6 +259,26 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -152,7 +148,7 @@ index e7b6c83a4e7bd83f6c5a1d772c42c51bf1d1bed1..449a2904fb1190f68de72bc47eb8220f
|
||||
this.noPhysics = this.isSpectator();
|
||||
if (this.isSpectator() || this.isPassenger()) {
|
||||
this.setOnGround(false);
|
||||
@@ -1378,6 +1417,7 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
@@ -1352,6 +1391,7 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
if (this.hasContainerOpen()) {
|
||||
this.doCloseContainer();
|
||||
}
|
||||
-287
@@ -1,287 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 28 Jun 2026 19:02:01 +0800
|
||||
Subject: [PATCH] Fixes around entity brain and memories
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 3b1c3e84ab24b6e3a0e4d129b3617b393b6d6651..9c8e8de53cbbd87ac7cb8483bd3c1af3fcf66b6e 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -299,6 +299,11 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
if (Objects.equals(currentTarget, target)) {
|
||||
return false;
|
||||
}
|
||||
+ // Luminol start - Fix off-region targeting
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(target)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
LivingEntity originalTarget = target;
|
||||
target = asValidTarget(target);
|
||||
if (reason != null) {
|
||||
diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
|
||||
index e097bc1268b4050e3948413c52dea69950858458..27894e2935e2afee8190708def4be3b00f922f64 100644
|
||||
--- a/net/minecraft/world/entity/ai/Brain.java
|
||||
+++ b/net/minecraft/world/entity/ai/Brain.java
|
||||
@@ -383,7 +383,7 @@ public class Brain<E extends LivingEntity> {
|
||||
}
|
||||
|
||||
public void tick(final ServerLevel level, final E body) {
|
||||
- this.forgetOutdatedMemories();
|
||||
+ this.forgetOutdatedMemories(body); // Luminol - Add config to force clean entity memory that don't belong to current tick region
|
||||
this.tickSensors(level, body);
|
||||
this.startEachNonRunningBehavior(level, body);
|
||||
this.tickEachRunningBehavior(level, body);
|
||||
@@ -395,8 +395,8 @@ public class Brain<E extends LivingEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
- private void forgetOutdatedMemories() {
|
||||
- this.memories.values().forEach(MemorySlot::tick);
|
||||
+ private void forgetOutdatedMemories(E body) { // Luminol - Add config to force clean entity memory that don't belong to current tick region
|
||||
+ this.memories.values().forEach(slot -> slot.tick(body)); // Luminol - Add config to force clean entity memory that don't belong to current tick region
|
||||
}
|
||||
|
||||
public void stopAll(final ServerLevel level, final E body) {
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
index f744ecd20dc70786311a7162b52aa4ceca0717db..aa60fbfbe7283f1ed9cf5343d59d1222380857dd 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
@@ -81,6 +81,11 @@ public class BehaviorUtils {
|
||||
public static void setWalkAndLookTargetMemories(
|
||||
final LivingEntity walker, final PositionTracker target, final float speedModifier, final int closeEnoughDistance
|
||||
) {
|
||||
+ // Luminol - Do not set walk target if target position is out of current tick region
|
||||
+ if (!target.checkThread(walker.level())) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
WalkTarget walkTarget = new WalkTarget(target, speedModifier, closeEnoughDistance);
|
||||
walker.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, target);
|
||||
walker.getBrain().setMemory(MemoryModuleType.WALK_TARGET, walkTarget);
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/BlockPosTracker.java b/net/minecraft/world/entity/ai/behavior/BlockPosTracker.java
|
||||
index 68251875edfa47ac34c64f99510998ad4bbb14b4..d83b353395bad7c6c41dfaa24018fd207904d995 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BlockPosTracker.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BlockPosTracker.java
|
||||
@@ -37,4 +37,11 @@ public class BlockPosTracker implements PositionTracker {
|
||||
public String toString() {
|
||||
return "BlockPosTracker{blockPos=" + this.blockPos + ", centerPosition=" + this.centerPosition + "}";
|
||||
}
|
||||
+
|
||||
+ // Luminol start - Fix a series issue around entity memory typed GlobalPos and WalkTarget
|
||||
+ @Override
|
||||
+ public boolean checkThread(net.minecraft.world.level.Level currOwnedByLevel) {
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(currOwnedByLevel, this.blockPos);
|
||||
+ }
|
||||
+ // Luminol end
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/EntityTracker.java b/net/minecraft/world/entity/ai/behavior/EntityTracker.java
|
||||
index 3ac52b025ac3e1a3f9135b8e593a385a847afe0f..29c13f18cff52e9950e8932c75cb12fb02f952cb 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/EntityTracker.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/EntityTracker.java
|
||||
@@ -55,4 +55,11 @@ public class EntityTracker implements PositionTracker {
|
||||
public String toString() {
|
||||
return "EntityTracker for " + this.entity;
|
||||
}
|
||||
+
|
||||
+ // Luminol start - Fix a series issue around entity memory typed GlobalPos and WalkTarget
|
||||
+ @Override
|
||||
+ public boolean checkThread(net.minecraft.world.level.Level currOwnedByLevel) {
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.entity);
|
||||
+ }
|
||||
+ // Luminol end
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/PositionTracker.java b/net/minecraft/world/entity/ai/behavior/PositionTracker.java
|
||||
index ce6cf5ecfb190428e3ef9b7dd39c98e3d27a7b9d..3334da2236fbe90cbdc3e67884f9c6ed80ac0f56 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/PositionTracker.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/PositionTracker.java
|
||||
@@ -10,4 +10,7 @@ public interface PositionTracker {
|
||||
BlockPos currentBlockPosition();
|
||||
|
||||
boolean isVisibleBy(final LivingEntity body);
|
||||
+
|
||||
+
|
||||
+ boolean checkThread(net.minecraft.world.level.Level currOwnedByLevel); // Luminol - Fix a series issue around entity memory typed GlobalPos and WalkTarget
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/SleepInBed.java b/net/minecraft/world/entity/ai/behavior/SleepInBed.java
|
||||
index 16017d819c28b077f732e2ef571eac179d24e323..7a598aa1a0963fda3302946a30d0330c341da74f 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/SleepInBed.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/SleepInBed.java
|
||||
@@ -57,6 +57,11 @@ public class SleepInBed extends Behavior<LivingEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Luminol Start - Prevent off-tick-region chunk operations
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(level, target.pos())) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Luminol End
|
||||
BlockState blockState = level.getBlockStateIfLoaded(target.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 target.pos().closerToCenterThan(body.position(), 2.0) && blockState.is(BlockTags.BEDS) && !blockState.getValue(BedBlock.OCCUPIED);
|
||||
diff --git a/net/minecraft/world/entity/ai/memory/MemorySlot.java b/net/minecraft/world/entity/ai/memory/MemorySlot.java
|
||||
index 88a89b4c72cc99dc89d3f3cc928b2dfda4125759..3b51a44ab700740047c9e725547ceec65c0c80b1 100644
|
||||
--- a/net/minecraft/world/entity/ai/memory/MemorySlot.java
|
||||
+++ b/net/minecraft/world/entity/ai/memory/MemorySlot.java
|
||||
@@ -13,7 +13,7 @@ public class MemorySlot<T> {
|
||||
this.timeToLive = timeToLive;
|
||||
}
|
||||
|
||||
- public void tick() {
|
||||
+ public void tick(net.minecraft.world.entity.Entity owner) { // Luminol - Add config to force clean entity memory that don't belong to current tick region
|
||||
if (this.hasValue() && this.canExpire()) {
|
||||
if (this.hasExpired()) {
|
||||
this.clear();
|
||||
@@ -21,6 +21,41 @@ public class MemorySlot<T> {
|
||||
this.timeToLive--;
|
||||
}
|
||||
}
|
||||
+ // Luminol start - Add config to force clean entity memory that don't belong to current tick region
|
||||
+ final net.minecraft.world.level.Level ownerLevel = owner.level();
|
||||
+
|
||||
+ // type: entity
|
||||
+ if (me.earthme.luminol.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForEntity && this.value instanceof net.minecraft.world.entity.Entity entity) {
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
||||
+ this.clear();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // type: block_pos
|
||||
+ if (me.earthme.luminol.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForBlockPos && this.value instanceof net.minecraft.core.BlockPos blockPos) {
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ownerLevel, blockPos)) {
|
||||
+ this.clear();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ //type: position_tracker and walk_target
|
||||
+ if (me.earthme.luminol.config.modules.fixes.ForceCleanupEntityBrainMemoryConfig.enabledForPositionTracker) {
|
||||
+ net.minecraft.world.entity.ai.behavior.PositionTracker tracker = null;
|
||||
+
|
||||
+ if (value instanceof net.minecraft.world.entity.ai.behavior.PositionTracker positionTracker) {
|
||||
+ tracker = positionTracker;
|
||||
+ }
|
||||
+
|
||||
+ if (value instanceof net.minecraft.world.entity.ai.memory.WalkTarget walkTarget) {
|
||||
+ tracker = walkTarget.getTarget();
|
||||
+ }
|
||||
+
|
||||
+ if (tracker != null && !tracker.checkThread(owner.level())) {
|
||||
+ this.clear();
|
||||
+ }
|
||||
+ }
|
||||
+ // Luminol end
|
||||
}
|
||||
|
||||
public static <T> MemorySlot<T> create() {
|
||||
diff --git a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
index e44814cfb6afb594456b8215bd13a92e93de2c85..c18e2071c699d9c5f4d46b7a58191df4f4d8ab5d 100644
|
||||
--- a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
+++ b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
@@ -60,6 +60,17 @@ public class FlyingPathNavigation extends PathNavigation {
|
||||
|
||||
if (!this.isDone()) {
|
||||
Vec3 target = this.path.getNextEntityPos(this.mob);
|
||||
+ // Luminol - Recompute path when path finding out of current tick region
|
||||
+ if (me.earthme.luminol.config.modules.fixes.PathfindingFixesConfig.breakDownPathfindingWhenOutOfRegion) {
|
||||
+ // we assume that:
|
||||
+ // 1. The code above doesn't touch the 'main thread context' with the position from 'this.path'
|
||||
+ // 2. The pathfinder could correctly recompute or discard the incorrect target position and this situation is happening rarely
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.mob.level(), target)) {
|
||||
+ this.hasDelayedRecomputation = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // Luminol end
|
||||
this.mob.getMoveControl().setWantedPosition(target.x, target.y, target.z, this.speedModifier);
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
index 2ea1ec39a37899ae1510d0036aa670e758077537..4c727e4f224f6a31a4cd9d024bdcfaf0fa1bc0e5 100644
|
||||
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
@@ -188,6 +188,18 @@ public abstract class PathNavigation {
|
||||
}
|
||||
}
|
||||
// Paper end - EntityPathfindEvent
|
||||
+ // Luminol start - Do not path find for targets out of current region
|
||||
+ if (me.earthme.luminol.config.modules.fixes.PathfindingFixesConfig.doNotPathfindToNotOwnedTargets) {
|
||||
+ // filter the targets not owned by current region
|
||||
+ targets = new java.util.HashSet<>(targets); // well no idea about how to determine if this should be copied to a modifiable one
|
||||
+ targets.removeIf(pos -> !ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.mob.level(), pos));
|
||||
+
|
||||
+ // return if no available (observe the logic in the first if block)
|
||||
+ if (targets.isEmpty()) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+ // Luminol end
|
||||
ProfilerFiller profiler = Profiler.get();
|
||||
profiler.push("pathfind");
|
||||
BlockPos fromPos = above ? this.mob.blockPosition().above() : this.mob.blockPosition();
|
||||
@@ -286,6 +298,17 @@ public abstract class PathNavigation {
|
||||
|
||||
if (!this.isDone()) {
|
||||
Vec3 target = this.path.getNextEntityPos(this.mob);
|
||||
+ // Luminol - Recompute path when path finding out of current tick region
|
||||
+ if (me.earthme.luminol.config.modules.fixes.PathfindingFixesConfig.breakDownPathfindingWhenOutOfRegion) {
|
||||
+ // we assume that:
|
||||
+ // 1. The code above doesn't touch the 'main thread context' with the position from 'this.path'
|
||||
+ // 2. The pathfinder could correctly recompute or discard the incorrect target position and this situation is happening rarely
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.mob.level(), target)) {
|
||||
+ this.hasDelayedRecomputation = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // Luminol end
|
||||
this.mob.getMoveControl().setWantedPosition(target.x, this.getGroundY(target), target.z, this.speedModifier);
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/allay/AllayAi.java b/net/minecraft/world/entity/animal/allay/AllayAi.java
|
||||
index c3667e7997551e0f5ce63bc6ee890082d1431400..2e2458535a8ec542d6371ceba2fff1260773c7f5 100644
|
||||
--- a/net/minecraft/world/entity/animal/allay/AllayAi.java
|
||||
+++ b/net/minecraft/world/entity/animal/allay/AllayAi.java
|
||||
@@ -112,6 +112,17 @@ public class AllayAi {
|
||||
Optional<GlobalPos> likedNoteblockPos = brain.getMemory(MemoryModuleType.LIKED_NOTEBLOCK_POSITION);
|
||||
if (likedNoteblockPos.isPresent()) {
|
||||
GlobalPos position = likedNoteblockPos.get();
|
||||
+ // Luminol start - Do not like item if they were out of current tickregion
|
||||
+ final Level targetLevel = allay.level().getServer().getLevel(position.dimension());
|
||||
+ final BlockPos targetPos = position.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(allay, brain, position)) {
|
||||
return Optional.of(new BlockPosTracker(position.pos().above()));
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index d5394ae7ce56555ad21aeafb2d78c291c62e2988..a2873d8bbfa3e04678bc31637222b3a10cd6fedd 100644
|
||||
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -279,8 +279,18 @@ public class Sniffer extends Animal {
|
||||
|
||||
private boolean canDig(final BlockPos position) {
|
||||
return this.level().getBlockState(position).is(BlockTags.SNIFFER_DIGGABLE_BLOCK)
|
||||
- && this.getExploredPositions().noneMatch(explored -> GlobalPos.of(this.level().dimension(), position).equals(explored))
|
||||
- && Optional.ofNullable(this.getNavigation().createPath(position, 1)).map(Path::canReach).orElse(false);
|
||||
+ && this.getExploredPositions().noneMatch(explored -> { // Luminol start - Do not pathfind out of tickregion
|
||||
+ // thread checks
|
||||
+ final Level targetLevel = net.minecraft.server.MinecraftServer.getServer().getLevel(explored.dimension());
|
||||
+ final BlockPos targetPos = explored.pos();
|
||||
+
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(targetLevel, targetPos)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return GlobalPos.of(this.level().dimension(), position).equals(explored); // Original logic
|
||||
+ }) // Luminol end
|
||||
+ && Optional.ofNullable(this.getNavigation().createPath(position, 1)).map(Path::canReach).orElse(false); // Luminol - Do not pathfind out of tickregion - diff on change
|
||||
}
|
||||
|
||||
private void dropSeed() {
|
||||
@@ -1,38 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:16:45 +0800
|
||||
Subject: [PATCH] Fix off region leashing
|
||||
|
||||
PS: My friend reported me this bug and I still need to check the details of how the bug was caused
|
||||
|
||||
XD
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Leashable.java b/net/minecraft/world/entity/Leashable.java
|
||||
index 98034a4c96bf2972316078d3b3a49140921aab50..284ba0c3742d5d5ab0b344a84a9c8e2c2a98a74a 100644
|
||||
--- a/net/minecraft/world/entity/Leashable.java
|
||||
+++ b/net/minecraft/world/entity/Leashable.java
|
||||
@@ -95,10 +95,24 @@ public interface Leashable {
|
||||
if (leashUuid.isPresent()) {
|
||||
Entity leasher = serverLevel.getEntity(leashUuid.get());
|
||||
if (leasher != null) {
|
||||
+ // Luminol start - Fix off region leashing
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(leasher)) {
|
||||
+ entity.spawnAtLocation(serverLevel, Items.LEAD);
|
||||
+ entity.setLeashData(null);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
setLeashedTo(entity, leasher, true);
|
||||
return;
|
||||
}
|
||||
} else if (pos.isPresent()) {
|
||||
+ // Luminol start - Fix off region leashing
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(serverLevel, pos.get())) {
|
||||
+ entity.spawnAtLocation(serverLevel, Items.LEAD);
|
||||
+ entity.setLeashData(null);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
setLeashedTo(entity, LeashFenceKnotEntity.getOrCreateKnot(serverLevel, pos.get()), true);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 19 May 2025 00:42:17 +0800
|
||||
Subject: [PATCH] Old zombie reinforcement
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
index 0008aa0ca02fc4ea67b795b3f0a0e9656233ce89..2734ffc103ee4760d3521609fdd090ab99df675b 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
@@ -331,7 +331,7 @@ public class Zombie extends Monster {
|
||||
int x = Mth.floor(this.getX());
|
||||
int y = Mth.floor(this.getY());
|
||||
int z = Mth.floor(this.getZ());
|
||||
- EntityType<? extends Zombie> type = this.getType();
|
||||
+ EntityType<? extends Zombie> type = fun.bm.lophine.config.modules.function.OldFeatureConfig.oldZombieReinforcement ? EntityType.ZOMBIE : this.getType(); // Lophine - old zombie reinforcement
|
||||
Zombie reinforcement = type.create(level, EntitySpawnReason.REINFORCEMENT);
|
||||
if (reinforcement == null) {
|
||||
return true;
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:21:30 +0800
|
||||
Subject: [PATCH] Fix unpatched task returning of
|
||||
ServerConfigurationPacketListenerImpl#disconnectAsync
|
||||
|
||||
Inspired by https://github.com/CraftCanvasMC/Canvas/blob/ver/1.21.8/canvas-server/minecraft-patches/sources/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java.patch
|
||||
but Canvas loses its main thread checks so fixed that btw
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
index 77c4670868a95dc7b13461dfa67af34b0a3c329a..111789b4aca281dd1899dfbcc4e7e0ca36d74b51 100644
|
||||
--- a/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
|
||||
@@ -299,13 +299,14 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis
|
||||
// Paper start
|
||||
@Override
|
||||
public void disconnectAsync(final net.minecraft.network.DisconnectionDetails disconnectionInfo) {
|
||||
- if (this.cserver.isPrimaryThread()) {
|
||||
+ if (io.papermc.paper.threadedregions.RegionizedServer.isGlobalTickThread()) { // Luminol - Fix unpatched task returning of ServerConfigurationPacketListenerImpl#disconnectAsync
|
||||
this.disconnect(disconnectionInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
this.connection.setReadOnly();
|
||||
- this.server.scheduleOnMain(() -> {
|
||||
+ // this.server.scheduleOnMain(() -> { // Luminol - Fix unpatched task returning of ServerConfigurationPacketListenerImpl#disconnectAsync
|
||||
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(() -> { // Luminol - Fix unpatched task returning of ServerConfigurationPacketListenerImpl#disconnectAsync
|
||||
this.disconnect(disconnectionInfo); // Currently you cannot cancel disconnect during the config stage
|
||||
});
|
||||
}
|
||||
+15
-15
@@ -5,10 +5,10 @@ Subject: [PATCH] Spawn invulnerable time
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index dcd1b874b68bc2e780f5a5a2ba8ac7a6a16a65f4..14eaa25d67e9dbaad5ae4c6d6be4ae640b2fc015 100644
|
||||
index 5f1fad59a26e3fe29f9000a92be5d6c4422dcd01..f3afab1100a35cc9ab091944de93d1f30ef040a7 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -245,6 +245,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -242,6 +242,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
private int lastSentFood = -99999999;
|
||||
private boolean lastFoodSaturationZero = true;
|
||||
public int lastSentExp = -99999999;
|
||||
@@ -16,7 +16,7 @@ index dcd1b874b68bc2e780f5a5a2ba8ac7a6a16a65f4..14eaa25d67e9dbaad5ae4c6d6be4ae64
|
||||
private ChatVisiblity chatVisibility = ChatVisiblity.FULL;
|
||||
public ParticleStatus particleStatus = ParticleStatus.ALL;
|
||||
private boolean canChatColor = true;
|
||||
@@ -902,6 +903,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -920,6 +921,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.connection.tickClientLoadTimeout();
|
||||
this.gameMode.tick();
|
||||
this.wardenSpawnTracker.tick();
|
||||
@@ -24,17 +24,17 @@ index dcd1b874b68bc2e780f5a5a2ba8ac7a6a16a65f4..14eaa25d67e9dbaad5ae4c6d6be4ae64
|
||||
if (this.invulnerableTime > 0) {
|
||||
this.invulnerableTime--;
|
||||
}
|
||||
@@ -1532,6 +1534,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1556,6 +1558,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
if (this.isInvulnerableTo(level, source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Lophine start - spawn invulnerable time
|
||||
+ if (fun.bm.lophine.config.modules.function.OldFeatureConfig.spawnInvulnerableTime) {
|
||||
+ if (this.spawnInvulnerableTime > 0 && !source.is(net.minecraft.tags.DamageTypeTags.BYPASSES_INVULNERABILITY)) {
|
||||
+ return false;
|
||||
} else {
|
||||
+ // Lophine start - spawn invulnerable time
|
||||
+ if (fun.bm.lophine.config.modules.function.OldFeatureConfig.spawnInvulnerableTime) {
|
||||
+ if (this.spawnInvulnerableTime > 0 && !source.is(net.minecraft.tags.DamageTypeTags.BYPASSES_INVULNERABILITY)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Lophine end - spawn invulnerable time
|
||||
Entity entity = source.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
||||
+ // Lophine end - spawn invulnerable time
|
||||
Entity entity = source.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player playerx && !this.canHarmPlayer(playerx))
|
||||
@@ -1,64 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 17 Apr 2026 23:24:07 +0800
|
||||
Subject: [PATCH] Fix riding statistics desync
|
||||
|
||||
Referred to: https://github.com/CraftCanvasMC/Canvas/commit/057175b0c10d5a4d1d9059fd9d077750c32633b2
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 216c9263999f05c36fb4c5598b41ff70e5759f5e..6c2196726a0669bddda456a089aeec0d9d9bdfa3 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2516,7 +2516,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
}
|
||||
|
||||
- private void checkRidingStatistics(final double dx, final double dy, final double dz) {
|
||||
+ public void checkRidingStatistics(final double dx, final double dy, final double dz) { // Luminol - Fix riding statics desync (make public)
|
||||
if (this.isPassenger() && !didNotMove(dx, dy, dz)) {
|
||||
int distance = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
|
||||
Entity vehicle = this.getVehicle();
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 75dabd3e7b6077b5ae8ee30048786442742b93f9..6fa3ac9a37dafa166d8e70aaf4ec369db0792200 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4200,7 +4200,13 @@ public abstract class Entity
|
||||
}
|
||||
}
|
||||
|
||||
+ // Luminol start - Fix riding statics desync
|
||||
public void adjustRiders(boolean teleport) {
|
||||
+ this.adjustRiders(teleport, false);
|
||||
+ }
|
||||
+
|
||||
+ public void adjustRiders(boolean teleport, boolean syncStatics) {
|
||||
+ // Luminol end - Fix riding statics desync
|
||||
java.util.ArrayDeque<EntityTreeNode> queue = new java.util.ArrayDeque<>();
|
||||
queue.add(this);
|
||||
|
||||
@@ -4213,14 +4219,24 @@ public abstract class Entity
|
||||
|
||||
for (EntityTreeNode passenger : passengers) {
|
||||
queue.add(passenger);
|
||||
+ // Luminol start - Fix riding statics desync
|
||||
+ final double oldX = passenger.root.getX();
|
||||
+ final double oldY = passenger.root.getY();
|
||||
+ final double oldZ = passenger.root.getZ();
|
||||
+ // Luminol end - Fix riding statics desync
|
||||
curr.root.positionRider(passenger.root, teleport ? Entity::snapTo : Entity::setPos);
|
||||
+ // Luminol start - Fix riding statics desync
|
||||
+ if (syncStatics && passenger.root instanceof net.minecraft.server.level.ServerPlayer serverPlayer) {
|
||||
+ serverPlayer.checkRidingStatistics(serverPlayer.getX() - oldX, serverPlayer.getY() - oldY, serverPlayer.getZ() - oldZ);
|
||||
+ }
|
||||
+ // Luminol end - Fix riding statics desync
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void repositionAllPassengers(boolean teleport) {
|
||||
- this.makePassengerTree().adjustRiders(teleport);
|
||||
+ this.makePassengerTree().adjustRiders(teleport, true); // Luminol - Fix riding statics desync
|
||||
}
|
||||
|
||||
protected EntityTreeNode makePassengerTree() {
|
||||
+65
-66
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/f3784ec0525069a37
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/commands/arguments/item/ItemInput.java b/net/minecraft/commands/arguments/item/ItemInput.java
|
||||
index 0dce216ae73c85dd69056bec7ef60b5e4364f23b..9ce6305e9fea9edcd3b1b853070d9990e00a667b 100644
|
||||
index 28aab52fb14e9086d81dd7a3fa32e7f12136d53a..1f033b970be82b0bdb4e51b6e1c5bb03170066ae 100644
|
||||
--- a/net/minecraft/commands/arguments/item/ItemInput.java
|
||||
+++ b/net/minecraft/commands/arguments/item/ItemInput.java
|
||||
@@ -20,8 +20,10 @@ public record ItemInput(Holder<Item> item, DataComponentPatch components) {
|
||||
@@ -21,11 +21,11 @@ index 0dce216ae73c85dd69056bec7ef60b5e4364f23b..9ce6305e9fea9edcd3b1b853070d9990
|
||||
+ if (count > org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(result)) {
|
||||
+ throw ERROR_STACK_TOO_BIG.create(this.item.getRegisteredName(), org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(result));
|
||||
+ // Leaves end - item over-stack util
|
||||
}
|
||||
|
||||
DataResult<ItemStack> validationResult = ItemStack.validateStrict(result);
|
||||
} else {
|
||||
DataResult<ItemStack> validationResult = ItemStack.validateStrict(result);
|
||||
return validationResult.getOrThrow(ERROR_MALFORMED_ITEM::create);
|
||||
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
|
||||
index be357d315f5c83349a7f7287ff45e92137950a8c..a542e38ea6a1e8fc81466acbca071d89832ba54a 100644
|
||||
index c147a1acd4fd9f94c73bee69febf651ca00c28ce..f8004bf74edeabce871515fb73fa00f331941dca 100644
|
||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||
@@ -47,7 +47,7 @@ public class GiveCommand {
|
||||
@@ -38,10 +38,10 @@ index be357d315f5c83349a7f7287ff45e92137950a8c..a542e38ea6a1e8fc81466acbca071d89
|
||||
if (count > maxAllowedCount) {
|
||||
source.sendFailure(Component.translatable("commands.give.failed.toomanyitems", maxAllowedCount, prototypeItemStack.getDisplayName()));
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4ad4c060f 100644
|
||||
index 47beff71ed33e7fbd6fe6cd47aa955233af41f04..8e5b79db12882432de575f2a76aa36eac6fc8f51 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3233,7 +3233,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3229,7 +3229,7 @@ public class ServerGamePacketListenerImpl
|
||||
} else if (slot.mayPlace(cursor)) {
|
||||
if (ItemStack.isSameItemSameComponents(clickedItem, cursor)) {
|
||||
int toPlace = packet.buttonNum() == 0 ? cursor.getCount() : 1;
|
||||
@@ -50,7 +50,7 @@ index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4
|
||||
toPlace = Math.min(toPlace, slot.container.getMaxStackSize() - clickedItem.getCount());
|
||||
if (toPlace == 1) {
|
||||
action = InventoryAction.PLACE_ONE;
|
||||
@@ -3269,7 +3269,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3265,7 +3265,7 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
} else if (ItemStack.isSameItemSameComponents(cursor, clickedItem)) {
|
||||
if (clickedItem.getCount() >= 0) {
|
||||
@@ -59,7 +59,7 @@ index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4
|
||||
// As of 1.5, this is result slots only
|
||||
action = InventoryAction.PICKUP_ALL;
|
||||
}
|
||||
@@ -3486,6 +3486,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3482,6 +3482,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.player.containerMenu.broadcastFullState();
|
||||
} else {
|
||||
this.player.containerMenu.broadcastChanges();
|
||||
@@ -67,7 +67,7 @@ index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4
|
||||
}
|
||||
if (packet.buttonNum() == Inventory.SLOT_OFFHAND && this.player.containerMenu != this.player.inventoryMenu) this.player.containerSynchronizer.sendOffHandSlotChange(); // Paper - update offhand data when the player is clicking in an inventory not their own as the sychronizer does not include offhand slots
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes.
|
||||
@@ -3597,7 +3598,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3593,7 +3594,7 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
|
||||
boolean validSlot = packet.slotNum() >= 1 && packet.slotNum() <= 45;
|
||||
@@ -76,7 +76,7 @@ index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4
|
||||
if (drop || (validSlot && !ItemStack.matches(this.player.inventoryMenu.getSlot(packet.slotNum()).getItem(), packet.itemStack()))) { // Insist on valid slot
|
||||
// CraftBukkit start - Call click event
|
||||
org.bukkit.inventory.InventoryView inventory = this.player.inventoryMenu.getBukkitView();
|
||||
@@ -3639,6 +3640,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3635,6 +3636,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
|
||||
this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
|
||||
this.player.inventoryMenu.broadcastChanges();
|
||||
@@ -85,10 +85,10 @@ index 57c2748dccf3bcb4f8464f3bc0fe3df39a2c8cb5..9907e58908eb17874cc938337888dfe4
|
||||
} else if (drop && validData) {
|
||||
if (this.dropSpamThrottler.isUnderThreshold()) {
|
||||
diff --git a/net/minecraft/world/Container.java b/net/minecraft/world/Container.java
|
||||
index dd2d0940eece3e85078e574f66f71a4c497d75fd..b3585aee0393142366e583fc2c8fb207f162e92b 100644
|
||||
index 54d99625cfec60530e8a3288871e6dc21e179b2d..2a1c1bd2e9c326b7298978cec1fe13112e670d33 100644
|
||||
--- a/net/minecraft/world/Container.java
|
||||
+++ b/net/minecraft/world/Container.java
|
||||
@@ -37,6 +37,12 @@ public interface Container extends Clearable, Iterable<ItemStack>, SlotProvider,
|
||||
@@ -38,6 +38,12 @@ public interface Container extends Clearable, Iterable<ItemStack>, SlotProvider,
|
||||
return Math.min(this.getMaxStackSize(), itemStack.getMaxStackSize());
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ index dd2d0940eece3e85078e574f66f71a4c497d75fd..b3585aee0393142366e583fc2c8fb207
|
||||
|
||||
boolean stillValid(Player player);
|
||||
diff --git a/net/minecraft/world/SimpleContainer.java b/net/minecraft/world/SimpleContainer.java
|
||||
index 073a3bbf1b1db7eac83cf35412543f370fa089ee..0f412551685a8ea76be3b389e0782e57d22bb87c 100644
|
||||
index 21f576bb39bfd78dca87606ba3a044db8e13e28e..049c6ab6472415479435f2caab0444c3cbd33902 100644
|
||||
--- a/net/minecraft/world/SimpleContainer.java
|
||||
+++ b/net/minecraft/world/SimpleContainer.java
|
||||
@@ -193,7 +193,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
||||
@@ -124,10 +124,10 @@ index 073a3bbf1b1db7eac83cf35412543f370fa089ee..0f412551685a8ea76be3b389e0782e57
|
||||
if (diff > 0) {
|
||||
targetStack.grow(diff);
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index b1d5d59718e5748b164f0885d4152e795c5d572d..44a5be736ba73c065a5b1a5fffcf2ea4a21d89dd 100644
|
||||
index 44b06b1585e7630fa17d8dfb01f737b14efebcbc..679a941a2af886697fbfcbc7f21e5f4e0ec77dc3 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -282,10 +282,15 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish
|
||||
@@ -280,10 +280,15 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish
|
||||
|
||||
private boolean isMergable() {
|
||||
ItemStack item = this.getItem();
|
||||
@@ -145,7 +145,7 @@ index b1d5d59718e5748b164f0885d4152e795c5d572d..44a5be736ba73c065a5b1a5fffcf2ea4
|
||||
ItemStack otherItemStack = other.getItem();
|
||||
if (Objects.equals(this.target, other.target) && areMergable(thisItemStack, otherItemStack)) {
|
||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||
index cd7714dffcd7e7b6d96d18a97e65fd0914a739d1..fd38d7c34910ab9a60a9f54968901be3af2a9867 100644
|
||||
index f004911c438e6f89d6e079437e3f4104d6cbacbd..a248b1d11303237ebdf7cac4fa63865287d91a10 100644
|
||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -166,10 +166,12 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -190,7 +190,7 @@ index cd7714dffcd7e7b6d96d18a97e65fd0914a739d1..fd38d7c34910ab9a60a9f54968901be3
|
||||
int toAdd = Math.min(count, maxToAdd);
|
||||
if (toAdd == 0) {
|
||||
return count;
|
||||
@@ -423,7 +425,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -421,7 +423,7 @@ public class Inventory implements Container, Nameable {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,10 +213,10 @@ index 1ace17d8fc7e7b8b4722a1889d49233c0ec55e20..d146f02338852810679a45bff932d9d6
|
||||
|
||||
public void accountStack(final ItemStack itemStack, final int maxCount) {
|
||||
diff --git a/net/minecraft/world/entity/vehicle/ContainerEntity.java b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
index c80a44dbc54e0bf00daa525bef20422b15ce8a85..d9daef9b2ccf0f0bbe61ff3d7a20f25193aabaf8 100644
|
||||
index 9c9a08752b54222e8ac8d9a38c7a28a775bd1164..42716cf2c864eba50628dc64c59ab29c1d51dc9b 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
@@ -160,7 +160,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
||||
@@ -161,7 +161,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
||||
default void setChestVehicleItem(final int slot, final ItemStack itemStack) {
|
||||
this.unpackChestVehicleLootTable(null);
|
||||
this.getItemStacks().set(slot, itemStack);
|
||||
@@ -226,10 +226,10 @@ index c80a44dbc54e0bf00daa525bef20422b15ce8a85..d9daef9b2ccf0f0bbe61ff3d7a20f251
|
||||
|
||||
default @Nullable SlotAccess getChestVehicleSlot(final int slot) {
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6ded810819 100644
|
||||
index 4a177b4e714ba52cc18024d1233c9425afb93741..fa1f7dd22959632aaa54e72c8caf13ea072e7ca7 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -293,6 +293,14 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -294,6 +294,14 @@ public abstract class AbstractContainerMenu {
|
||||
this.sendAllDataToRemote();
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
private void updateDataSlotListeners(final int id, final int currentValue) {
|
||||
for (ContainerListener containerListener : this.containerListeners) {
|
||||
containerListener.dataChanged(this, id, currentValue);
|
||||
@@ -449,7 +457,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -450,7 +458,7 @@ public abstract class AbstractContainerMenu {
|
||||
&& (this.quickcraftType == QUICKCRAFT_TYPE_CLONE || carriedItemStack.getCount() >= this.quickcraftSlots.size())
|
||||
&& this.canDragTo(slot)) {
|
||||
int carry = slot.hasItem() ? slot.getItem().getCount() : 0;
|
||||
@@ -253,26 +253,25 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
int newCount = Math.min(getQuickCraftPlaceCount(this.quickcraftSlots.size(), this.quickcraftType, source) + carry, maxSize);
|
||||
remaining -= newCount - carry;
|
||||
// slot.setByPlayer(source.copyWithCount(newCount));
|
||||
@@ -557,7 +565,7 @@ public abstract class AbstractContainerMenu {
|
||||
slot.setByPlayer(carried);
|
||||
@@ -558,7 +566,7 @@ public abstract class AbstractContainerMenu {
|
||||
slotx.setByPlayer(carried);
|
||||
}
|
||||
} else if (ItemStack.isSameItemSameComponents(clicked, carried)) {
|
||||
- Optional<ItemStack> newCarried = slot.tryRemove(clicked.getCount(), carried.getMaxStackSize() - carried.getCount(), player);
|
||||
+ Optional<ItemStack> newCarried = slot.tryRemove(clicked.getCount(), org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(carried) - carried.getCount(), player); // Leaves - item over-stack util
|
||||
- Optional<ItemStack> newCarried = slotx.tryRemove(clicked.getCount(), carried.getMaxStackSize() - carried.getCount(), player);
|
||||
+ Optional<ItemStack> newCarried = slotx.tryRemove(clicked.getCount(), org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(carried) - carried.getCount(), player); // Leaves - item over-stack util
|
||||
newCarried.ifPresent(itemsTaken -> {
|
||||
carried.grow(itemsTaken.getCount());
|
||||
slot.onTake(player, itemsTaken);
|
||||
@@ -618,7 +626,8 @@ public abstract class AbstractContainerMenu {
|
||||
} else if (containerInput == ContainerInput.CLONE && player.hasInfiniteMaterials() && this.getCarried().isEmpty() && slotIndex >= 0) {
|
||||
Slot slot = this.slots.get(slotIndex);
|
||||
if (slot.hasItem()) {
|
||||
- this.setCarried(slot.safeClone(player));
|
||||
+ ItemStack item = slot.getItem();
|
||||
slotx.onTake(player, itemsTaken);
|
||||
@@ -620,7 +628,7 @@ public abstract class AbstractContainerMenu {
|
||||
Slot slotx = this.slots.get(slotIndex);
|
||||
if (slotx.hasItem()) {
|
||||
ItemStack item = slotx.getItem();
|
||||
- this.setCarried(item.copyWithCount(item.getMaxStackSize()));
|
||||
+ this.setCarried(item.copyWithCount(org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(item))); // Leaves - item over-stack util
|
||||
}
|
||||
} else if (containerInput == ContainerInput.THROW && this.getCarried().isEmpty() && slotIndex >= 0) {
|
||||
Slot slot = this.slots.get(slotIndex);
|
||||
@@ -653,15 +662,15 @@ public abstract class AbstractContainerMenu {
|
||||
Slot slotx = this.slots.get(slotIndex);
|
||||
@@ -655,15 +663,15 @@ public abstract class AbstractContainerMenu {
|
||||
int step = buttonNum == 0 ? 1 : -1;
|
||||
|
||||
for (int pass = 0; pass < 2; pass++) {
|
||||
@@ -291,7 +290,7 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
carried.grow(removed.getCount());
|
||||
}
|
||||
}
|
||||
@@ -764,7 +773,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -770,7 +778,7 @@ public abstract class AbstractContainerMenu {
|
||||
destSlot = endSlot - 1;
|
||||
}
|
||||
|
||||
@@ -300,7 +299,7 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
while (!itemStack.isEmpty() && (backwards ? destSlot >= startSlot : destSlot < endSlot)) {
|
||||
Slot slot = this.slots.get(destSlot);
|
||||
ItemStack target = slot.getItem();
|
||||
@@ -865,7 +874,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -871,7 +879,7 @@ public abstract class AbstractContainerMenu {
|
||||
public static boolean canItemQuickReplace(final @Nullable Slot slot, final ItemStack itemStack, final boolean ignoreSize) {
|
||||
boolean slotIsEmpty = slot == null || !slot.hasItem();
|
||||
return !slotIsEmpty && ItemStack.isSameItemSameComponents(itemStack, slot.getItem())
|
||||
@@ -309,7 +308,7 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
: slotIsEmpty;
|
||||
}
|
||||
|
||||
@@ -873,7 +882,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -879,7 +887,7 @@ public abstract class AbstractContainerMenu {
|
||||
return switch (quickCraftingType) {
|
||||
case 0 -> Mth.floor((float)itemStack.getCount() / quickCraftSlotsSize);
|
||||
case 1 -> 1;
|
||||
@@ -318,17 +317,17 @@ index c063694237c0c98ad370ac7fc170172f9ed3fb37..f6d37cba8ab5688501be9170720a0b6d
|
||||
default -> itemStack.getCount();
|
||||
};
|
||||
}
|
||||
@@ -897,7 +906,7 @@ public abstract class AbstractContainerMenu {
|
||||
for (int i = 0; i < container.getContainerSize(); i++) {
|
||||
ItemStack itemStack = container.getItem(i);
|
||||
if (!itemStack.isEmpty()) {
|
||||
- totalPercent += (float)itemStack.getCount() / container.getMaxStackSize(itemStack);
|
||||
+ totalPercent += org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackSignalStrength(container.getMaxStackSize(), itemStack); // Leaves - item over-stack util
|
||||
@@ -902,7 +910,7 @@ public abstract class AbstractContainerMenu {
|
||||
for (int i = 0; i < container.getContainerSize(); i++) {
|
||||
ItemStack itemStack = container.getItem(i);
|
||||
if (!itemStack.isEmpty()) {
|
||||
- totalPercent += (float)itemStack.getCount() / container.getMaxStackSize(itemStack);
|
||||
+ totalPercent += org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackSignalStrength(container.getMaxStackSize(), itemStack); // Leaves - item over-stack util
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/inventory/MerchantContainer.java b/net/minecraft/world/inventory/MerchantContainer.java
|
||||
index 7c2ab4868dc5bed6a2e444975ef48c68e9a0b6cf..a3500c25b519d7bcff673212eb88d11cee564f53 100644
|
||||
index e1b1a261a5f7a3702c1788daa38e7d367195382e..cb95fa63c585b1c3859bfd3e5d4d0e5dd84c7f0d 100644
|
||||
--- a/net/minecraft/world/inventory/MerchantContainer.java
|
||||
+++ b/net/minecraft/world/inventory/MerchantContainer.java
|
||||
@@ -108,7 +108,7 @@ public class MerchantContainer implements Container {
|
||||
@@ -341,7 +340,7 @@ index 7c2ab4868dc5bed6a2e444975ef48c68e9a0b6cf..a3500c25b519d7bcff673212eb88d11c
|
||||
this.updateSellItem();
|
||||
}
|
||||
diff --git a/net/minecraft/world/inventory/Slot.java b/net/minecraft/world/inventory/Slot.java
|
||||
index 0e86b025bad2c336cc360c2ce764dad0a75de1b6..1873b9376df57ff73d2a1583b60a512cfff7b998 100644
|
||||
index ee86a63c8d0d4c798ad09da87598d22c0e516840..57061d97bd368bfe934157293471fd546bb105ee 100644
|
||||
--- a/net/minecraft/world/inventory/Slot.java
|
||||
+++ b/net/minecraft/world/inventory/Slot.java
|
||||
@@ -75,7 +75,7 @@ public class Slot {
|
||||
@@ -354,10 +353,10 @@ index 0e86b025bad2c336cc360c2ce764dad0a75de1b6..1873b9376df57ff73d2a1583b60a512c
|
||||
|
||||
public @Nullable Identifier getNoItemIcon() {
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index a6805d436fd3675e385cbf8a3e5b262ae694ed90..f15ee24339b04e4fe395755bf3503c17886f1782 100644
|
||||
index fa588ab87f978b8aeaef0f1849aa532e5a4ad940..dd4a92a0ea94d16669535bde9b6728515dafe7f4 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -159,7 +159,7 @@ public final class ItemStack implements DataComponentHolder, ItemInstance, Chang
|
||||
@@ -160,7 +160,7 @@ public final class ItemStack implements DataComponentHolder, ItemInstance, Chang
|
||||
private int popTime;
|
||||
@Deprecated
|
||||
private @Nullable Holder<Item> item;
|
||||
@@ -367,17 +366,17 @@ index a6805d436fd3675e385cbf8a3e5b262ae694ed90..f15ee24339b04e4fe395755bf3503c17
|
||||
public static DataResult<ItemStack> validateStrict(final ItemStack itemStack) {
|
||||
DataResult<?> result = validateComponents(itemStack.getComponents());
|
||||
@@ -185,7 +185,8 @@ public final class ItemStack implements DataComponentHolder, ItemInstance, Chang
|
||||
|
||||
Holder<Item> item = Item.STREAM_CODEC.decode(input);
|
||||
DataComponentPatch patch = patchCodec.decode(input);
|
||||
- return new ItemStack(item, count, patch);
|
||||
+ ItemStack stack = new ItemStack(item, count, patch);
|
||||
+ return org.leavesmc.leaves.util.ItemOverstackUtils.decodeMaxStackSize(stack); // Leaves - item over-stack util
|
||||
} else {
|
||||
Holder<Item> item = Item.STREAM_CODEC.decode(input);
|
||||
DataComponentPatch patch = patchCodec.decode(input);
|
||||
- return new ItemStack(item, count, patch);
|
||||
+ ItemStack stack = new ItemStack(item, count, patch);
|
||||
+ return org.leavesmc.leaves.util.ItemOverstackUtils.decodeMaxStackSize(stack); // Leaves - item over-stack util
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,17 +194,20 @@ public final class ItemStack implements DataComponentHolder, ItemInstance, Chang
|
||||
if (itemStack.isEmpty()) {
|
||||
@@ -194,17 +195,20 @@ public final class ItemStack implements DataComponentHolder, ItemInstance, Chang
|
||||
if (itemStack.isEmpty() || itemStack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
|
||||
output.writeVarInt(0);
|
||||
} else {
|
||||
- output.writeVarInt(io.papermc.paper.util.sanitizer.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.sanitizer.ItemObfuscationSession.currentSession(), itemStack, itemStack.getCount())); // Paper - potentially sanitize count
|
||||
@@ -402,10 +401,10 @@ index a6805d436fd3675e385cbf8a3e5b262ae694ed90..f15ee24339b04e4fe395755bf3503c17
|
||||
}
|
||||
};
|
||||
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
index f0756f3d277103f95e4d5213b5ae788025b72f42..08c67084b5347bb1d6e65f17f3365ff33b542ec0 100644
|
||||
index 15ed625105539f402fb39275b292531fe388a7a0..2b97fd6af1c4956eb173b8c66c2a3efc8772a798 100644
|
||||
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
||||
@@ -203,7 +203,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
@@ -202,7 +202,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
Direction direction = blockState.getValue(ORIENTATION).front();
|
||||
Container into = HopperBlockEntity.getContainerAt(level, pos.relative(direction));
|
||||
ItemStack remaining = results.copy();
|
||||
@@ -415,10 +414,10 @@ index f0756f3d277103f95e4d5213b5ae788025b72f42..08c67084b5347bb1d6e65f17f3365ff3
|
||||
org.bukkit.craftbukkit.inventory.CraftItemStack oitemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(remaining);
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index ac93d2992fe780133439302ce5b851f9ac0c7353..5c23f48a09a73145ecd2166229b5737c42801db0 100644
|
||||
index 72a258f046c67c8970c91b8da31c0e745ec1e7ae..86a13f11fa6730f85add3e2ff47781d0fbcae170 100644
|
||||
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -395,7 +395,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -397,7 +397,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
ItemStack oldStack = this.items.get(slot);
|
||||
boolean same = !itemStack.isEmpty() && ItemStack.isSameItemSameComponents(oldStack, itemStack);
|
||||
this.items.set(slot, itemStack);
|
||||
@@ -428,7 +427,7 @@ index ac93d2992fe780133439302ce5b851f9ac0c7353..5c23f48a09a73145ecd2166229b5737c
|
||||
this.cookingTotalTime = getTotalCookTime(serverLevel, this, this.recipeType, this.cookSpeedMultiplier); // Paper - cook speed multiplier API
|
||||
this.cookingTimer = 0;
|
||||
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index b961ec1532937be513e12e5306a34e6cbff24aee..dbf29f7c085831ce0f62942dc4ea70913fae1b15 100644
|
||||
index 65ca3c97fdd60ebbdd366673c81c4375488f0cde..a7a13fb017a4c98db7639b8d672f3ad9d7814b7f 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -134,7 +134,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@@ -441,7 +440,7 @@ index b961ec1532937be513e12e5306a34e6cbff24aee..dbf29f7c085831ce0f62942dc4ea7091
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 019a320abd6d671e7df99ed9628ad021142be0f7..f154fbd18c306b284ef0b0dd882b31196633d0ba 100644
|
||||
index 75a8c007ba710aa6e77ba3ed9ae5f7868894629d..d036018ee64995ee754296014888ee70c0ea5ab3 100644
|
||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -155,7 +155,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -453,7 +452,7 @@ index 019a320abd6d671e7df99ed9628ad021142be0f7..f154fbd18c306b284ef0b0dd882b3119
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -682,9 +682,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -670,9 +670,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
if (current.isEmpty()) {
|
||||
// Spigot start - SPIGOT-6693, SimpleContainer#setItem
|
||||
ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
|
||||
+52
-50
@@ -1,52 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Fri, 5 Jun 2026 15:09:29 +0800
|
||||
Date: Wed, 21 Jan 2026 21:28:21 +0800
|
||||
Subject: [PATCH] Add config to enable tick command
|
||||
|
||||
only freeze/unfreeze/step/query/rate can run when enabled
|
||||
Because of some bug, we disabled sprint command
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index ff90abb47203c03636d3175f2b3efcf43517b3b0..a96da8ab0d8ca8241df79fbfca33f3e6072db367 100644
|
||||
index fc6402dd0a47f5b2792aa8a21703bfee18dd2388..96423a1a429f4fb1c975ad10726fe0e1ff70a6ad 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -239,6 +239,11 @@ public final class RegionizedServer {
|
||||
|
||||
private void globalTick(final long tickCount) {
|
||||
@@ -338,6 +338,11 @@ public final class RegionizedServer {
|
||||
this.randomWalk();
|
||||
*/
|
||||
++this.tickCount;
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
||||
+ MinecraftServer.getServer().tickRateManager().tick();
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.tick) {
|
||||
+ MinecraftServer.tickRateManager.tick();
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
// expire invalid click command callbacks
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.ADVENTURE_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.DIALOG_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
@@ -265,6 +270,14 @@ public final class RegionizedServer {
|
||||
@@ -366,6 +371,13 @@ public final class RegionizedServer {
|
||||
this.globalTick(world, tickCount);
|
||||
}
|
||||
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ rateManager.reduceSprintTicks();
|
||||
+ rateManager.endTickWork();
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.tick) {
|
||||
+ MinecraftServer.tickRateManager.reduceSprintTicks();
|
||||
+ MinecraftServer.tickRateManager.endTickWork();
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
+
|
||||
// tick connections
|
||||
this.tickConnections();
|
||||
|
||||
@@ -415,7 +428,7 @@ public final class RegionizedServer {
|
||||
@@ -513,7 +525,7 @@ public final class RegionizedServer {
|
||||
}
|
||||
|
||||
private void tickTime(final ServerLevel world, final long tickCount) {
|
||||
- if (world.tickTime) {
|
||||
+ if ((!fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command // Lophine - redirect
|
||||
+ if ((!fun.bm.lophine.config.modules.experiment.CommandConfig.tick || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command
|
||||
world.serverLevelData.setGameTime(world.serverLevelData.getGameTime() + tickCount);
|
||||
}
|
||||
}
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
index 58e557923dfe6cee39ec45e7f5aa43a5ded9f107..ae424c8931a2f82c6c8d4ddd8422a2c142a77a95 100644
|
||||
index 8b09834ec36f62a73e388124129afbdfa47e6c25..ce0ace6a0c6b11f124b601d97491fee102b36554 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
@@ -40,8 +40,8 @@ public final class TickRegionScheduler {
|
||||
@@ -55,27 +54,26 @@ index 58e557923dfe6cee39ec45e7f5aa43a5ded9f107..ae424c8931a2f82c6c8d4ddd8422a2c1
|
||||
|
||||
- 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; // Lophine - Add tick command support
|
||||
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Lophine - Add tick command support
|
||||
+ 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();
|
||||
static {
|
||||
@@ -509,8 +509,24 @@ public final class TickRegionScheduler {
|
||||
@@ -525,8 +525,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 long tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ final long tickCount;
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ if (rateManager.isSprinting() && rateManager.checkShouldSprintThisTick()) {
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.tick) {
|
||||
+ 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 = rateManager.tickrate();
|
||||
+ TICK_RATE = MinecraftServer.tickRateManager.tickrate();
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
@@ -83,41 +81,54 @@ index 58e557923dfe6cee39ec45e7f5aa43a5ded9f107..ae424c8931a2f82c6c8d4ddd8422a2c1
|
||||
+ // use max(), don't assume that tickStart >= scheduledStart
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
+ // Luminol end - Add tick command support
|
||||
|
||||
if (!this.tryMarkTicking()) {
|
||||
if (!this.cancelled.get()) {
|
||||
@@ -559,6 +575,11 @@ public final class TickRegionScheduler {
|
||||
@@ -575,6 +590,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 (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
||||
+ MinecraftServer.getServer().tickRateManager().endTickWork();
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.tick) {
|
||||
+ 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 21f2b9866e1cf36421e10a945fb6fbaa251009ed..409fcc5e95ca453fee7d3bd0375c910d79b507e6 100644
|
||||
index f54f6047f326189329e11338b17105f5555dde12..6f3143deb9e5ff17fae5920b0a4ba34e3d9545c4 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -259,7 +259,11 @@ public class Commands {
|
||||
@@ -265,7 +265,11 @@ public class Commands {
|
||||
TeleportCommand.register(this.dispatcher);
|
||||
TellRawCommand.register(this.dispatcher, context);
|
||||
//TestCommand.register(this.dispatcher, context); // Folia - region threading
|
||||
- //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
+ // Luminol start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.tick) {
|
||||
+ TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
TimeCommand.register(this.dispatcher, context);
|
||||
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 82315368d5580563fc77548f22a65d04ec73b622..8dcd684189d953aabddc4f62a3ecc5807c949ce6 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private @Nullable String serverId;
|
||||
public MinecraftServer.ReloadableResources resources;
|
||||
private final StructureTemplateManager structureTemplateManager;
|
||||
- private final ServerTickRateManager tickRateManager;
|
||||
+ public static ServerTickRateManager tickRateManager; // Luminol - Add tick command support
|
||||
private final ServerDebugSubscribers debugSubscribers = new ServerDebugSubscribers(this);
|
||||
protected WorldData worldData;
|
||||
private LevelData.RespawnData effectiveRespawnData = LevelData.RespawnData.DEFAULT;
|
||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
||||
index eeb2f88723b37bb3cada04bf3098dd46f0ed7316..8432d0ce22ddc9c9bfa98901e403697f40e53c99 100644
|
||||
index 8d0f810100a4eac65831913feeb9a9eeb0e6006a..afcab27006558f5d379df723968a612c1cadba60 100644
|
||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -110,7 +110,7 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
@@ -133,38 +144,29 @@ index eeb2f88723b37bb3cada04bf3098dd46f0ed7316..8432d0ce22ddc9c9bfa98901e403697f
|
||||
}
|
||||
}
|
||||
|
||||
+ // Lophine start - Add tick command support
|
||||
+ // Luminol start - Add tick command support
|
||||
+ public void reduceSprintTicks() {
|
||||
+ this.remainingSprintTicks--;
|
||||
+ }
|
||||
+ // Lophine end - Add tick command support
|
||||
+ // 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 e8d6a67143f3f0b4813e51bb273498bc404899b9..4421658e4061299dea2ff72a77506214cc9045d8 100644
|
||||
index 2dd0a8f2399a83b90356fcf0777bd1aec8eef5a9..c3dcfb633877ef230ab48a455ad4f5a1d601ba48 100644
|
||||
--- a/net/minecraft/server/commands/TickCommand.java
|
||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.server.ServerTickRateManager;
|
||||
@@ -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; // Lophine - Add tick command support
|
||||
+ 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(final CommandDispatcher<CommandSourceStack> dispatcher) {
|
||||
@@ -23,7 +23,7 @@ public class TickCommand {
|
||||
Commands.literal("tick")
|
||||
.requires(Commands.hasPermission(Commands.LEVEL_ADMINS))
|
||||
.then(Commands.literal("query").executes(c -> tickQuery(c.getSource())))
|
||||
- .then(
|
||||
+ .then( // Lophine - Add tick rate support
|
||||
Commands.literal("rate")
|
||||
.then(
|
||||
Commands.argument("rate", FloatArgumentType.floatArg(1.0F, 10000.0F))
|
||||
@@ -41,7 +41,7 @@ public class TickCommand {
|
||||
@@ -40,7 +40,7 @@ public class TickCommand {
|
||||
.executes(c -> step(c.getSource(), IntegerArgumentType.getInteger(c, "time")))
|
||||
)
|
||||
)
|
||||
@@ -173,7 +175,7 @@ index e8d6a67143f3f0b4813e51bb273498bc404899b9..4421658e4061299dea2ff72a77506214
|
||||
Commands.literal("sprint")
|
||||
.then(Commands.literal("stop").executes(c -> stopSprinting(c.getSource())))
|
||||
.then(
|
||||
@@ -49,7 +49,7 @@ public class TickCommand {
|
||||
@@ -48,7 +48,7 @@ public class TickCommand {
|
||||
.suggests((c, b) -> SharedSuggestionProvider.suggest(new String[]{"60s", "1d", "3d"}, b))
|
||||
.executes(c -> sprint(c.getSource(), IntegerArgumentType.getInteger(c, "time")))
|
||||
)
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sat, 18 Apr 2026 10:45:19 +0800
|
||||
Subject: [PATCH] Fix misbehaved ender pearls when player switched dimension
|
||||
|
||||
A fix of https://github.com/PaperMC/Folia/issues/421
|
||||
|
||||
Almost the same bug as:
|
||||
https://github.com/PaperMC/Folia/pull/418 and https://github.com/PaperMC/Folia/issues/393
|
||||
|
||||
diff --git a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java
|
||||
index d0dba5cc351903fb762e231a95f302479794185f..fb00f70505a6c548cd1311d7ea55c6a501e814e3 100644
|
||||
--- a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java
|
||||
@@ -264,7 +264,8 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||
int previousChunkZ = SectionPos.blockToSectionCoord(this.position().z());
|
||||
Entity owner = this.owner != null ? findOwnerIncludingDeadPlayer(serverLevel, this.owner.getUUID()) : null;
|
||||
if (owner instanceof ServerPlayer serverPlayer
|
||||
- && !owner.isAlive()
|
||||
+ // && !owner.isAlive() // Luminol - Fix misbehaved ender pearls when player switched dimension
|
||||
+ && (owner.getBukkitEntity().taskScheduler.isRetired() || serverPlayer.getHealth() <= 0.0D) // Luminol - Fix misbehaved ender pearls when player switched dimension
|
||||
&& !serverPlayer.wonGame
|
||||
&& serverPlayer.level().getGameRules().get(GameRules.ENDER_PEARLS_VANISH_ON_DEATH)) {
|
||||
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Thu, 2 Apr 2026 12:26:24 +0800
|
||||
Subject: [PATCH] Fix long commands support
|
||||
|
||||
Some long commands can be run through the dialog command, but paper has prohibited it.
|
||||
Revert to vanilla to fix it.
|
||||
|
||||
diff --git a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
index 491af2413a4e793a121fec368259ff8211ed031e..042cb4792b0084f143608f05dd08da133a31e435 100644
|
||||
--- a/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
+++ b/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
|
||||
@@ -12,7 +12,7 @@ public record ServerboundChatCommandPacket(String command) implements Packet<Ser
|
||||
);
|
||||
|
||||
private ServerboundChatCommandPacket(final FriendlyByteBuf input) {
|
||||
- this(input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs
|
||||
+ this(me.earthme.luminol.config.modules.fixes.LongCommandSupportConfig.enabled ? input.readUtf() : input.readUtf(MAX_CHAT_PACKET_INPUT_SIZE)); // Paper - limit chat command inputs // Luminol - add support for long command inputs
|
||||
}
|
||||
|
||||
private void write(final FriendlyByteBuf output) {
|
||||
+12
-12
@@ -24,10 +24,10 @@ index f58b10c7dec0d2b7dc2b3d1198539b74d13038f3..0a838a2015526dde2cb8d9006a71610e
|
||||
if (raid == null || raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel()) {
|
||||
player.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplification));
|
||||
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
||||
index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a17912b714 100644
|
||||
index 24cc4a15731edcb701596fe7051e188637457e37..5440dc0fb8bccabb65fd9681ab368ef5028e2ca9 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -269,7 +269,7 @@ public class Raid {
|
||||
@@ -268,7 +268,7 @@ public class Raid {
|
||||
}
|
||||
|
||||
public boolean absorbRaidOmen(final ServerPlayer player) {
|
||||
@@ -35,8 +35,8 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
+ MobEffectInstance effect = player.getEffect(fun.bm.lophine.config.modules.function.OldFeatureConfig.oldRaidBehavior ? MobEffects.BAD_OMEN : MobEffects.RAID_OMEN); // Leaves - old Raid Behavior
|
||||
if (effect == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -346,7 +346,13 @@ public class Raid {
|
||||
} else {
|
||||
@@ -345,7 +345,13 @@ public class Raid {
|
||||
}
|
||||
|
||||
if (shouldTryToFindSpawnPos) {
|
||||
@@ -51,7 +51,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
}
|
||||
|
||||
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
|
||||
@@ -401,7 +407,14 @@ public class Raid {
|
||||
@@ -400,7 +406,14 @@ public class Raid {
|
||||
int attempt = 0;
|
||||
|
||||
while (this.shouldSpawnGroup()) {
|
||||
@@ -67,7 +67,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
if (spawnPos != null) {
|
||||
this.started = true;
|
||||
this.spawnGroup(level, spawnPos);
|
||||
@@ -413,7 +426,7 @@ public class Raid {
|
||||
@@ -412,7 +425,7 @@ public class Raid {
|
||||
attempt++;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(level, this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
|
||||
this.stop();
|
||||
break;
|
||||
@@ -717,7 +730,7 @@ public class Raid {
|
||||
@@ -716,7 +729,7 @@ public class Raid {
|
||||
int spawnX = this.center.getX() + Mth.floor(Mth.cos(angle) * 32.0F * howFar) + this.random.nextInt(3) * Mth.floor(howFar);
|
||||
int spawnZ = this.center.getZ() + Mth.floor(Mth.sin(angle) * 32.0F * howFar) + this.random.nextInt(3) * Mth.floor(howFar);
|
||||
int spawnY = level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnX, spawnZ);
|
||||
@@ -85,7 +85,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
spawnPos.set(spawnX, spawnY, spawnZ);
|
||||
if (!level.isVillage(spawnPos) || secondsRemaining <= 7) {
|
||||
int delta = 10;
|
||||
@@ -900,4 +913,42 @@ public class Raid {
|
||||
@@ -899,4 +912,42 @@ public class Raid {
|
||||
this.spawnsPerWaveBeforeBonus = spawnsPerWaveBeforeBonus;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
+ private BlockPos getRavagerSpawnLocation(final ServerLevel serverWorld, final int proximity, final int tries) {
|
||||
+ int i = proximity == 0 ? 2 : 2 - proximity;
|
||||
+ BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
|
||||
+ net.minecraft.world.entity.SpawnPlacementType spawnLocation = net.minecraft.world.entity.SpawnPlacements.getPlacementType(EntityTypes.RAVAGER);
|
||||
+ net.minecraft.world.entity.SpawnPlacementType spawnLocation = net.minecraft.world.entity.SpawnPlacements.getPlacementType(EntityType.RAVAGER);
|
||||
+ for (int j = 0; j < tries; j++) {
|
||||
+ float f = serverWorld.getRandom().nextFloat() * (float) (Math.PI * 2);
|
||||
+ int k = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0F * (float) i + serverWorld.getRandom().nextInt(5));
|
||||
@@ -107,7 +107,7 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
+ }
|
||||
+ if (serverWorld.hasChunksAt(mutable.getX() - 10, mutable.getZ() - 10, mutable.getX() + 10, mutable.getZ() + 10)
|
||||
+ && serverWorld.isPositionEntityTicking(mutable)
|
||||
+ && (spawnLocation.isSpawnPositionOk(serverWorld, mutable, EntityTypes.RAVAGER)
|
||||
+ && (spawnLocation.isSpawnPositionOk(serverWorld, mutable, EntityType.RAVAGER)
|
||||
+ || serverWorld.getBlockState(mutable.below()).is(net.minecraft.world.level.block.Blocks.SNOW)
|
||||
+ && serverWorld.getBlockState(mutable).isAir())
|
||||
+ ) {
|
||||
@@ -129,10 +129,10 @@ index 32e20979b9343efa6b5903c7b6baf351205654a0..4ddc34822e88b011f58c70ca4f14e7a1
|
||||
+ // Leaves end - old FindSpawnPosition
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index 7e969cd81d2ac788515f4d9ad7584ade4c684a42..7555f0c5edf6a5419018203487cf8941e8095cb5 100644
|
||||
index bc2edc48ddefaab9022029f1a913a40b72e06024..1a51da9171c13711e106731c360051d183a40893 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -129,6 +129,42 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -128,6 +128,42 @@ public abstract class Raider extends PatrollingMonster {
|
||||
|
||||
raidWhenKilled.removeFromRaid(serverLevel, this, false);
|
||||
}
|
||||
+5
-5
@@ -6,11 +6,11 @@ Subject: [PATCH] Compatibility fix for Raid Revert and Cross Region Damage
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 5762eed9e99d918bee02d77c0ddd70be0aa0e2ec..cb1589e3aa663ca058fb5c3a24da700d4482cf35 100644
|
||||
index 29919b8f3c05c8ffaf66f86e441778eeefb293b1..1e820f34636f415ef78cdfbed06c6952a3cf1c0b 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1231,6 +1231,30 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
return changed;
|
||||
@@ -1234,6 +1234,30 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
+ // Lophine Start - raid revert adapt Cross Region Damage trace
|
||||
@@ -41,10 +41,10 @@ index 5762eed9e99d918bee02d77c0ddd70be0aa0e2ec..cb1589e3aa663ca058fb5c3a24da700d
|
||||
if (this.is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
|
||||
return !newEffect.is(MobEffects.INFESTED);
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index 7555f0c5edf6a5419018203487cf8941e8095cb5..44f8302a8c3fb867f122a97dc29f24a311f0ad91 100644
|
||||
index 1a51da9171c13711e106731c360051d183a40893..7094a67959e9747b2dfa55a5f5a3e90552d35466 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -159,7 +159,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -158,7 +158,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, 120000, amp, false, false, true);
|
||||
|
||||
if (serverLevel.getGameRules().get(net.minecraft.world.level.gamerules.GameRules.RAIDS)) {
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 20 Apr 2026 01:02:43 +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 223793bea54a483fefc66caa7e07b29ab351c339..303b9befb30d7156a9a71900ac1a6ea8f7e8d876 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -420,7 +420,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
Item item = itemStack.getItem();
|
||||
int orgCount = itemStack.getCount();
|
||||
// CraftBukkit start - fire PlayerPickupItemEvent
|
||||
- int canHold = player.getInventory().canHold(itemStack);
|
||||
+ int canHold = player.hasInfiniteMaterials() ? orgCount : player.getInventory().canHold(itemStack); // Luminol - Fix creative item picking
|
||||
int remaining = orgCount - canHold;
|
||||
boolean flyAtPlayer = false; // Paper
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 20 Apr 2026 01:10:30 +0800
|
||||
Subject: [PATCH] Fix entity portal-teleport speed
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 35ab432bbd59aba80a6eaca1769e6aa82c8a7e46..6950fa2462353f30ee02e1d0091cfcf289f63939 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1492,7 +1492,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
foliaProfiler.startTimer(timerId);
|
||||
try {
|
||||
// Folia end - profiler
|
||||
+ // Luminol start - Entity portal-teleport speed fix
|
||||
if (isActive) { // Paper - EAR 2
|
||||
+ if (!(entity instanceof Player) && entity.teleportTickType == 2) { // Luminol - after portal compensate tick
|
||||
+ entity.tick();
|
||||
+ entity.tick();
|
||||
+ entity.teleportTickType = 0;
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ if (entity.handlePortal()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ } else if (!(entity instanceof Player) && entity.teleportTickType == 1) { // Luminol - portal teleport only
|
||||
+ entity.teleportTickType++;
|
||||
+ 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)) {
|
||||
@@ -1503,6 +1523,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
// portalled
|
||||
return;
|
||||
}
|
||||
+ }
|
||||
+ // Luminol end - Entity portal-teleport speed fix
|
||||
// Folia end - region threading
|
||||
} else {entity.inactiveTick();} // Paper - EAR 2
|
||||
profiler.pop();
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 6fa3ac9a37dafa166d8e70aaf4ec369db0792200..bb02a5d2e752c7a3f0aba9ff115f3df61b9e141a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -388,6 +388,7 @@ public abstract class Entity
|
||||
public long activatedTick = Integer.MIN_VALUE;
|
||||
public boolean isTemporarilyActive;
|
||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||
+ public int teleportTickType = 0;// Luminol - Entity portal-teleport speed fix
|
||||
|
||||
public void inactiveTick() {
|
||||
}
|
||||
@@ -3597,6 +3598,7 @@ public abstract class Entity
|
||||
} else {
|
||||
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
|
||||
this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||
+ this.teleportTickType = 1; // Luminol - Entity portal-teleport speed fix
|
||||
} else if (!this.portalProcess.isInsidePortalThisTick()) {
|
||||
this.portalProcess.updateEntryPosition(pos.immutable());
|
||||
this.portalProcess.setAsInsidePortalThisTick(true);
|
||||
+9
-9
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/9d2bd3f7b0a48f00d
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
index 08e253662a2c183c0ab53a51cc07485cff33bf2c..1bd678d668a1febc129f4cb4d0d95ea27acc4252 100644
|
||||
index e9f86409bf9351e85ed31e747d9350dbf0cc441f..1f8f4d979d8766d6ba385f74cf8fcf8eea6c56c7 100644
|
||||
--- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
+++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
@@ -40,13 +40,22 @@ public interface CustomPacketPayload {
|
||||
@@ -36,10 +36,10 @@ index 08e253662a2c183c0ab53a51cc07485cff33bf2c..1bd678d668a1febc129f4cb4d0d95ea2
|
||||
};
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 143b7a167dcbf015a7318f2fe5e0798418fa2572..22ad0846be08292b07b363b6b96f7431f87a4f3d 100644
|
||||
index 8dcd684189d953aabddc4f62a3ecc5807c949ce6..0bedaa20bc2cae75a48357e69740ada2380a03dd 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2021,6 +2021,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2037,6 +2037,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
profiler.popPush("server gui refresh");
|
||||
|
||||
@@ -49,11 +49,11 @@ index 143b7a167dcbf015a7318f2fe5e0798418fa2572..22ad0846be08292b07b363b6b96f7431
|
||||
tickable.run();
|
||||
}
|
||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 010180899d69d0457dcc9feee4f1c062c5354995..279b5072596c062a7c800510ed914a9df8ce0698 100644
|
||||
index cf4b5e436b8d81657d1deaa5b06645016d9dc3cc..f3af5660a377e2eb823f79ec274feaf3284761cd 100644
|
||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -57,6 +57,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
public @Nullable String clientBrand;
|
||||
public @Nullable String playerBrand;
|
||||
public final java.util.Set<String> pluginMessagerChannels;
|
||||
// Paper end - retain certain values
|
||||
+ public final GameProfile profile; // Leaves - protocol core
|
||||
@@ -96,10 +96,10 @@ index 010180899d69d0457dcc9feee4f1c062c5354995..279b5072596c062a7c800510ed914a9d
|
||||
bridge.removeChannel(channel);
|
||||
}
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 1dcb4fe3e2c250554e4f065caf21b37ea659e621..1f20671b8bc07c77e8a3e60414bb2c8255e37385 100644
|
||||
index 527c495bb4f6007aee760b99cc0e9aa589931f4b..e6987eaf6e4d36d43cee4ece3ce22d31052a2a2a 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -318,6 +318,8 @@ public abstract class PlayerList {
|
||||
@@ -317,6 +317,8 @@ public abstract class PlayerList {
|
||||
//return; // Folia - region threading - must still allow the player to connect, as we must add to chunk map before handling disconnect
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ index 1dcb4fe3e2c250554e4f065caf21b37ea659e621..1f20671b8bc07c77e8a3e60414bb2c82
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
@@ -514,6 +516,7 @@ public abstract class PlayerList {
|
||||
@@ -517,6 +519,7 @@ public abstract class PlayerList {
|
||||
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
|
||||
}
|
||||
public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player, final net.kyori.adventure.text.Component leaveMessage) {
|
||||
@@ -116,7 +116,7 @@ index 1dcb4fe3e2c250554e4f065caf21b37ea659e621..1f20671b8bc07c77e8a3e60414bb2c82
|
||||
// Paper end - Fix kick event leave message not being sent
|
||||
ServerLevel level = player.level();
|
||||
player.awardStat(Stats.LEAVE_GAME);
|
||||
@@ -1417,6 +1420,7 @@ public abstract class PlayerList {
|
||||
@@ -1411,6 +1414,7 @@ public abstract class PlayerList {
|
||||
player.connection.send(recipes);
|
||||
player.getRecipeBook().sendInitialRecipeBook(player);
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Wed, 24 Jun 2026 22:52:13 +0800
|
||||
Subject: [PATCH] Fix player auto saving ignores interval
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 6c2196726a0669bddda456a089aeec0d9d9bdfa3..0802483484015fd92dec211aae9fd33e45621f74 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -208,7 +208,7 @@ import org.slf4j.Logger;
|
||||
|
||||
public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer { // Paper - rewrite chunk system
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- public static final long LAST_SAVE_ABSENT = Long.MIN_VALUE; public long lastSave = LAST_SAVE_ABSENT; // Paper // Folia - threaded regions - changed to nanoTime
|
||||
+ public static final long LAST_SAVE_ABSENT = Long.MIN_VALUE; public long lastSave = System.nanoTime(); // Paper // Folia - threaded regions - changed to nanoTime // Luminol - Fix player auto saving ignores interval
|
||||
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
|
||||
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
|
||||
private static final int FLY_STAT_RECORDING_SPEED = 25;
|
||||
+5
-5
@@ -8,10 +8,10 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/9d2bd3f7b0a48f00d
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 2e84df044e65d2f145a190d1bbbb7de205d85e77..4396f58571f137e0d351c27c7bf452fbeded4abc 100644
|
||||
index c380ab9f059da6219691e8bccd4f82b9ec5483b3..b2ea90b0ab461d202d492411471d2412a9c5d303 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -3136,7 +3136,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
@@ -3158,7 +3158,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
// Spigot start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||
// Paper start - Fix merchant inventory not closing on entity removal
|
||||
@@ -21,10 +21,10 @@ index 2e84df044e65d2f145a190d1bbbb7de205d85e77..4396f58571f137e0d351c27c7bf452fb
|
||||
}
|
||||
// Paper end - Fix merchant inventory not closing on entity removal
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 1f20671b8bc07c77e8a3e60414bb2c8255e37385..9d69106b5a1867af541c23dc92f63005315e27e2 100644
|
||||
index e6987eaf6e4d36d43cee4ece3ce22d31052a2a2a..168702a5ae51a2bc42c5761e13cb14008a8162c4 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -557,7 +557,7 @@ public abstract class PlayerList {
|
||||
@@ -560,7 +560,7 @@ public abstract class PlayerList {
|
||||
player.stopRiding();
|
||||
vehicle.getPassengersAndSelf().forEach(e -> {
|
||||
// Paper start - Fix villager boat exploit
|
||||
@@ -34,7 +34,7 @@ index 1f20671b8bc07c77e8a3e60414bb2c8255e37385..9d69106b5a1867af541c23dc92f63005
|
||||
if (human != null) {
|
||||
villager.setTradingPlayer(null);
|
||||
diff --git a/net/minecraft/world/inventory/MerchantMenu.java b/net/minecraft/world/inventory/MerchantMenu.java
|
||||
index 5979e3856da1287f4513c984c0414952bfeb3ea2..d12db44b0fb165280642d2f6016869ce54f3a1db 100644
|
||||
index 1dd82dfa739957f00d51c8b987289a002815f622..85a329565119d376139a7449e538c0d83dfb079f 100644
|
||||
--- a/net/minecraft/world/inventory/MerchantMenu.java
|
||||
+++ b/net/minecraft/world/inventory/MerchantMenu.java
|
||||
@@ -74,6 +74,7 @@ public class MerchantMenu extends AbstractContainerMenu {
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Bacteriawa <A3167717663@hotmail.com>
|
||||
Date: Tue, 21 Apr 2026 01:15:09 +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 dd63f14cf6b857202146348b2242673af1883cb7..88ccf32b3c1b3506fb76be5ae520168b6b167aa3 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -672,8 +672,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end - Configurable player collision; Handle collideRule team for player collision toggle
|
||||
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||
- this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||
- this.server.spark.enableAfterPlugins(this.server); // Paper - spark
|
||||
+ if (false) this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark // Luminol - Force disable builtin spark
|
||||
+ if (false) this.server.spark.enableAfterPlugins(this.server); // Paper - spark // Luminol - Force disable builtin spark
|
||||
io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // Paper - reset invalid state for event fire below
|
||||
io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.callReloadableRegistrarEvent(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS, io.papermc.paper.command.brigadier.PaperCommands.INSTANCE, org.bukkit.plugin.Plugin.class, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.INITIAL); // Paper - call commands event for regular plugins
|
||||
this.server.getCommandMap().registerServerAliases(); // Paper - relocate initial CommandMap#registerServerAliases() call
|
||||
@@ -1087,7 +1087,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
- this.server.spark.disable(); // Paper - spark
|
||||
+ if (false) this.server.spark.disable(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
this.server.disablePlugins();
|
||||
this.server.waitForAsyncTasksShutdown(); // Paper - Wait for Async Tasks during shutdown
|
||||
}
|
||||
@@ -1351,7 +1351,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.statusIcon = this.loadStatusIcon().orElse(null);
|
||||
this.status = this.buildServerStatus();
|
||||
|
||||
- this.server.spark.enableBeforePlugins(); // Paper - spark
|
||||
+ if (false) this.server.spark.enableBeforePlugins(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Folia start - region threading
|
||||
if (true) {
|
||||
io.papermc.paper.threadedregions.RegionizedServer.getInstance().init(); // Folia - region threading - only after loading worlds
|
||||
@@ -1665,7 +1665,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
if (this.emptyTicks >= emptyTickThreshold) {
|
||||
- this.server.spark.tickStart(); // Paper - spark
|
||||
+ if (false) this.server.spark.tickStart(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
if (this.emptyTicks == emptyTickThreshold) {
|
||||
LOGGER.info("Server empty for {} seconds, pausing", this.pauseWhenEmptySeconds());
|
||||
this.autoSave();
|
||||
@@ -1684,7 +1684,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - avoid issues with certain tasks not processing during sleep
|
||||
//this.server.spark.executeMainThreadTasks(); // Paper - spark // Folia - region threading
|
||||
this.tickConnection();
|
||||
- this.server.spark.tickEnd(((double)(System.nanoTime() - this.currentTickStart) / 1000000D)); // Paper - spark
|
||||
+ if (false) this.server.spark.tickEnd(((double)(System.nanoTime() - this.currentTickStart) / 1000000D)); // Paper - spark // Luminol - Force disable builtin spark
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
};
|
||||
// Folia end - region threading
|
||||
|
||||
- this.server.spark.tickStart(); // Paper - spark
|
||||
+ if (false) this.server.spark.tickStart(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent((int)region.getCurrentTick()).callEvent(); // Paper - Server Tick Events // Folia - region threading
|
||||
// Folia start - region threading
|
||||
if (region != null) {
|
||||
@@ -1784,7 +1784,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long remaining = scheduledEnd - endTime; // Folia - region ticking
|
||||
new com.destroystokyo.paper.event.server.ServerTickEndEvent((int)io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick(), ((double)(endTime - startTime) / 1000000D), remaining).callEvent(); // Folia - region ticking
|
||||
// Paper end - Server Tick Events
|
||||
- this.server.spark.tickEnd(((double)(endTime - startTime) / 1000000D)); // Paper - spark // Folia - region threading
|
||||
+ if (false) this.server.spark.tickEnd(((double)(endTime - startTime) / 1000000D)); // Paper - spark // Folia - region threading // Luminol - Force disable builtin spark
|
||||
// Folia - region threading
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 1ad4704523a3d90414ac514488207b1b5def9afd..1145d5839e621a02b7972c2ff1142f51db2237de 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -239,7 +239,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
me.earthme.luminol.config.ConfigManager.loadConfigFiles(); // Luminol - load config file
|
||||
- this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
+ if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
this.services().nameToIdCache().save(false); // Paper
|
||||
@@ -249,7 +249,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
||||
consoleThread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
- this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||
+ if (false) this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark // Luminol - Force disable builtin spark
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/ea91106ae57fc4cc1
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
||||
index 8432d0ce22ddc9c9bfa98901e403697f40e53c99..9ec141359c4422c1574dac71a88b7f5043350901 100644
|
||||
index afcab27006558f5d379df723968a612c1cadba60..ddab99a4cc70a1aa365208cb52d8d9b880cdeff6 100644
|
||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -139,4 +139,10 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
@@ -23,10 +23,10 @@ index 8432d0ce22ddc9c9bfa98901e403697f40e53c99..9ec141359c4422c1574dac71a88b7f50
|
||||
+ // Leaves end - servux
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 4396f58571f137e0d351c27c7bf452fbeded4abc..f1cf0deebe8a0df6509d647e7590126ee02444b8 100644
|
||||
index b2ea90b0ab461d202d492411471d2412a9c5d303..049339ae33569d627d2a00ef6cab9cad02c4c014 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2569,6 +2569,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
@@ -2584,6 +2584,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
||||
this.server.updateEffectiveRespawnData();
|
||||
}
|
||||
// Paper end
|
||||
+1
-1
@@ -5,7 +5,7 @@ Subject: [PATCH] LeavesHooks
|
||||
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||
index 08e3c75672e95248140eb0e0907cae5fbe54da34..dd17339fe2f9d7660b20eed05b61d6231302aa82 100644
|
||||
index d097b889499a8e410839e8f69d99dc9adfa2488b..b97d65b81ec4b86e00b7c06341b40dc5c02b9044 100644
|
||||
--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||
+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.world.phys.AABB;
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 28 Jun 2026 19:10:30 +0800
|
||||
Subject: [PATCH] Prevent tamable animals check can teleport in an unloaded
|
||||
chunk
|
||||
|
||||
Based on the implementation of Canvas(https://github.com/CraftCanvasMC/Canvas/commit/af2aacb12cbccfd328dda4961167786f5d9dad53)
|
||||
|
||||
We need to check canTeleport for TamableAnimal but this logic could do the check in another tick region itself, so we need to prevent that. But it needs to push off this check to schedule to the correct tickregion, which needs costly rewriting of this logic, so we could simply allow the read when the owner's position is loaded
|
||||
|
||||
diff --git a/net/minecraft/world/entity/TamableAnimal.java b/net/minecraft/world/entity/TamableAnimal.java
|
||||
index 95ba821a895c7ea8fffcbf1df2e7b3c174463d9e..b0a01673224522552672b7c8c9aa219108e8010f 100644
|
||||
--- a/net/minecraft/world/entity/TamableAnimal.java
|
||||
+++ b/net/minecraft/world/entity/TamableAnimal.java
|
||||
@@ -318,7 +318,8 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
||||
return false;
|
||||
}
|
||||
|
||||
- BlockState blockStateBelow = this.level().getBlockState(pos.below());
|
||||
+ BlockState blockStateBelow = this.level().getBlockStateIfLoaded(pos.below()); // Luminol - Prevent tamable animals check can teleport in an unloaded chunk
|
||||
+ if (blockStateBelow == null) return false; // Luminol - Prevent tamable animals check can teleport in an unloaded chunk
|
||||
if (!this.canFlyToOwner() && blockStateBelow.getBlock() instanceof LeavesBlock) {
|
||||
return false;
|
||||
}
|
||||
+2
-2
@@ -8,13 +8,13 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/3e96b237749a960f2
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
||||
index b712d7babed4941d11cf716133c8a07c5bcd51a3..b90077b44ce81d5d60f9d0ad2414f0b7c6b1e720 100644
|
||||
index 769dc39e11881d5f81a2405850cbcbd0842c5995..9fc97e8b01f66ada6af1fe76f4e27c9bb1a5dcfc 100644
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -708,6 +708,7 @@ public class ServerExplosion implements Explosion {
|
||||
public boolean shouldAffectBlocklikeEntities() {
|
||||
boolean mobGriefingEnabled = this.level.getGameRules().get(GameRules.MOB_GRIEFING);
|
||||
boolean isNotWindCharge = this.source == null || !this.source.is(EntityTypes.BREEZE_WIND_CHARGE) && !this.source.is(EntityTypes.WIND_CHARGE);
|
||||
boolean isNotWindCharge = this.source == null || !this.source.is(EntityType.BREEZE_WIND_CHARGE) && !this.source.is(EntityType.WIND_CHARGE);
|
||||
+ if (fun.bm.lophine.config.modules.function.OldFeatureConfig.oldExplosionDamageCalculator) isNotWindCharge = isNotWindCharge && (this.source == null || !this.source.isInWater()); // Leaves - Old MC TNT wet explosion no item damage
|
||||
return mobGriefingEnabled ? isNotWindCharge : this.blockInteraction.shouldAffectBlocklikeEntities() && isNotWindCharge;
|
||||
}
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 1 May 2026 21:52:07 +0800
|
||||
Subject: [PATCH] Prevent teleprotAsync calls in move events
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index c86b1fd5e200c478d178be32791b6e8c960d47e2..9be6d486082d344fb91fd74207eee83ca2f8e869 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -730,7 +730,9 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
+ this.player.blockTeleportAsync = true; // Luminol - Prevent teleprotAsync calls during move events
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
+ this.player.blockTeleportAsync = false; // Luminol - Prevent teleprotAsync calls during move events
|
||||
|
||||
// If the event is cancelled we move the player back to their old location.
|
||||
if (event.isCancelled()) {
|
||||
@@ -1741,7 +1743,9 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
+ this.player.blockTeleportAsync = true; // Luminol - Prevent teleprotAsync calls during move events
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
+ this.player.blockTeleportAsync = false; // Luminol - Prevent teleprotAsync calls during move events
|
||||
|
||||
// If the event is cancelled we move the player back to their old location.
|
||||
if (event.isCancelled()) {
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index bb02a5d2e752c7a3f0aba9ff115f3df61b9e141a..33b6f6c0316af44e47370a55e3515df4e3b706b6 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4478,12 +4478,25 @@ public abstract class Entity
|
||||
teleportTarget.cause(), teleportFlags, teleportComplete
|
||||
);
|
||||
}
|
||||
+ // Luminol start - Prevent teleprotAsync calls in move events
|
||||
+ public boolean blockTeleportAsync = false;
|
||||
+ // Luminol end
|
||||
|
||||
public final boolean teleportAsync(ServerLevel destination, Vec3 pos, Float yaw, Float pitch, Vec3 velocity,
|
||||
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, long teleportFlags,
|
||||
java.util.function.Consumer<Entity> teleportComplete) {
|
||||
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot teleport entity async");
|
||||
|
||||
+ // Luminol start - Prevent teleprotAsync calls in move events
|
||||
+ if (this.blockTeleportAsync && me.earthme.luminol.config.modules.fixes.PreventIncorrectTeleportAsyncConfig.enabled) {
|
||||
+ if (me.earthme.luminol.config.modules.fixes.PreventIncorrectTeleportAsyncConfig.throwWhenCaught) {
|
||||
+ throw new IllegalStateException("Call teleportAsync during move events!");
|
||||
+ }
|
||||
+
|
||||
+ LOGGER.error("Calling teleportAsync during move events!", new Throwable());
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
if (!ServerLevel.isInSpawnableBounds(new BlockPos(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getBlockX(pos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getBlockY(pos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getBlockZ(pos)))) {
|
||||
return false;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java b/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
index 3fcd534cee1f605a710ffc43eff4b5106c7dd40c..9b887b40236a212de513e3ceece1abfec5372ae2 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
@@ -282,7 +282,9 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
||||
|
||||
if (this.lastLocation != null && !this.lastLocation.equals(to)) {
|
||||
org.bukkit.event.vehicle.VehicleMoveEvent event = new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, this.lastLocation, to);
|
||||
+ this.blockTeleportAsync = true; // Luminol - Prevent teleprotAsync calls during move events
|
||||
event.callEvent();
|
||||
+ this.blockTeleportAsync = false; // Luminol - Prevent teleprotAsync calls during move events
|
||||
}
|
||||
this.lastLocation = vehicle.getLocation();
|
||||
// CraftBukkit end
|
||||
diff --git a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
index 30b99d9d0944399e6f3a74c4310cbf8f15cc5adc..9a414d8a1a2e95f2843d8f6e65cf5ad0b742bb26 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
@@ -318,7 +318,9 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle).callEvent();
|
||||
|
||||
if (!from.equals(to)) {
|
||||
+ this.blockTeleportAsync = true; // Luminol - Prevent teleprotAsync calls during move events
|
||||
new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to).callEvent();
|
||||
+ this.blockTeleportAsync = false; // Luminol - Prevent teleprotAsync calls during move events
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.updateFluidInteraction();
|
||||
+1
-1
@@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/79d9ef74c2684eb49
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/item/ShearsItem.java b/net/minecraft/world/item/ShearsItem.java
|
||||
index 9750a2a7f6d13f93119d0c6fba0bf11064d46e55..1913b30f1bfe013261b340fdf9917db90c98c695 100644
|
||||
index 837f8c56bf5d68dd8bfbeca8ae1b66be8316ddea..1098695e646c20f47bc4739034fcb69b96909667 100644
|
||||
--- a/net/minecraft/world/item/ShearsItem.java
|
||||
+++ b/net/minecraft/world/item/ShearsItem.java
|
||||
@@ -80,7 +80,10 @@ public class ShearsItem extends Item {
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 28 Jun 2026 19:19:31 +0800
|
||||
Subject: [PATCH] Sync dragon part when teleportation or firstly created
|
||||
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||
index aa53138b3670a8337b639472a6ab5ce46702ff76..ed27b73e787782f328906b2a061feeca25d42a24 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||
@@ -93,6 +93,7 @@ public final class ServerEntityLookup extends EntityLookup {
|
||||
if (entity instanceof ThrownEnderpearl enderpearl) {
|
||||
this.addEnderPearl(CoordinateUtils.getChunkKey(enderpearl.chunkPosition()), enderpearl.getId()); // Folia - region threading
|
||||
}
|
||||
+ if (entity instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon dragon) dragon.syncDragonPartsAfterTeleportTransform(); // Luminol - Sync dragon part when teleportation or firstly created
|
||||
entity.registerScheduler(); // Paper - optimise Folia entity scheduler
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 33b6f6c0316af44e47370a55e3515df4e3b706b6..8585068ce8a01b9fb90135f7bf3b35bb1647396a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -4462,6 +4462,7 @@ public abstract class Entity
|
||||
Entity copy = this.getType().create(destination, EntitySpawnReason.DIMENSION_TRAVEL);
|
||||
copy.restoreFrom(this);
|
||||
copy.transform(pos, yaw, pitch, velocity);
|
||||
+ if (copy instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon dragon) dragon.syncDragonPartsAfterTeleportTransform(); // Luminol - Sync dragon part when teleportation or firstly created
|
||||
// vanilla code used to call remove _after_ copying, and some stuff is required to be after copy - so add hook here
|
||||
// for example, clearing of inventory after switching dimensions
|
||||
this.postRemoveAfterChangingDimensions();
|
||||
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
index ab921ab4b4cc860abd77744f2bd201013e136e51..fd85816ec78c99f45c740ebf8052ff41f4859ed6 100644
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -1011,4 +1011,12 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
return 500;
|
||||
}
|
||||
// Paper end - init expToDrop for already dying spawned dragon
|
||||
+
|
||||
+ // Luminol start - Sync dragon part when teleportation or firstly created
|
||||
+ public void syncDragonPartsAfterTeleportTransform() {
|
||||
+ for (EnderDragonPart part : this.subEntities) {
|
||||
+ this.tickPart(part, 0.0, 0.0, 0.0); // offset -> 0.0
|
||||
+ }
|
||||
+ }
|
||||
+ // Luminol end
|
||||
}
|
||||
+3
-3
@@ -9,15 +9,15 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
||||
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 9907e58908eb17874cc938337888dfe4ad4c060f..b180b65ab4de4ca6f28b22c8650e894c7d328b82 100644
|
||||
index 8e5b79db12882432de575f2a76aa36eac6fc8f51..977a4ac391b8cf8b59c5c77becf9a5951d513526 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -348,9 +348,12 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -346,9 +346,12 @@ public class ServerGamePacketListenerImpl
|
||||
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(player.getUUID(), server::enforceSecureProfile);
|
||||
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
||||
this.tickEndEvent = new io.papermc.paper.event.packet.ClientTickEndEvent(player.getBukkitEntity()); // Paper - add client tick end event
|
||||
+ this.exchangeTarget = new org.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget(this); // Leaves - Syncmatica Protocol
|
||||
this.playerGameConnection = new io.papermc.paper.connection.PaperPlayerGameConnection(this); // Paper
|
||||
this.playerGameConnection = new io.papermc.paper.connection.PaperPlayerGameConnection(this); // Paper
|
||||
}
|
||||
|
||||
+ public final org.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget exchangeTarget; // Leaves - Syncmatica Protocol
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user