Compare commits

..

108 Commits

Author SHA1 Message Date
Klop233
705170d111 Update CI 2024-04-12 20:48:27 +08:00
Klop233
5fdb14947b Update CI 2024-04-12 20:34:39 +08:00
Klop233
d66ce6fb87 Update CI 2024-04-12 20:23:35 +08:00
Klop233
b81eb1857c Update CI 2024-04-12 20:08:32 +08:00
Klop233
cc0312cd76 update CI 2024-04-12 19:52:41 +08:00
Klop233
3313ff7c61 update CI 2024-04-12 19:52:07 +08:00
Klop233
06a87833f3 update CI 2024-04-12 19:51:19 +08:00
Klop233
6d39abe168 update CI 2024-04-12 19:45:36 +08:00
Klop233
9243eea30b update CI 2024-04-12 19:40:30 +08:00
Klop233
1334c291e5 update CI 2024-04-12 19:25:45 +08:00
Klop233
bd1178911d update CI 2024-04-12 19:03:54 +08:00
Klop233
41a500a5ad Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-04-12 18:46:57 +08:00
Klop233
a1ba257238 update CI 2024-04-12 18:46:28 +08:00
ShintoKosei
a40d934630 UPDATE CI 2024-04-06 23:18:23 +08:00
ShintoKosei
79b6b41b63 Jump Build To Debug CI <14> 2024-04-06 23:16:27 +08:00
ShintoKosei
52ab368069 Jump Build To Debug CI <13> 2024-04-06 23:15:21 +08:00
ShintoKosei
0bfac95070 Jump Build To Debug CI <12> 2024-04-06 22:35:25 +08:00
ShintoKosei
c69ed4279e Jump Build To Debug CI <11> 2024-04-06 22:34:17 +08:00
ShintoKosei
127aa3728a Jump Build To Debug CI <10> 2024-04-06 22:32:59 +08:00
ShintoKosei
1e7b4394ac Jump Build To Debug CI <9> 2024-04-06 22:30:17 +08:00
ShintoKosei
f129a1e860 Jump Build To Debug CI <8> 2024-04-06 22:23:51 +08:00
ShintoKosei
922a85f662 Update CI 2024-04-06 22:06:15 +08:00
ShintoKosei
d13bfadde4 Jump Build To Debug CI <8> 2024-04-06 22:02:55 +08:00
ShintoKosei
88aab8eadc Jump Build To Debug CI <7> 2024-04-06 22:00:28 +08:00
ShintoKosei
8914d3fcbc Jump Build To Debug CI <6> 2024-04-06 21:58:57 +08:00
ShintoKosei
d2f2ea4382 Jump Build To Debug CI <5> 2024-04-06 21:49:51 +08:00
ShintoKosei
a6888b27d0 Jump Build To Debug CI <4> 2024-04-06 21:30:20 +08:00
ShintoKosei
efabe850e0 Jump Build To Debug CI <3> 2024-04-06 21:29:40 +08:00
ShintoKosei
6c6786792f Jump Build To Debug CI <2> 2024-04-06 21:29:00 +08:00
ShintoKosei
dddb28fdf6 Jump Build To Debug CI <1> 2024-04-06 21:28:13 +08:00
ShintoKosei
8546ac56e2 More Fix CI 2024-04-06 21:12:48 +08:00
ShintoKosei
2c09274132 Fix CI 2024-04-06 20:58:34 +08:00
ShintoKosei
a9238f8e8e Update CI 2024-04-06 20:29:43 +08:00
ShintoKosei
7522e3c67b Update CI 2024-04-06 18:40:49 +08:00
ShintoKosei
71a7127bb1 Update CI 2024-04-06 18:13:22 +08:00
ShintoKosei
75266cceed Update CI 2024-04-06 17:44:45 +08:00
Klop233
8a292a655a update CI 2024-04-06 17:26:39 +08:00
Klop233
a0779956f1 update CI 2024-04-06 17:16:17 +08:00
Klop233
1de9ca9d5f update CI 2024-04-06 17:05:59 +08:00
Klop233
bc842c855a update CI 2024-04-06 17:03:35 +08:00
Klop233
120ddafc2f update CI 2024-04-06 16:56:25 +08:00
Klop233
3b1a8cc929 update CI 2024-04-06 16:44:12 +08:00
ShintoKosei
2914a219e2 update ci 2024-04-06 16:32:40 +08:00
ShintoKosei
07bbbd3d7e update ci 2024-04-06 16:21:50 +08:00
Klop233
e69cf4c9ec Update README.md 2024-04-06 16:13:21 +08:00
ShintoKosei
6b679bc02e [ci skip]Update CI 2024-04-06 16:10:40 +08:00
ShintoKosei
124a240fe9 [ci skip]update API.sh 2024-04-06 15:53:49 +08:00
ShintoKosei
e8b9aaee48 [ci skip]change gradle.properties: pre 2024-04-06 15:52:36 +08:00
ShintoKosei
eb3502eb86 [ci skip]Change file name 2024-04-06 15:29:18 +08:00
ShintoKosei
bdd41593e0 [ci skip]Add CI v2 2024-04-06 15:18:39 +08:00
ShintoKosei
06dcc037df Update CI 2024-04-06 15:17:19 +08:00
MrHua269
9247a01058 Added some optimizations from Gale 2024-04-06 05:19:02 +00:00
MrHua269
856ddfe7cc Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-04-06 02:38:37 +00:00
MrHua269
4013d9dc3b Add warn to region format config 2024-04-06 02:38:27 +00:00
ShintoKosei
ce8a2afb0f Create FUNDING.yml 2024-04-05 23:03:10 +08:00
ShintoKosei
ea3efdb597 [ci skip]Update README.md 2024-04-05 19:59:05 +08:00
ShintoKosei
678c3faeea [ci skpi]Update README.md 2024-04-05 19:47:26 +08:00
ShintoKosei
815adcc00e [ci skip]Update README 2024-04-05 16:48:49 +08:00
MrHua269
c0d766fd07 Fix my stupid rebrand 2024-04-05 04:33:53 +00:00
MrHua269
a9cd09f900 Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-04-05 01:19:11 +00:00
MrHua269
1452008bbe Fix non-working tripwire incorrect updating fix 2024-04-05 01:19:00 +00:00
Klop233
e71abbd761 fix CI 2024-04-04 19:37:52 +08:00
Klop233
6db86f10e7 Revert "update CI"
This reverts commit e1afa32f90.
2024-04-04 11:29:15 +08:00
Klop233
f134186657 Revert "Update build_1_20_4.yml"
This reverts commit 9551755b0d.
2024-04-04 11:29:13 +08:00
Klop233
ef1b7ce6f7 Revert "update CI"
This reverts commit 3c1be89214.
2024-04-04 11:29:11 +08:00
Klop233
f16e5c1064 Revert "update CI"
This reverts commit 6317a5399b.
2024-04-04 11:29:08 +08:00
Klop233
0b9a436044 Revert incorrect CI changes
This reverts commit 76f2aa58e1.
2024-04-04 11:28:58 +08:00
Klop233
76f2aa58e1 update CI 2024-04-03 21:35:54 +08:00
Klop233
6317a5399b update CI 2024-04-03 21:35:54 +08:00
Klop233
3c1be89214 update CI 2024-04-03 21:35:53 +08:00
Klop233
9551755b0d Update build_1_20_4.yml 2024-04-03 21:35:53 +08:00
Klop233
e1afa32f90 update CI 2024-04-03 21:35:53 +08:00
ShintoKosei
fa109ea506 [ci skip]fix README.md 2024-04-03 18:10:40 +08:00
MrHua269
ebe2b03455 Updated Upstream(Folia) 2024-03-30 10:17:45 +00:00
ShintoKosei
3456a29225 [ci skip]Update README.md 2024-03-28 13:38:22 +08:00
Dreeam
c06f539f46 Fix build 2024-03-25 11:17:56 -04:00
MrHua269
259d5173b8 Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-03-25 13:53:36 +00:00
MrHua269
3aa2070f49 Updated Upstream(Folia) 2024-03-25 13:53:21 +00:00
Klop233
248ac6ae2b [ci skip] change default to CN 2024-03-23 23:21:00 +08:00
MrHua269
54da5452d2 Leaves Replay Mod API 2024-03-17 02:15:26 +00:00
M2ke4U
b1a3d6f0d1 Merge pull request #7 from HaHaWTH/ver/1.20.4
Fix MC-172047 and MC-2025
2024-03-15 19:53:50 +08:00
HaHaWTH
9b761ef0c0 patch 2024-03-15 12:16:08 +08:00
HaHaWTH
e965f7285a Fix MC-2025 2024-03-15 03:33:09 +08:00
HaHaWTH
0f1f8b3f78 Fix MC-172047 2024-03-15 03:23:10 +08:00
M2ke4U
cce9600afb Fix jar renaming issue 2024-03-10 14:07:10 +08:00
M2ke4U
5ced673fd8 Set CI to Ubuntu 2024-03-10 13:54:55 +08:00
MrHua269
5a8c6b91d0 Publish tweaks(x2) 2024-03-10 05:44:56 +00:00
MrHua269
64f826fd98 Publish tweaks 2024-03-10 05:44:37 +00:00
MrHua269
5b0465efeb Added a simple watchdog for tick regions 2024-03-10 05:09:51 +00:00
MrHua269
2f30488144 Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-03-09 13:31:46 +00:00
MrHua269
1aca9f74c4 Tweaks in LeavesProtocolManager and fix config hot reloading issue in tpsbar 2024-03-09 13:31:12 +00:00
MrHua269
932c9f9194 Tweaks in LeavesProtocolManager and fix config hot reloading issue in tpsbar 2024-03-09 13:30:23 +00:00
MrHua269
eafe7cd5e3 [ci skip]Make project name to lowercase 2024-03-09 10:00:18 +00:00
Klop233
a319241fc2 ci test 2024-03-09 09:35:42 +08:00
Klop233
540bbd4f6a Create ci test 2024-03-09 09:34:58 +08:00
Klop233
8b8328c5b6 Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-03-09 08:40:26 +08:00
Klop233
c508de9f2a [ci skip] remove unuseful file 2024-03-09 08:39:38 +08:00
M2ke4U
483e958c58 Fix incorrect init logic in tpsbar 2024-03-08 22:17:09 +08:00
MrHua269
01abc6c424 Added config command 2024-03-03 13:01:24 +00:00
MrHua269
6d26556182 Add basement things of config file hot reloading 2024-03-03 12:13:18 +00:00
MrHua269
78e463d201 Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-03-03 11:52:27 +00:00
MrHua269
f67b792dd6 Only publish API module 2024-03-03 11:52:17 +00:00
NatJerry
38eb77a049 [ci skip]Update README_CN.md 2024-03-03 13:54:25 +08:00
NatJerry
624825f76b [ci skip]Update README.md 2024-03-03 13:53:30 +08:00
MrHua269
4dcf8fb6ff Merge remote-tracking branch 'origin/ver/1.20.4' into ver/1.20.4 2024-03-03 00:55:02 +00:00
MrHua269
a06ae51240 Adjust gradle config in main module and added option for dev bundle publishing 2024-03-03 00:54:21 +00:00
Klop233
3c80338a24 test 2024-03-02 14:37:19 +08:00
MrHua269
59a428e597 Updated Upstream(Folia) 2024-02-22 00:53:47 +00:00
84 changed files with 3129 additions and 529 deletions

14
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
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.net/a/Luminol

68
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,68 @@
name: Bug反馈 Bug report
description:
报告Bug插件不兼容情况以及其他相关问题。
Report issues with plugin incompatbility or other behavior related issues.
labels:
- bug
body:
- type: markdown
attributes:
value: |
请详细描述您所遇到的Bug。确保您**真的**遇到了**服务端**Bug而非原版特性或客户端Bug。
Please describe the bug you encountered in detail. Make sure you're **actually** hitting a **server-side** bug, not a vanilla feature or client-side bug.<br>
如果您确定的话,就按照下面的模板填充信息,并提交反馈。
If you are sure, follow the template below to fill in the information and submit your feedback.<br>
如果此bug被尝试修复您可以帮助我们测试并回复。若bug的确被修复您可以关闭issue来让开发者确认。
If this bug is tried to fix, you can help us test and reply. If the bug is fixed, you can close the issue to let the developer confirm.
- type: input
id: leavesMC-version
attributes:
label: 服务端版本 LuminolMC Version
description:
LuminolMC服务端发行版本 LuminolMC server release version (contains the git commit's hash)<br>
通过执行`/version`命令将获取到的内容复制到这里。 Run `/version` on your server and paste the full, unmodified output here.
placeholder: >
e.g. git-Luminol-"0635a89" (MC: 1.20.4)
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: 预期的行为 Expected behavior
description: 你期望看到的情况是什么样。What you expected to see.
placeholder: e.g. 使用 /tpsbar [NAME] 命令可以切换TPSBAR的开关
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: 观测到的实际行为 Observed/Actual behavior
description: 你实际看到的。 What you actually saw.
placeholder: e.g. 使用 /tpsbar [NAME] 命令切换不了TPSBAR
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: 复现步骤 Steps/models to reproduce
description:
这里应该有一个图片、视频或其他信息来展现你的问题。<br>
This may include a build schematic, a video, or detailed instructions to help reconstruct the issue.
placeholder: e.g. 登录其他账号,使用 /tpsbar [NAME] 命令切换不了TPSBAR
validations:
required: true
- type: textarea
id: plugin-list
attributes:
label: 插件与数据包列表。 Plugin and Datapack List.
description:
服务器上的所有插件和数据包列表。
All plugins and datapacks running on your server.<br>
执行命令`/plugins`查看插件列表。执行命令`/datapack list`查看数据包列表。
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
id: other
attributes:
label: 更多详细信息。 The more information.

View File

@@ -0,0 +1,31 @@
name: 新的需求 Feature Request
description:
为Luminol提供新的想法。
Suggest an idea for Luminol.
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
感谢您为 Luminol 提交新的需求!请尽可能详细地描述,以便我们可以更轻松地考虑和审查请求。
Thank you for filling out a feature request for Luminol! Please be as detailed as possible so that we may consider and review the request easier.<br>
请搜索所有问题以避免重复的功能请求。如果您期望的功能已存在,请回复如果您有什么要补充的。
We ask that you search all the issues to avoid a duplicate feature request. If one exists, please reply if you have anything to add.<br>
在请求新功能之前,请确保您使用的是最新版本并且您请求的功能不在 Luminol 中。
Before requesting a new feature, please make sure you are using the latest version and that the feature you are requesting is not already in Paper.<br>
我们的开发人员可能没有过多时间来测试新功能的可用性如新功能进入Test状态您可以帮助我们进行测试并回复。
Our developers may not have much time to test the usability of new functions. If the new functions enter the Test state, you can help us test and reply.
- type: textarea
id: feature
attributes:
label: 描述你希望添加的功能。 Describe the feature you'd like.
placeholder: e.g. 添加新的PATH
validations:
required: true
- type: textarea
id: othre
attributes:
label: 其他 Other
description: 添加其他的信息。 Add any other context or screenshots about the feature request below.

View File

@@ -17,7 +17,7 @@ permissions: write-all
jobs:
build:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -37,21 +37,21 @@ jobs:
- name: Build project to paperclip jar
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: createReobfPaperclipJar
arguments: createReobfBundlerJar createReobfPaperclipJar
- name: Capture build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
- name: Publish API
- name: Publish All
run: |
echo "GITHUB_USERNAME=LuminolCI" >> $GITHUB_ENV
export GITHUB_USERNAME=LuminolCI
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish
./gradlew publish -PpublishDevBundle=true
- name: Rename jar file
run: mv build/libs/Luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar
run: mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar
- name: Release Artifacts
uses: svenstaro/upload-release-action@v2
with:

64
.github/workflows/build_1_20_4_v2.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Luminol CI v2 - Ver/1.20.4
on:
push:
branches: [ "ver/1.20.4" ]
pull_request:
branches: [ "ver/1.20.4" ]
# workflow_dispatch:
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
environment: default
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Git Config
run: |
git config --global user.email "ci@luminolmc.com"
git config --global user.name "Luminol CI"
- name: Apply Patches
run: ./gradlew applyPatches
- name: Build
run: ./gradlew createReobfBundlerJar createReobfPaperclipJar
- uses: "actions/upload-artifact@v3"
with:
name: "Luminol CI Artifacts"
path: "build/libs/*.jar"
- name: Rename jar file
run: |
mv build/libs/luminol-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-bundler.jar
mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar
- name: setenv
run: |
sh scripts/SetENV.sh
echo "${{ env.tag }}"
- name: Create Release
if: "!contains(github.event.commits[0].message, '[release-skip]')"
uses: ncipollo/release-action@v1.12.0
with:
tag: ${{ env.tag }}
name: Luminol ${{ env.mcversion }} - ${{ env.commitid }}
body: |
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commitid }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ env.tag }}/luminol-1.20.4-paperclip.jar)
This release is automatically compiled by GitHub Actions
artifacts: |
build/libs/luminol-1.20.4-bundler.jar
build/libs/luminol-1.20.4-paperclip.jar
generateReleaseNotes: true
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Push to Api
if: "!contains(github.event.commits[0].message, '[release-skip]')"
env:
secret_v2: ${{ secrets.API_KEY }}
tag: ${{ env.tag }}
run: sh scripts/PushToAPI.sh

7
.gitignore vendored
View File

@@ -33,7 +33,6 @@ target/
dependency-reduced-pom.xml
# various other potential build files
build/
bin/
dist/
manifest.mf
@@ -51,8 +50,10 @@ manifest.mf
# other stuff
run/
# Luminol
build-data/
Hearse-API
Hearse-Server
Luminol-API
Luminol-Server
paper-api-generator
*.jar
/patches2/todo/

View File

@@ -1,7 +1,7 @@
<img src="./public/image/Luminol_5.png" alt="Logo" align="right" width="250">
# Luminol
<h4>Luminol is a Folia fork with many useful optimizations, configurable vanilla features, and more API supports, and it was designed for survival and anarchy servers</h4>
<h4>Luminol 是一个基于Folia的分支具有许多有用的优化、可配置的原版特性和更多的API支持它专为生存和无政府服务器设计</h4>
[![MIT License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Luminol?style=flat-square)](https://github.com/LuminolMC/Luminol/issues)
@@ -9,27 +9,27 @@
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Luminol?style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/LuminolMC/Luminol/total?style=flat-square)
**English** | [中文](./README_CN.md)
[English](./README_EN) | **中文**
## Features
- Configurable vanilla features
- Tpsbar support
- Linear region file format(from kaiiju)
- Useful optimizations to improve the performance of single threaded region
- More API support for plugin development (W.I.P)
## 特性
- 可配置的原版特性
- Tpsbar 支持
- 线性区域文件格式 (from kaiiju)
- 对单线程区域性能的优化
- 更多的插件开发API支持进行中
## Download
Any versions are available in the [release](https://github.com/LuminolMC/Luminol/releases), also you can build it by yourself through [the following steps](https://github.com/LuminolMC/Luminol#build).
## 下载
任何版本都可以在 [Release](https://github.com/LuminolMC/Luminol/releases) 中找到,你也可以通过[以下步骤](./README.md#构建)自己构建。
## Build
To build a paperclip jar, you need to run the following command. You can find the jar in build/libs(Note: JDK17 is needed)
## 构建
要构建一个paperclip jar你需要运行以下命令。你可以在build/libs中找到jar注意需要`JDK17`
```shell
./gradlew applyPatches && ./gradlew createReobfPaperclipJar
```
## Using API
For gradle:
## 使用API
使用 Gradle:
```kotlin
dependencies {
@@ -37,7 +37,7 @@ dependencies {
}
```
For maven
使用 Maven
```xml
<dependency>
@@ -47,28 +47,31 @@ For maven
</dependency>
```
## Contact
> If you are interested in this project or have any issue, feel free to ask us.
## 联系方式
> 如果您对这个项目感兴趣或有任何问题,请随时向我们提问。
QQ Group: `368632360` | QQ Channel: [Click To Join](https://pd.qq.com/s/eq9krf9j)
QQ群: [368632360](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=MfosKhcDd8Fdxn1MREuZ8Krbf9T6jiBC&authKey=3cm6qdHohON3gHnuD63FK4k07fIbrWnY4hdyq8OmELsfjMVP1kbFTJY9mRyM2Rkj&noverify=0&group_code=368632360) | QQ频道: [点击加入](https://pd.qq.com/s/eq9krf9j) | Telegram: [点击加入](https://t.me/LuminolMC) | Discord: [点击加入](https://discord.gg/5hgtU72w33)
## Notice
**This project is not related to Leaves.Do not report any bugs about protocol support to leaves because the protocol supports are already refactored.**
> [!WARNING]
> **此项目与Leaves无关。不要向Leaves报告任何有关协议支持的错误因为协议支持已经重构**
## About Issue
When you meet any problems, just ask us, we will do our best to solve it, but remember to state your problem clear and provide enough logs etc.</br>
## 关于 Issue
当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。
## Pull Requests
See [Contributing](./docs/CONTRIBUTING.md)
## 贡献代码
可[查看 Contributing](./docs/CONTRIBUTING.md)
## BStats
![bStats](https://bstats.org/signatures/server-implementation/Luminol.svg "bStats")
## Pleasestar us!
## 请给我们一个Star
> 你的每一个免费的 ⭐Star 就是我们每一个前进的动力。
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture>
</a>

View File

@@ -1,73 +0,0 @@
<img src="./public/image/Luminol_5.png" alt="Logo" align="right" width="250">
# Luminol
<h4>Luminol 是一个基于Folia的分支具有许多有用的优化、可配置的原版特性和更多的API支持它专为生存和无政府服务器设计</h4>
[![MIT License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Luminol?style=flat-square)](https://github.com/LuminolMC/Luminol/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Luminol?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Luminol?style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/LuminolMC/Luminol/total?style=flat-square)
[English](./README.md) | **中文**
## 特性
- 可配置的原版特性
- Tpsbar 支持
- 线性区域文件格式 (from kaiiju)
- 对单线程区域性能的优化
- 更多的插件开发API支持进行中
## 下载
任何版本都可以在 [Release](https://github.com/LuminolMC/Luminol/releases) 中找到,你也可以通过[以下步骤](./README_CN.md#构建)自己构建。
## 构建
要构建一个paperclip jar你需要运行以下命令。你可以在build/libs中找到jar注意需要`JDK17`
```shell
./gradlew applyPatches && ./gradlew createReobfPaperclipJar
```
## 使用API
使用 Gradle:
```kotlin
dependencies {
compileOnly("me.earthme.luminol:luminol-api:1.20.4-R0.1-SNAPSHOT")
}
```
使用 Maven
```xml
<dependency>
<groupId>me.earthme.luminol</groupId>
<artifactId>luminol-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
</dependency>
```
## 联系方式
> 如果您对这个项目感兴趣或有任何问题,请随时向我们提问。
QQ群`368632360` | QQ频道[点击加入](https://pd.qq.com/s/eq9krf9j)
## 关于 Issue
当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。
## 贡献代码
可[查看 Contributing](./docs/CONTRIBUTING_cn.md)
## BStats
![bStats](https://bstats.org/signatures/server-implementation/Luminol.svg "bStats")
## 请给我们一个 ⭐Star
> 你的每一个免费的 ⭐Star 就是我们每一个前进的动力。
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture>
</a>

74
README_EN.md Normal file
View File

@@ -0,0 +1,74 @@
<img src="./public/image/Luminol_5.png" alt="Logo" align="right" width="250">
# Luminol
<h4>Luminol is a Folia fork with many useful optimizations, configurable vanilla features, and more API supports, and it was designed for survival and anarchy servers</h4>
[![MIT License](https://img.shields.io/github/license/LuminolMC/Luminol?style=flat-square)](LICENSE)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Luminol?style=flat-square)](https://github.com/LuminolMC/Luminol/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Luminol?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Luminol?style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/LuminolMC/Luminol/total?style=flat-square)
**English** | [中文](./README)
## Features
- Configurable vanilla features
- Tpsbar support
- Linear region file format(from kaiiju)
- Useful optimizations to improve the performance of single threaded region
- More API support for plugin development (W.I.P)
## Download
Any versions are available in the [release](https://github.com/LuminolMC/Luminol/releases), also you can build it by yourself through [the following steps](./README_EN.md#build).
## Build
To build a paperclip jar, you need to run the following command. You can find the jar in build/libs(Note: JDK17 is needed)
```shell
./gradlew applyPatches && ./gradlew createReobfPaperclipJar
```
## Using API
For gradle:
```kotlin
dependencies {
compileOnly("me.earthme.luminol:luminol-api:1.20.4-R0.1-SNAPSHOT")
}
```
For maven
```xml
<dependency>
<groupId>me.earthme.luminol</groupId>
<artifactId>luminol-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
</dependency>
```
## Contact
> If you are interested in this project or have any issue, feel free to ask us.
QQ Group: [368632360](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=MfosKhcDd8Fdxn1MREuZ8Krbf9T6jiBC&authKey=3cm6qdHohON3gHnuD63FK4k07fIbrWnY4hdyq8OmELsfjMVP1kbFTJY9mRyM2Rkj&noverify=0&group_code=368632360) | QQ Channel: [Click To Join](https://pd.qq.com/s/eq9krf9j) | Telegram: [Click To Join](https://t.me/LuminolMC) | Discord: [Click To Join](https://discord.gg/5hgtU72w33)
> [!WARNING]
> **This project is not related to Leaves.Do not report any bugs about protocol support to leaves because the protocol supports are already refactored.**
## About Issue
When you meet any problems, just ask us, we will do our best to solve it, but remember to state your problem clear and provide enough logs etc.</br>
## Pull Requests
See [Contributing](./docs/CONTRIBUTING_EN.md)
## BStats
![bStats](https://bstats.org/signatures/server-implementation/Luminol.svg "bStats")
## Please ⭐star us!
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture>
</a>

View File

@@ -63,7 +63,7 @@ tasks.generateDevelopmentBundle {
libraryRepositories.set(
listOf(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
"https://maven.pkg.github.com/LuminolMC/Luminol",
)
)
}
@@ -98,3 +98,43 @@ paperweight {
}
}
}
tasks.generateDevelopmentBundle {
apiCoordinates.set("me.earthme.luminol:luminol-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
)
}
allprojects {
publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/LuminolMC/Luminol")
credentials.username = System.getenv("GITHUB_USERNAME")
credentials.password = System.getenv("GITHUB_TOKEN")
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
}
publishing {
if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
}

View File

@@ -1,70 +1,67 @@
Contributing to Luminol
Luminol贡献代码
===========
**English** | [中文](./CONTRIBUTING_cn.md)
[English](./CONTRIBUTING_EN.md) | **中文**
We're glad that you want to contribute to our project!
In general, our review of pull requests is very lenient.
And if you can follow the rules below, we can complete the review faster.
我们很开心您想为我们的项目做出贡献一般来说我们对PR的审核是十分宽松的
但是如果您可以遵守下列的规则,我们可以更快地完成审核。
## Please fork using your personal account
## 使用个人账户进行 Fork
We regularly merge existing PRs.
If there're some small problems, we'll help you solve them by editing your PR.
我们会定期尝试合并已有的 PR如果有一些小问题会尝试帮您解决这些问题。
But, if your PR is from a organization, we can NOT edit your PR, so we must merge your PR manually.
但是如果您使用了组织账号进行 PR我们就不能对您的 PR 进行修改了。因此我们只能关闭你的PR然后进行手动合并。
So, don't use orgnization accounts for fork!
所以,请不要使用组织账号进行 Fork
See also [This issue](https://github.com/isaacs/github/issues/1681), and then you'll know why we can't edit PRs from organizations.
您可以看看 [这个 Issue](https://github.com/isaacs/github/issues/1681) 来了解一下我们为什么无法修改组织账号的 PR。
## Development Environment
## 开发环境
Before coding, you need these softwares / tools as Dev Environment.
在开始开发之前,您首先需要拥有以下软件作为开发环境:
- `git`
- `JDK 17 or higher`
- `JDK 17 或更高版本`
## Understanding "Patches"
## 了解补丁(Patches
Luminol uses as the same patching system as Paper,
and has been divided into two directories for the purpose of modifying different parts of it:
Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的修改分成了两个目录:
- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit`.
- `luminol-api` - `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit` 进行的修改。
The patching system is based on git, and you can learn about it at here: <https://git-scm.com/docs/gittutorial>
补丁系统是基于 git 的,你可以在这里了解 git 的基本内容: <https://git-scm.com/docs/gittutorial>
If you have forked the main repository, then you should follow the steps below:
如果你已经 Fork 了主储存库,那么下面你应该这么做:
1. Clone your repository to local
2. Run Gradle's `applyPatches` task in your IDE or terminal (You can run `./gradlew applyPatches` directly in terminal.)
3. Enter `luminol-api` directory to carry out modifications.
1. 将你的仓库 clone 到本地;
2. 在你的 IDE 或 终端 内执行 Gradle `applyPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyPatches`
3. 进入 `luminol-api` 文件夹进行修改。
BTW, `luminol-api` and are not normal git repositories.
顺便一提,`luminol-api` 并不是正常的 git 仓库:
- Before applying patches, the base will point to unmodified source code.
- Every commit after the base is a patch.
- Only commits after the last commit of Paper will be considered Luminol' patches.
- 在应用补丁前,基点将会指向未被更改的源码
- 在基点后的每一个提交都是一个补丁
- 只有在 Folia 最后一个提交后的提交才会被视为 luminol 补丁
## Adding new patches
## 增加补丁
It's very easy to to add patches by following the steps below:
按照以下步骤增加一个补丁是非常简单的:
1. Modify the code of `luminol-api`
2. Add these changes to the local git repository (For example, `git add .`)
3. Commit these changes using `git commit -m <Commit Message>`
4. Run Gradle's task `rebuildPatches` to convert your commits to a new patch
5. Push your patches to your repository
1. `luminol-api` 进行修改;
2. 使用 git 添加你的修改,比如 `git add .`
3. 使用 `git commit -m <提交信息>` 进行提交;
4. 运行 Gradle 任务 `rebuildPatches` 将你的提交转化为一个补丁;
5. 将你生成的补丁文件进行推送。
After pushing, you can open a PR to submit your patches.
这样做以后,你就可以将你的补丁文件进行 PR 提交。
## Modifying patches
## 修改补丁
You can modify a existing patch by following the steps below:
你可以使用以下方法来修改一个补丁的内容:
1. Modify code at HEAD
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit
- If you want to edit the commit message, replace `--fixup` with `--squash`.
3. Run `git rebase -i --autosquash base` to rebase automatically, then just type `:q` to close the confirm page
4. Run Gradle's task `rebuildPatches` to modify existing patches
5. Push and PR again
1. 在 HEAD 上直接进行修改;
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;
- 如果你想要更改提交信息,你也可以用 `--squash` 来代替 `--fixup`
3. 使用 `git rebase -i --autosquash base` 来进行自动变基,你只需要输入 `:q` 来关闭确认页面即可;
4. 运行 Gradle 任务 `rebuildPatches` 来修改已被修改的补丁;
5. 将修改后的补丁 PR 发回储存库。

70
docs/CONTRIBUTING_EN.md Normal file
View File

@@ -0,0 +1,70 @@
Contributing to Luminol
===========
**English** | [中文](./CONTRIBUTING.md)
We're glad that you want to contribute to our project!
In general, our review of pull requests is very lenient.
And if you can follow the rules below, we can complete the review faster.
## Please fork using your personal account
We regularly merge existing PRs.
If there're some small problems, we'll help you solve them by editing your PR.
But, if your PR is from a organization, we can NOT edit your PR, so we must merge your PR manually.
So, don't use orgnization accounts for fork!
See also [This issue](https://github.com/isaacs/github/issues/1681), and then you'll know why we can't edit PRs from organizations.
## Development Environment
Before coding, you need these softwares / tools as Dev Environment.
- `git`
- `JDK 17 or higher`
## Understanding "Patches"
Luminol uses as the same patching system as Paper,
and has been divided into two directories for the purpose of modifying different parts of it:
- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit`.
The patching system is based on git, and you can learn about it at here: <https://git-scm.com/docs/gittutorial>
If you have forked the main repository, then you should follow the steps below:
1. Clone your repository to local
2. Run Gradle's `applyPatches` task in your IDE or terminal (You can run `./gradlew applyPatches` directly in terminal.)
3. Enter `luminol-api` directory to carry out modifications.
BTW, `luminol-api` and are not normal git repositories.
- Before applying patches, the base will point to unmodified source code.
- Every commit after the base is a patch.
- Only commits after the last commit of Paper will be considered Luminol' patches.
## Adding new patches
It's very easy to to add patches by following the steps below:
1. Modify the code of `luminol-api`
2. Add these changes to the local git repository (For example, `git add .`)
3. Commit these changes using `git commit -m <Commit Message>`
4. Run Gradle's task `rebuildPatches` to convert your commits to a new patch
5. Push your patches to your repository
After pushing, you can open a PR to submit your patches.
## Modifying patches
You can modify a existing patch by following the steps below:
1. Modify code at HEAD
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit
- If you want to edit the commit message, replace `--fixup` with `--squash`.
3. Run `git rebase -i --autosquash base` to rebase automatically, then just type `:q` to close the confirm page
4. Run Gradle's task `rebuildPatches` to modify existing patches
5. Push and PR again

View File

@@ -1,67 +0,0 @@
为Luminol贡献代码
===========
[English](./CONTRIBUTING.md) | **中文**
我们很开心您想为我们的项目做出贡献一般来说我们对PR的审核是十分宽松的
但是如果您可以遵守下列的规则,我们可以更快地完成审核。
## 使用个人账户进行 Fork
我们会定期尝试合并已有的 PR如果有一些小问题会尝试帮您解决这些问题。
但是如果您使用了组织账号进行 PR我们就不能对您的 PR 进行修改了。因此我们只能关闭你的PR然后进行手动合并。
所以,请不要使用组织账号进行 Fork
您可以看看 [这个 Issue](https://github.com/isaacs/github/issues/1681) 来了解一下我们为什么无法修改组织账号的 PR。
## 开发环境
在开始开发之前,您首先需要拥有以下软件作为开发环境:
- `git`
- `JDK 17 或更高版本`
## 了解补丁Patches
Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的修改分成了两个目录:
- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit` 进行的修改。
补丁系统是基于 git 的,你可以在这里了解 git 的基本内容: <https://git-scm.com/docs/gittutorial>
如果你已经 Fork 了主储存库,那么下面你应该这么做:
1. 将你的仓库 clone 到本地;
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyPatches`
3. 进入 `luminol-api` 文件夹进行修改。
顺便一提,`luminol-api` 并不是正常的 git 仓库:
- 在应用补丁前,基点将会指向未被更改的源码
- 在基点后的每一个提交都是一个补丁
- 只有在 Folia 最后一个提交后的提交才会被视为 luminol 补丁
## 增加补丁
按照以下步骤增加一个补丁是非常简单的:
1.`luminol-api` 进行修改;
2. 使用 git 添加你的修改,比如 `git add .`
3. 使用 `git commit -m <提交信息>` 进行提交;
4. 运行 Gradle 任务 `rebuildPatches` 将你的提交转化为一个补丁;
5. 将你生成的补丁文件进行推送。
这样做以后,你就可以将你的补丁文件进行 PR 提交。
## 修改补丁
你可以使用以下方法来修改一个补丁的内容:
1. 在 HEAD 上直接进行修改;
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;
- 如果你想要更改提交信息,你也可以用 `--squash` 来代替 `--fixup`
3. 使用 `git rebase -i --autosquash base` 来进行自动变基,你只需要输入 `:q` 来关闭确认页面即可;
4. 运行 Gradle 任务 `rebuildPatches` 来修改已被修改的补丁;
5. 将修改后的补丁 PR 发回储存库。

View File

@@ -1,9 +1,13 @@
group = me.earthme.luminol
version = 1.20.4-R0.1-SNAPSHOT
foliaCommit = 7f0a3178545b6e265e69d1a31df188c57158b4c9
foliaCommit = ef2c6971891b7571261591cd22d27ff555c5d3f2
org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx3G
mcVersion=1.20.4
GroupMCV=1.20
preVersion=false

View File

@@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: M2ke4U <79621885+MrHua269@users.noreply.github.com>
Date: Sun, 24 Dec 2023 12:11:45 +0800
Subject: [PATCH] Added maven publish
diff --git a/build.gradle.kts b/build.gradle.kts
index 3e3ea0e4e4ceb3283ad2b99957e3795d66a9a716..0f1846c506cbe25cdd37b8f4b7fd9f7aef2bf0b9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -199,3 +199,23 @@ tasks.check {
dependsOn(scanJarForOldGeneratedCode)
}
// Paper end
+
+// Luminol start
+publishing {
+ repositories {
+ maven {
+ name = "githubPackage"
+ url = uri("https://maven.pkg.github.com/LuminolMC/Luminol")
+
+ credentials.username = System.getenv("GITHUB_USERNAME")
+ credentials.password = System.getenv("GITHUB_TOKEN")
+ }
+
+ publications {
+ register<MavenPublication>("gpr") {
+ from(components["java"])
+ }
+ }
+ }
+}
+// Luminol end
\ No newline at end of file

View File

@@ -0,0 +1,129 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sun, 17 Mar 2024 00:00:45 +0000
Subject: [PATCH] Leaves Replay Mod API
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 4d6de4f2c67b1f122768806443766bd20c5ae617..b5155ffe86c490252fd0fcd1a00581e09808eeee 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2886,4 +2886,10 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
+
+ // Leaves start - Photographer API
+ public static @NotNull top.leavesmc.leaves.entity.PhotographerManager getPhotographerManager() {
+ return server.getPhotographerManager();
+ }
+ // Leaves end - Photographer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index d46f932b595495816ea038cf161bc7f2d85f177e..7d8a9bab880656e34d8c4dceb4dea3b0c1ced4c8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2518,4 +2518,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
public boolean isGlobalTickThread();
// Folia end - region threading API
+
+ // Leaves start - Photographer API
+ @NotNull top.leavesmc.leaves.entity.PhotographerManager getPhotographerManager();
+ // Leaves end - Photographer API
}
diff --git a/src/main/java/top/leavesmc/leaves/entity/Photographer.java b/src/main/java/top/leavesmc/leaves/entity/Photographer.java
new file mode 100644
index 0000000000000000000000000000000000000000..bfa6fe2a0ca095170aa5e073251402cf83a53ba0
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/entity/Photographer.java
@@ -0,0 +1,27 @@
+package top.leavesmc.leaves.entity;
+
+import org.bukkit.entity.Player;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+
+public interface Photographer extends Player {
+
+ @NotNull
+ public String getId();
+
+ public void setRecordFile(@NotNull File file);
+
+ public void stopRecording();
+
+ public void stopRecording(boolean async);
+
+ public void stopRecording(boolean async, boolean save);
+
+ public void pauseRecording();
+
+ public void resumeRecording();
+
+ public void setFollowPlayer(@Nullable Player player);
+}
diff --git a/src/main/java/top/leavesmc/leaves/entity/PhotographerManager.java b/src/main/java/top/leavesmc/leaves/entity/PhotographerManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..2889a4835edea4254a3d35fc7861983644a1dc4b
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/entity/PhotographerManager.java
@@ -0,0 +1,32 @@
+package top.leavesmc.leaves.entity;
+
+import org.bukkit.Location;
+import org.bukkit.util.Consumer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import top.leavesmc.leaves.replay.BukkitRecorderOption;
+
+import java.util.Collection;
+import java.util.UUID;
+
+public interface PhotographerManager {
+ @Nullable
+ public Photographer getPhotographer(@NotNull UUID uuid);
+
+ @Nullable
+ public Photographer getPhotographer(@NotNull String id);
+
+ @Nullable
+ public Photographer createPhotographer(@NotNull String id, @NotNull Location location);
+
+ @Nullable
+ public Photographer createPhotographer(@NotNull String id, @NotNull Location location, @NotNull BukkitRecorderOption recorderOption);
+
+ public void removePhotographer(@NotNull String id);
+
+ public void removePhotographer(@NotNull UUID uuid);
+
+ public void removeAllPhotographers();
+
+ public Collection<Photographer> getPhotographers();
+}
diff --git a/src/main/java/top/leavesmc/leaves/replay/BukkitRecorderOption.java b/src/main/java/top/leavesmc/leaves/replay/BukkitRecorderOption.java
new file mode 100644
index 0000000000000000000000000000000000000000..3df4a6055b91c28e273d6fb2697b608778f40a9c
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/replay/BukkitRecorderOption.java
@@ -0,0 +1,18 @@
+package top.leavesmc.leaves.replay;
+
+public class BukkitRecorderOption {
+
+ // public int recordDistance = -1;
+ public String serverName = "Leaves";
+ public BukkitRecordWeather forceWeather = BukkitRecordWeather.NULL;
+ public int forceDayTime = -1;
+ public boolean ignoreChat = false;
+ // public boolean ignoreItem = false;
+
+ public enum BukkitRecordWeather {
+ CLEAR,
+ RAIN,
+ THUNDER,
+ NULL
+ }
+}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Fix build
diff --git a/build.gradle.kts b/build.gradle.kts
index 08d434023226af0d2c469055a3b2188fe8a4ed38..48e9f6ff317bfc7077563e9c651d2a90da6bb37a 100644
index 905262067dabc7cbe5b08639fcefd3a996a937e0..c0608731dd7a352628a1e31997d0658dfa9f2ea8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
@@ -17,7 +17,7 @@ index 08d434023226af0d2c469055a3b2188fe8a4ed38..48e9f6ff317bfc7077563e9c651d2a90
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
exclude("io.papermc.paper", "paper-api")
}
@@ -74,7 +74,7 @@ tasks.jar {
@@ -75,7 +75,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",

View File

@@ -35,7 +35,7 @@ index e2f704c115fd6e00960bb56bb0779f1100c89c17..72b9343979de5aa8bb399cbe7cb8a795
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
private static final String GITHUB_BRANCH_NAME = "master";
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
+ private static final String DOWNLOAD_PAGE = "https://github.com/Era4FunMC/Luminol"; //Luminol
+ private static final String DOWNLOAD_PAGE = "https://github.com/LuminolMC/Luminol"; //Luminol
private static @Nullable String mcVer;
@Override
@@ -46,15 +46,15 @@ index e2f704c115fd6e00960bb56bb0779f1100c89c17..72b9343979de5aa8bb399cbe7cb8a795
- String[] parts = serverVersion.substring("git-Folia-".length()).split("[-\\s]"); // Folia
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Folia", GITHUB_BRANCH_NAME, parts[0]); // Folia
+ String[] parts = serverVersion.substring("git-Luminol-".length()).split("[-\\s]"); // Folia //Luminol
+ final Component updateMessage = getUpdateStatusMessage("Era4FunMC/Luminol", GITHUB_BRANCH_NAME, parts[0]); // Folia //Luminol
+ final Component updateMessage = getUpdateStatusMessage("LuminolMC/Luminol", GITHUB_BRANCH_NAME, parts[0]); // Folia //Luminol
final Component history = getHistory();
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b73699a08a368e6305759438c00066b0d5e7b39a..22aff010859dded150b6e3dd0644fe3c38dbaea9 100644
index d6a7188227cee9072976db98613324ee2d3dcdc8..8c9a80197247a384dd80747bf23fdd809d08b341 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1954,7 +1954,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1963,7 +1963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
@@ -64,7 +64,7 @@ index b73699a08a368e6305759438c00066b0d5e7b39a..22aff010859dded150b6e3dd0644fe3c
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 853afba9d0a814acc001ba5db5ef3653f8b16392..b9b1bcd165fb8864dda924a29d128d810b2ee7ab 100644
index 9dd9e86a5f7f30ce37b906ebfe4bccad0e52577f..c70eb23d9745bdbfcc340bb554cf0bf2db71f5de 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Empty config file base
diff --git a/build.gradle.kts b/build.gradle.kts
index b9c5ef4d15aa97a380419912e3ee09d094ae752e..e837f1f9b444318cbee8719b9dd0eb669478742e 100644
index 48e9f6ff317bfc7077563e9c651d2a90da6bb37a..d4baa7a193eba22be23921029ca4808a73de063d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
@@ -16,6 +16,82 @@ index b9c5ef4d15aa97a380419912e3ee09d094ae752e..e837f1f9b444318cbee8719b9dd0eb66
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
diff --git a/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..5c8745dffa80cf47e856d04d283937bda86881f8
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
@@ -0,0 +1,70 @@
+package me.earthme.luminol.commands;
+
+import me.earthme.luminol.config.LuminolConfig;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.TextColor;
+import org.bukkit.Location;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LuminolConfigCommand extends Command {
+ public LuminolConfigCommand(){
+ super("luminolconfig");
+ this.setPermission("luminol.commands.luminolconfig");
+ this.setDescription("Manage config file");
+ this.setUsage("/luminolconfig");
+ }
+
+ @Override
+ public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args, @Nullable Location location) throws IllegalArgumentException {
+ final List<String> result = new ArrayList<>();
+
+ if (args.length == 1){
+ result.add("reload");
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {
+ if (!this.testPermission(sender)){
+ sender.sendMessage(Component
+ .text("No permission to execute this command!")
+ .color(TextColor.color(255,0,0))
+ );
+ }
+
+ if (args.length < 1){
+ sender.sendMessage(
+ Component
+ .text("Wrong use!\n")
+ .color(TextColor.color(255,0,0))
+ );
+ return true;
+ }
+
+ switch (args[0]){
+ case "reload" -> {
+ LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
+ Component
+ .text("Reloaded config file!")
+ .color(TextColor.color(0,255,0))
+ ));
+ }
+
+ default -> sender.sendMessage(
+ Component
+ .text("Unknown action!\n")
+ .color(TextColor.color(255,0,0))
+ );
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/me/earthme/luminol/config/ConfigInfo.java b/src/main/java/me/earthme/luminol/config/ConfigInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..01b64c2cf6b437114337626c242e1da3fbdb8ead
@@ -71,6 +147,20 @@ index 0000000000000000000000000000000000000000..ac2a92fe0ddbebb71ea4dd8c96f461d0
+ return this.baseKeyName;
+ }
+}
diff --git a/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java b/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java
new file mode 100644
index 0000000000000000000000000000000000000000..559c11cb523c7cade34a0abfad15c988f5ad87fe
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/HotReloadUnsupported.java
@@ -0,0 +1,8 @@
+package me.earthme.luminol.config;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HotReloadUnsupported {
+}
diff --git a/src/main/java/me/earthme/luminol/config/IConfigModule.java b/src/main/java/me/earthme/luminol/config/IConfigModule.java
new file mode 100644
index 0000000000000000000000000000000000000000..9f6896711907ac30fe0c00130207b970007e4bb4
@@ -101,13 +191,18 @@ index 0000000000000000000000000000000000000000..9f6896711907ac30fe0c00130207b970
+}
diff --git a/src/main/java/me/earthme/luminol/config/LuminolConfig.java b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..63d1de1cebe2700010191560ea8b80dfdac2f9bc
index 0000000000000000000000000000000000000000..2b4e64796bf01b0a5fcb306850cd60837ed4d36b
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
@@ -0,0 +1,185 @@
@@ -0,0 +1,218 @@
+package me.earthme.luminol.config;
+
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
+import io.papermc.paper.threadedregions.RegionizedServer;
+import me.earthme.luminol.commands.LuminolConfigCommand;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
@@ -120,6 +215,7 @@ index 0000000000000000000000000000000000000000..63d1de1cebe2700010191560ea8b80df
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
@@ -132,7 +228,34 @@ index 0000000000000000000000000000000000000000..63d1de1cebe2700010191560ea8b80df
+ private static final File baseConfigFile = new File(baseConfigFolder,"luminol_global_config.toml");
+ private static final Set<IConfigModule> allInstanced = new HashSet<>();
+ private static CommentedFileConfig configFileInstance;
+
+ public static boolean alreadyInited = false;
+ private static MinecraftInternalPlugin NULL_PLUGIN = new MinecraftInternalPlugin();
+
+ public static void setupLatch(){
+ Bukkit.getCommandMap().register("luminolconfig","luminol",new LuminolConfigCommand());
+ alreadyInited = true;
+ }
+
+ public static void reload(){
+ RegionizedServer.ensureGlobalTickThread("Reload luminol config off global region thread!");
+
+ dropAllInstanced();
+ try {
+ loadConfig();
+ }catch (Exception e){
+ logger.error(e);
+ }
+ }
+
+ @Contract(" -> new")
+ public static @NotNull CompletableFuture<Void> reloadAsync(){
+ return CompletableFuture.runAsync(LuminolConfig::reload,task -> Bukkit.getGlobalRegionScheduler().run(NULL_PLUGIN,scheduled -> task.run()));
+ }
+
+ public static void dropAllInstanced(){
+ allInstanced.clear();
+ }
+
+ public static void loadConfig() throws IOException {
+ baseConfigFolder.mkdirs();
+
@@ -176,7 +299,7 @@ index 0000000000000000000000000000000000000000..63d1de1cebe2700010191560ea8b80df
+ for (Field field : fields) {
+ int modifiers = field.getModifiers();
+ if (Modifier.isStatic(modifiers) && !Modifier.isFinal(modifiers)) {
+ boolean skipLoad = field.getAnnotation(DoNotLoad.class) != null;
+ boolean skipLoad = field.getAnnotation(DoNotLoad.class) != null || (alreadyInited && field.getAnnotation(HotReloadUnsupported.class) != null);
+ ConfigInfo configInfo = field.getAnnotation(ConfigInfo.class);
+
+ if (skipLoad || configInfo == null){
@@ -291,7 +414,7 @@ index 0000000000000000000000000000000000000000..63d1de1cebe2700010191560ea8b80df
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 6b3242117d62175de462d04e4d178b49ae2521e9..d6b480565340f5edbf81d7b57c3199292b020615 100644
index 6b3242117d62175de462d04e4d178b49ae2521e9..4744ace98d1741db80ac2aea198f332d95c0ba33 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -19,6 +19,8 @@ import java.util.Locale;
@@ -303,11 +426,12 @@ index 6b3242117d62175de462d04e4d178b49ae2521e9..d6b480565340f5edbf81d7b57c319929
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.DefaultUncaughtExceptionHandlerWithName;
import net.minecraft.SharedConstants;
@@ -209,6 +211,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -209,6 +211,8 @@ 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
+ LuminolConfig.loadConfig(); //Luminol - load config file
+ LuminolConfig.setupLatch(); //Luminol - load config file
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper

View File

@@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..94e7c8910e3623163528a844fd7a08b3
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 22aff010859dded150b6e3dd0644fe3c38dbaea9..4468e6fdbbe527111f4410188f2f2df7f592f81e 100644
index 8c9a80197247a384dd80747bf23fdd809d08b341..0d756dd5181a2444175184227bef648d07c17236 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1954,7 +1954,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1963,7 +1963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Add config for unsafe teleportation
diff --git a/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java b/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb2fef0d808e2fc2950eded5b39651c66fff9103
index 0000000000000000000000000000000000000000..1b0de6f0ccab72c409a63dc1904829008e30328e
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/fixes/UnsafeTeleportationConfig.java
@@ -0,0 +1,20 @@
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..cb2fef0d808e2fc2950eded5b39651c6
+import me.earthme.luminol.config.IConfigModule;
+
+public class UnsafeTeleportationConfig implements IConfigModule {
+ @ConfigInfo(baseName = "enabled")
+ @ConfigInfo(baseName = "enabled", comments = "If you want to use sand duping,please turn on this")
+ public static boolean enabled = false;
+
+ @Override
@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..cb2fef0d808e2fc2950eded5b39651c6
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0725386d7ef47171012671725ceddfe92b43b203..78ad77dd1368d3743ea5091a81f63339f7921efe 100644
index 1d77bc6bdb87de1ad6c8740376391dedcaa73089..5e3a5e6b05254481ad413069b249ef554b591f8c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4046,6 +4046,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4065,6 +4065,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
protected boolean tryEndPortal() {
io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
@@ -43,7 +43,7 @@ index 0725386d7ef47171012671725ceddfe92b43b203..78ad77dd1368d3743ea5091a81f63339
ServerLevel world = this.portalWorld;
this.portalBlock = null;
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index a0c1db8cfebaa0344012cc0af18d6231cdcdcbb8..cb174f06f9701cc4f0ff479649f39ee9aa63a97a 100644
index afc9445941b984cc1122839e4a8a17cf27aa966e..0eb328e2b32179ebeefc90063441a1510e0058b8 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -61,6 +61,13 @@ public class EndPortalBlock extends BaseEntityBlock {

View File

@@ -1,54 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Wed, 7 Feb 2024 00:56:34 +0000
Subject: [PATCH] Add config for sand duping
diff --git a/src/main/java/me/earthme/luminol/config/modules/fixes/SandDupingFixConfig.java b/src/main/java/me/earthme/luminol/config/modules/fixes/SandDupingFixConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..7561dfd23724fc3f2cc580b2b53fa1469e3d098e
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/fixes/SandDupingFixConfig.java
@@ -0,0 +1,20 @@
+package me.earthme.luminol.config.modules.fixes;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.IConfigModule;
+
+public class SandDupingFixConfig implements IConfigModule {
+ @ConfigInfo(baseName = "enabled")
+ public static boolean enabled = false;
+
+ @Override
+ public EnumConfigCategory getCategory() {
+ return EnumConfigCategory.FIXES;
+ }
+
+ @Override
+ public String getBaseName() {
+ return "allow_sand_duping";
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 25b7b85cbd1130c5320e55b3c6b6f81ec228da81..c43f710a558cfe887a373a94ee48c4804986186d 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -133,7 +133,7 @@ public class FallingBlockEntity extends Entity {
@Override
public void tick() {
// Paper start - fix sand duping
- if (this.isRemoved()) {
+ if (!me.earthme.luminol.config.modules.fixes.SandDupingFixConfig.enabled && this.isRemoved()) { //Luminol - Add config for sand duping
return;
}
// Paper end - fix sand duping
@@ -149,7 +149,7 @@ public class FallingBlockEntity extends Entity {
this.move(MoverType.SELF, this.getDeltaMovement());
// Paper start - fix sand duping
- if (this.isRemoved()) {
+ if (!me.earthme.luminol.config.modules.fixes.SandDupingFixConfig.enabled && this.isRemoved()) { //Luminol - Add config for sand duping
return;
}
// Paper end - fix sand duping

View File

@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..22f3c6c70e4287f1bdd0b18f87f57efe
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ec25610cbffe30fecaeaadf9098e187bc15b5405..682ca5ec0aee427463d1a9f97292c6ea65ca2da0 100644
index 81749b8da7182abd1bf35629f33388e813dbeac0..10df17ad79092f3e226df08e58620694b3581758 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -3045,7 +3045,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..ee247014c9a2ec1bbb7f25ef41da110a
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6b560754382936d4889e5729613077a3401d8740..865804a16fce714497b2c025a869f972787442e3 100644
index 5e3a5e6b05254481ad413069b249ef554b591f8c..9bbfac91f97331b1b558264c867b7e00185291f2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -563,7 +563,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -567,7 +567,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;

View File

@@ -6,14 +6,19 @@ Subject: [PATCH] Add a simple tpsbar
diff --git a/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java b/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..ac8f0e3bf130ba6dfd7202e2f480352218154cdc
index 0000000000000000000000000000000000000000..01677f210fae53a108bfe194189cb4c233e9fa47
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/commands/TpsBarCommand.java
@@ -0,0 +1,40 @@
@@ -0,0 +1,50 @@
+package me.earthme.luminol.commands;
+
+import me.earthme.luminol.config.modules.misc.TpsBarConfig;
+import me.earthme.luminol.functions.GlobalServerTpsBar;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.util.RGBLike;
+import org.bukkit.ChatColor;
+import org.bukkit.Color;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
@@ -33,18 +38,23 @@ index 0000000000000000000000000000000000000000..ac8f0e3bf130ba6dfd7202e2f4803522
+ return true;
+ }
+
+ if (!TpsBarConfig.tpsbarEnabled){
+ sender.sendMessage(Component.text("Tpsbar was already disabled!").color(TextColor.color(255,0,0)));
+ return true;
+ }
+
+ if (!(sender instanceof Player player)){
+ sender.sendMessage(ChatColor.RED+"Only player can use this command!");
+ sender.sendMessage(Component.text("Only player can use this command!").color(TextColor.color(255,0,0)));
+ return true;
+ }
+
+ if (GlobalServerTpsBar.isPlayerVisible(player)) {
+ player.sendMessage(ChatColor.BLUE + "Disabled tps bar");
+ player.sendMessage(Component.text("Disabled tps bar").color(TextColor.color(0,255,0)));
+ GlobalServerTpsBar.setVisibilityForPlayer(player,false);
+ return true;
+ }
+
+ player.sendMessage(ChatColor.GREEN + "Enabled tps bar");
+ player.sendMessage(Component.text("Enabled tps bar").color(TextColor.color(0,255,0)));
+ GlobalServerTpsBar.setVisibilityForPlayer(player,true);
+
+ return true;
@@ -52,17 +62,15 @@ index 0000000000000000000000000000000000000000..ac8f0e3bf130ba6dfd7202e2f4803522
+}
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..b370787c3f525b9b978ad14b3e7056d7c92fcae5
index 0000000000000000000000000000000000000000..aafb2f5052c7c8e5971a47308253badb3027093c
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/TpsBarConfig.java
@@ -0,0 +1,40 @@
@@ -0,0 +1,49 @@
+package me.earthme.luminol.config.modules.misc;
+
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
+import me.earthme.luminol.commands.TpsBarCommand;
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.IConfigModule;
+import me.earthme.luminol.config.*;
+import me.earthme.luminol.functions.GlobalServerTpsBar;
+import org.bukkit.Bukkit;
+
@@ -77,6 +85,11 @@ index 0000000000000000000000000000000000000000..b370787c3f525b9b978ad14b3e7056d7
+ public static List<String> tpsColors = List.of("GREEN","YELLOW","RED","PURPLE");
+ @ConfigInfo(baseName = "ping_color_list")
+ public static List<String> pingColors = List.of("GREEN","YELLOW","RED","PURPLE");
+ @ConfigInfo(baseName = "update_interval_ticks")
+ public static int updateInterval = 15;
+
+ @DoNotLoad
+ private static boolean inited = false;
+
+ @Override
+ public EnumConfigCategory getCategory() {
@@ -92,16 +105,22 @@ index 0000000000000000000000000000000000000000..b370787c3f525b9b978ad14b3e7056d7
+ public void onLoaded(CommentedFileConfig configInstance){
+ if (tpsbarEnabled){
+ GlobalServerTpsBar.init();
+ }else{
+ GlobalServerTpsBar.cancelBarUpdateTask();
+ }
+
+ if (!inited){
+ Bukkit.getCommandMap().register("tpsbar","luminol",new TpsBarCommand("tpsbar"));
+ inited = true;
+ }
+ }
+}
diff --git a/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..7511bc3f6828ab712f644cf4292a5f831e8c8653
index 0000000000000000000000000000000000000000..3f1478dde900d671c4bfa43df80f629519cd602e
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
@@ -0,0 +1,206 @@
@@ -0,0 +1,225 @@
+package me.earthme.luminol.functions;
+
+import io.papermc.paper.threadedregions.ThreadedRegionizer;
@@ -133,18 +152,37 @@ index 0000000000000000000000000000000000000000..7511bc3f6828ab712f644cf4292a5f83
+ private static final Logger logger = LogManager.getLogger();
+
+ public static void init(){
+ Bukkit.getAsyncScheduler().runAtFixedRate(NULL_PLUGIN,c -> {
+ cancelBarUpdateTask();
+
+ Bukkit.getGlobalRegionScheduler().runAtFixedRate(NULL_PLUGIN,c -> {
+ tpsbarTask = c;
+ try {
+ update();
+ }catch (Exception e){
+ logger.error(e);
+ }
+ },1,1, TimeUnit.SECONDS);
+ },1,TpsBarConfig.updateInterval);
+ }
+
+ public static void removeAllBars(){
+ for (Map.Entry<UUID,BossBar> barEntry : uuid2Bossbars.entrySet()){
+ final UUID playerUUID = barEntry.getKey();
+ final BossBar tpsBar = barEntry.getValue();
+
+ final Player targetPlayer = Bukkit.getPlayer(playerUUID);{
+ if (targetPlayer != null){
+ targetPlayer.hideBossBar(tpsBar);
+ }
+ }
+ }
+
+ uuid2Bossbars.clear();
+ }
+
+ public static void cancelBarUpdateTask(){
+ if (tpsbarTask == null){
+ removeAllBars();
+
+ if (tpsbarTask == null || tpsbarTask.isCancelled()){
+ return;
+ }
+
@@ -309,10 +347,10 @@ index 0000000000000000000000000000000000000000..7511bc3f6828ab712f644cf4292a5f83
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index d6b480565340f5edbf81d7b57c3199292b020615..ea3b3f8b2318b8a1e8975e89c90cab05c6ab2835 100644
index 4744ace98d1741db80ac2aea198f332d95c0ba33..550fb11c64e3adb35bb7f78c53f0b5ae5ce9ff58 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -831,6 +831,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -832,6 +832,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override
public void stopServer() {
@@ -333,7 +371,7 @@ index cbc89b8898f9243776af88c2b04ad3c2e4e23fb6..318cb1e98a3d73b7893f07c9f0db3ada
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances getViewDistances() {
return this.viewDistances.get();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8fc071a6249193af5e1795cc19f50996ea22d96f..830616f7a3d1c3e25133229a74e08cbb9d412179 100644
index d2902fc7f3b7af59f181bd1e12435d946db7ad23..26f70965b45fa3c344781b569a651a4668d0621d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2287,6 +2287,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..502b93c7bda9e8577a1901a8777b7cf9
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ea3b3f8b2318b8a1e8975e89c90cab05c6ab2835..dd0d8ba5087532770358416be72bb0215b265180 100644
index 550fb11c64e3adb35bb7f78c53f0b5ae5ce9ff58..71151811c36c75ace1e41837123b320ae48a4b53 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -283,7 +283,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -284,7 +284,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
// Paper end - Add Velocity IP Forwarding Support

View File

@@ -0,0 +1,257 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sun, 10 Mar 2024 05:04:33 +0000
Subject: [PATCH] Add a simple watchdog for tick regions
diff --git a/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java b/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
index fc3d332aa1c1d469cedfe2aaa7102dcd78e25642..1ae61bc6603dd3ac290e3ead20416f9c5b63ff02 100644
--- a/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
+++ b/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
@@ -279,6 +279,7 @@ public final class RegionizedServer {
*/
private void globalTick(final int tickCount) {
+ me.earthme.luminol.utils.LuminolWatchDog.globalRegionHeartBeat(); //Luminol
/*
if (false) {
io.papermc.paper.threadedregions.ThreadedTicketLevelPropagator.main(null);
diff --git a/src/main/java/io/papermc/paper/threadedregions/ThreadedRegionizer.java b/src/main/java/io/papermc/paper/threadedregions/ThreadedRegionizer.java
index 531aa50f2c84e13358e8918bb0c15ea3cd036cb5..fd0053369eb68f0fd596d8acfba4a5247ef8105a 100644
--- a/src/main/java/io/papermc/paper/threadedregions/ThreadedRegionizer.java
+++ b/src/main/java/io/papermc/paper/threadedregions/ThreadedRegionizer.java
@@ -167,6 +167,8 @@ public final class ThreadedRegionizer<R extends ThreadedRegionizer.ThreadedRegio
if (removed != region) {
throw new IllegalStateException("Expected to remove " + region + ", but removed " + removed);
}
+
+ me.earthme.luminol.utils.LuminolWatchDog.onRegionDeath(region); //Luminol - Simple watchdog
}
public int getSectionCoordinate(final int chunkCoordinate) {
diff --git a/src/main/java/io/papermc/paper/threadedregions/TickRegions.java b/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
index 2ad25dd345ab42125d456f2b9cf67d8c4515c8b7..78c50292fb25e8703e9c91db892f05456f07d72f 100644
--- a/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
+++ b/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
@@ -402,6 +402,7 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
@Override
protected void tickRegion(final int tickCount, final long startTime, final long scheduledEnd) {
+ me.earthme.luminol.utils.LuminolWatchDog.tickRegionHeartBeat(); //Luminol - Simple watchdog
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler(); // Folia - profiler
profiler.startTick(); try { // Folia - profiler
MinecraftServer.getServer().tickServer(startTime, scheduledEnd, TimeUnit.MILLISECONDS.toMillis(10L), this.region);
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/WatchdogConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/WatchdogConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..71d80b401470db777a86274d32f178bb2aa023d5
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/WatchdogConfig.java
@@ -0,0 +1,27 @@
+package me.earthme.luminol.config.modules.misc;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.HotReloadUnsupported;
+import me.earthme.luminol.config.IConfigModule;
+
+public class WatchdogConfig implements IConfigModule {
+
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "enabled")
+ public static boolean enabled = false;
+ @ConfigInfo(baseName = "warn_period_ticks")
+ public static long warnPeriodTicks = 5 * 20;
+ @ConfigInfo(baseName = "timeout_ticks")
+ public static long timeOutTicks = 30 * 20;
+
+ @Override
+ public EnumConfigCategory getCategory() {
+ return EnumConfigCategory.MISC;
+ }
+
+ @Override
+ public String getBaseName() {
+ return "watchdog";
+ }
+}
diff --git a/src/main/java/me/earthme/luminol/utils/LuminolWatchDog.java b/src/main/java/me/earthme/luminol/utils/LuminolWatchDog.java
new file mode 100644
index 0000000000000000000000000000000000000000..6b4368cdf9762ad981345fef0f26cd008a4236ee
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/utils/LuminolWatchDog.java
@@ -0,0 +1,161 @@
+package me.earthme.luminol.utils;
+
+import com.google.common.collect.Maps;
+import io.papermc.paper.threadedregions.ThreadedRegionizer;
+import io.papermc.paper.threadedregions.TickRegionScheduler;
+import io.papermc.paper.util.StacktraceDeobfuscator;
+import me.earthme.luminol.config.modules.misc.WatchdogConfig;
+import net.minecraft.server.MinecraftServer;
+import org.apache.commons.lang3.tuple.Pair;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.concurrent.TimeUnit;
+
+public class LuminolWatchDog {
+ private static final Object keepaliveDataLock = new Object();
+ private static Pair<Thread,Long> globalRegionLastKeepalive = null;
+ private static final Map<Thread,Pair<ThreadedRegionizer.ThreadedRegion<?,?>,Long>> otherTickRegionKeepalive = Maps.newHashMap();
+ private static final Executor checkTimer = CompletableFuture.delayedExecutor(50, TimeUnit.MILLISECONDS);
+ private static final Logger logger = MinecraftServer.LOGGER;
+ private static int tickCount = 0;
+ private static boolean runScheduleNext = true;
+
+ public static void boot(){
+ runCheck();
+ }
+
+ private static void scheduleCheck(){
+ checkTimer.execute(LuminolWatchDog::runCheck);
+ }
+
+ private static void runCheck(){
+ try {
+ if (MinecraftServer.getServer().isStopped() || !runScheduleNext){
+ return;
+ }
+
+ tickCount++;
+
+ final List<Pair<Thread,Long>> threadsToWarn = new ArrayList<>();
+ final long currentTimeNano = System.nanoTime();
+ boolean shouldStopServer = false;
+
+ synchronized (keepaliveDataLock){
+ if (globalRegionLastKeepalive != null){
+ final Thread lastGlobalRegionThread = globalRegionLastKeepalive.getLeft();
+ final long lastTicked = globalRegionLastKeepalive.getRight();
+
+ final long timeEscaped = currentTimeNano - lastTicked;
+
+ if (timeEscaped >= WatchdogConfig.warnPeriodTicks * 50 * 1000 * 1000){
+ threadsToWarn.add(Pair.of(lastGlobalRegionThread,timeEscaped));
+ }
+ }
+
+ for(Pair<Thread,Long> warnInfo : threadsToWarn){
+ final Thread targetThread = warnInfo.getLeft();
+ final long timeEscaped = warnInfo.getRight();
+
+ final ThreadedRegionizer.ThreadedRegion<?,?> targetRegion;
+
+ synchronized (keepaliveDataLock){
+ targetRegion = otherTickRegionKeepalive.get(targetThread).getLeft();
+ }
+
+ if (tickCount % WatchdogConfig.warnPeriodTicks == 0){
+ dumpSingleRegion(targetThread,targetRegion,timeEscaped);
+ }
+
+ if (timeEscaped > WatchdogConfig.timeOutTicks * 50 * 1000 * 1000){
+ shouldStopServer = true;
+ runScheduleNext = false;
+ }
+ }
+
+ if (shouldStopServer){
+ MinecraftServer.getServer().stopServer();
+ }
+ }
+ }finally {
+ if (runScheduleNext){
+ scheduleCheck();
+ }
+ }
+ }
+
+ private static void dumpSingleRegion(@NotNull Thread thread, @Nullable ThreadedRegionizer.ThreadedRegion<?,?> region,long timeEscaped){
+ final StringBuilder messageBuilder = new StringBuilder();
+ messageBuilder.append("====================================").append("\n");
+ messageBuilder.append("There is a single region that has no responding in " + TimeUnit.NANOSECONDS.toSeconds(timeEscaped) + " seconds!").append("\n");
+ messageBuilder.append("If you believe this is a bug,please send it to github issue after checking your plugins!").append("\n");
+ messageBuilder.append("Tick Region: ").append(region == null ? "Global Region" : "ChunkX(Center): " + region.getCenterChunk().x + " ChunkZ(Center): " + region.getCenterChunk().z).append("\n");
+ messageBuilder.append("Thread Name: ").append(thread.getName()).append("\n");
+ messageBuilder.append("Thread Id: ").append(thread.getId()).append("\n");
+
+ final ThreadInfo targetThreadInfo = ManagementFactory.getThreadMXBean().getThreadInfo(thread.getId());
+
+ messageBuilder.append("Is Suspend: ").append(targetThreadInfo.isSuspended()).append("\n");
+ messageBuilder.append("Thread State: ").append(targetThreadInfo.getThreadState()).append("\n");
+ messageBuilder.append("Thread Priority: ").append(targetThreadInfo.getPriority()).append("\n");
+ messageBuilder.append("Thread Stack Trace:").append("\n");
+
+ for (StackTraceElement stackTraceElement : StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(thread.getStackTrace())){
+ messageBuilder.append("\t\t").append(stackTraceElement).append("\n");
+ }
+
+ messageBuilder.append("\n");
+ messageBuilder.append("====================================");
+
+ logger.error(messageBuilder.toString());
+ }
+
+ public static void globalRegionHeartBeat(){
+ if (!WatchdogConfig.enabled){
+ return;
+ }
+
+ synchronized (keepaliveDataLock){
+ globalRegionLastKeepalive = Pair.of(Thread.currentThread(),System.nanoTime());
+ }
+ }
+
+ public static void tickRegionHeartBeat(){
+ if (!WatchdogConfig.enabled){
+ return;
+ }
+
+ final ThreadedRegionizer.ThreadedRegion<?,?> currentRegion = TickRegionScheduler.getCurrentRegion();
+
+ if (currentRegion == null) {
+ return;
+ }
+
+ synchronized (keepaliveDataLock){
+ if (!otherTickRegionKeepalive.containsKey(Thread.currentThread())){
+ otherTickRegionKeepalive.put(Thread.currentThread(),Pair.of(currentRegion,System.nanoTime()));
+ return;
+ }
+
+ otherTickRegionKeepalive.replace(Thread.currentThread(),Pair.of(currentRegion,System.nanoTime()));
+ }
+ }
+
+ public static void onRegionDeath(ThreadedRegionizer.ThreadedRegion<?,?> currentRegion){
+ if (!WatchdogConfig.enabled){
+ return;
+ }
+
+ synchronized (keepaliveDataLock){
+ otherTickRegionKeepalive.remove(Thread.currentThread());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0d756dd5181a2444175184227bef648d07c17236..59b1da130e519cbe06ed5eedf9e4dc881e45ba36 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1222,6 +1222,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.statusIcon = (ServerStatus.Favicon) this.loadStatusIcon().orElse(null); // CraftBukkit - decompile error
this.status = this.buildServerStatus();
+ me.earthme.luminol.utils.LuminolWatchDog.boot(); //Luminol - Simple watchdog
+
// Folia start - region threading
if (true) {
io.papermc.paper.threadedregions.RegionizedServer.getInstance().init(); // Folia - region threading - only after loading worlds

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Wed, 7 Feb 2024 01:05:57 +0000
Date: Mon, 25 Mar 2024 13:16:04 +0000
Subject: [PATCH] Add config for incorrect tripwire updating fixing
@@ -31,15 +31,21 @@ index 0000000000000000000000000000000000000000..79ce93a1e97f176c7b0e5b00d7f0880f
+ }
+}
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
index 7f2dcf6a9e69779e6f898284b58fb1e32902000c..e1a7208b76e4dc7f388923d72edeceb6daefa774 100644
index 8bf94fcf5c46ffe6d90f8431338b768ef1a2dd61..25e069bd660720232737031fe1630765cce9a1b1 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -162,7 +162,7 @@ public class TripWireHookBlock extends Block {
boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED);
@@ -201,8 +201,13 @@ public class TripWireHookBlock extends Block {
BlockState iblockdata4 = aiblockdata[l];
flag5 |= flag6 && flag7;
- if (k != i || !tripWireBeingRemoved || !flag6) // Paper - fix tripwire state inconsistency; don't update the tripwire again if being removed and not disarmed
+ if (k != i || !tripWireBeingRemoved || !flag6 || me.earthme.luminol.config.modules.fixes.IncorrectTripwireFixConfig.enabled) // Paper - don't update the tripwire again if being removed and not disarmed //Luminol - Add config for incorrect tripwire updating fixing
aiblockdata[k] = iblockdata2;
if (k == i) {
world.scheduleTick(pos, block, 10);
if (iblockdata4 != null) {
- if (world.getBlockState(blockposition2).is(Blocks.TRIPWIRE)) { // Paper - Fix tripwire disarming not working as intended
+ if (me.earthme.luminol.config.modules.fixes.IncorrectTripwireFixConfig.enabled || world.getBlockState(blockposition2).is(Blocks.TRIPWIRE)) { // Paper - Fix tripwire disarming not working as intended //Luminol - Add config for this
world.setBlock(blockposition2, (BlockState) iblockdata4.trySetValue(TripWireHookBlock.ATTACHED, flag4), 3);
+ //Luminol start - Add config for incorrect tripwire updating
+ if (me.earthme.luminol.config.modules.fixes.IncorrectTripwireFixConfig.enabled){
+ world.getBlockState(blockposition2).isAir();
+ }
+ //Luminol end
}
}
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Io_uring channel type support
diff --git a/build.gradle.kts b/build.gradle.kts
index e837f1f9b444318cbee8719b9dd0eb669478742e..3a787b0afa3a34f23f1c18fb5250a5ff4bcd2f96 100644
index 66c34f883a93dd86fcac8029cce63ffe7340c89b..66cb23bce8bf0a96867144874643f771f7440034 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -35,6 +35,7 @@ dependencies {
@@ -18,17 +18,19 @@ index e837f1f9b444318cbee8719b9dd0eb669478742e..3a787b0afa3a34f23f1c18fb5250a5ff
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/IOUringSupportConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/IOUringSupportConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..313c3908ea406119da4f49db2e4fac6572727c80
index 0000000000000000000000000000000000000000..f3090b6e11d82d02528c7afd358ef4db61707092
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/IOUringSupportConfig.java
@@ -0,0 +1,20 @@
@@ -0,0 +1,22 @@
+package me.earthme.luminol.config.modules.misc;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.HotReloadUnsupported;
+import me.earthme.luminol.config.IConfigModule;
+
+public class IOUringSupportConfig implements IConfigModule {
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "enabled")
+ public static boolean enabled = false;
+

View File

@@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..73d99a105a18231901e691922b0c283a
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e6252c2cb76d96929c69c651b6570b586ee7e7e3..53c4ac14ce95f21ef87a148dddb349f18d6320b1 100644
index 9bbfac91f97331b1b558264c867b7e00185291f2..dfb1b8c3af93bfcddb976c003c6ac2d52afc41c6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
@@ -53,7 +53,7 @@ index e6252c2cb76d96929c69c651b6570b586ee7e7e3..53c4ac14ce95f21ef87a148dddb349f1
import net.minecraft.BlockUtil;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -1070,10 +1073,40 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -1086,10 +1089,40 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// Paper end - detailed watchdog information

View File

@@ -48,7 +48,7 @@ index 9cbf17436b4cf52aae374767aafe79ea4f60c3ce..f2068e7608ed765e35759eb981db6c95
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
this.chatVisibility = ChatVisiblity.FULL;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9555ae82d68cf217bc17e3bd9af2462702a2506b..51053d90f1bbad0b6453c13e06010cd7193ae7b7 100644
index 3b2508dc6cd4f70b09dce3b7e745e6efabaaa74e..b3ff8ed6d0f0414c15b9d2e6a51a0e34c361f92a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -675,7 +675,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -72,7 +72,7 @@ index 9555ae82d68cf217bc17e3bd9af2462702a2506b..51053d90f1bbad0b6453c13e06010cd7
// If the event is cancelled we move the player back to their old location.
if (event.isCancelled()) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 53c4ac14ce95f21ef87a148dddb349f18d6320b1..a0915438503e385153ec7bc7584860466f65b461 100644
index dfb1b8c3af93bfcddb976c003c6ac2d52afc41c6..09cdd28dcb2357ba3d7be316b7ca94dc93ac5dd0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -27,6 +27,7 @@ import java.util.stream.Stream;
@@ -99,7 +99,7 @@ index 53c4ac14ce95f21ef87a148dddb349f18d6320b1..a0915438503e385153ec7bc758486046
import org.bukkit.block.BlockFace;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.event.CraftPortalEvent;
@@ -3970,6 +3969,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3989,6 +3988,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
java.util.function.Consumer<Entity> teleportComplete) {
io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot teleport entity async");

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Kaiiju linear region format and settings
diff --git a/build.gradle.kts b/build.gradle.kts
index 3a787b0afa3a34f23f1c18fb5250a5ff4bcd2f96..18326989bfccea2c6d292b0020aab711438031c8 100644
index 66cb23bce8bf0a96867144874643f771f7440034..57fcd58883effe57051b72a4e9f4af91aacd421a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -20,6 +20,10 @@ dependencies {
@@ -573,10 +573,10 @@ index 9017907c0ec67a37a506f09b7e4499cef7885279..8b9ffcaab5d71660291d1c0454d2abd9
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..5219ef799585db502a19e79145b971365a736277
index 0000000000000000000000000000000000000000..5d594b606178bd26180caad49de17c0e67e89747
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java
@@ -0,0 +1,50 @@
@@ -0,0 +1,58 @@
+package me.earthme.luminol.config.modules.misc;
+
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
@@ -587,12 +587,16 @@ index 0000000000000000000000000000000000000000..5219ef799585db502a19e79145b97136
+ @DoNotLoad
+ public static RegionFileFormat regionFormatName = RegionFileFormat.ANVIL;
+
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "formatName")
+ private static String formatName = "ANVIL";
+ @ConfigInfo(baseName = "linear_compression_level")
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "linear_compression_level",comments = "WARNING: DO NOT USE TOO HIGH COMPRESSION LEVEL(Recommended is 1 which is default value if you are using linear) BECAUSE THAT WOULD MAKE YOUR DATA IN DANGER!")
+ public static int regionFormatLinearCompressionLevel = 1;
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "linear_flusher_thread_count")
+ public static int linearFlushThreads = 1;
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "linear_flush_frequency")
+ public static int linearFlushFrequency = 10;
+
@@ -608,6 +612,10 @@ index 0000000000000000000000000000000000000000..5219ef799585db502a19e79145b97136
+
+ @Override
+ public void onLoaded(CommentedFileConfig configInstance){
+ if (LuminolConfig.alreadyInited){
+ return;
+ }
+
+ regionFormatName = RegionFileFormat.fromString(formatName);
+ if (regionFormatName.equals(RegionFileFormat.INVALID)) {
+ LuminolConfig.logger.error("Unknown region format in luminol global config: {}", formatName);
@@ -628,7 +636,7 @@ index 0000000000000000000000000000000000000000..5219ef799585db502a19e79145b97136
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4468e6fdbbe527111f4410188f2f2df7f592f81e..13ad20b3d43cc22ad1046220b24272dd274de997 100644
index 59b1da130e519cbe06ed5eedf9e4dc881e45ba36..c924951c3dd7652ee446b40689ff9004546e972a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -923,7 +923,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -650,7 +658,7 @@ index 4468e6fdbbe527111f4410188f2f2df7f592f81e..13ad20b3d43cc22ad1046220b24272dd
return flag3;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 21ec49acb3c1241d9286959c42a7f8363f637e4f..c212030a24174115a975604b91d03cf8ad4043de 100644
index 6ab9f83786dcfbd3156d2f2bd6da57baed1399f4..76ad4d8bce1611ead6f1596b2ba78267e3718655 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -211,7 +211,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -697,7 +705,7 @@ index 21ec49acb3c1241d9286959c42a7f8363f637e4f..c212030a24174115a975604b91d03cf8
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 682ca5ec0aee427463d1a9f97292c6ea65ca2da0..c06ddc99a0971be46746c767ad8ce590a8e2ee30 100644
index 10df17ad79092f3e226df08e58620694b3581758..da6269249a95d78f91e90416a96bf1b776fd9c97 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -446,8 +446,8 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Wed, 7 Feb 2024 07:18:27 +0000
Subject: [PATCH] Piston fixes from molean server
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a0915438503e385153ec7bc7584860466f65b461..13b1bf1d3dea42d0d0d45ebd2c9ccbf6928c395b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1447,7 +1447,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (movement.lengthSqr() <= 1.0E-7D) {
return movement;
} else {
- long i = this.level().getGameTime();
+ long i = this.level().getRedstoneGameTime(); //Luminol - Piston fixes from molean server
if (i != this.pistonDeltasGameTime) {
Arrays.fill(this.pistonDeltas, 0.0D);
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index be74adc86f0ca467f3b59e7b57fd47a8f381d86e..3482ed0449478b258d85751ffc90ce677acbc60f 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -152,7 +152,7 @@ public class PistonBaseBlock extends DirectionalBlock {
if (tileentity instanceof PistonMovingBlockEntity) {
PistonMovingBlockEntity tileentitypiston = (PistonMovingBlockEntity) tileentity;
- if (tileentitypiston.isExtending() && (tileentitypiston.getProgress(0.0F) < 0.5F || world.getGameTime() == tileentitypiston.getLastTicked() || ((ServerLevel) world).isHandlingTick())) {
+ if (tileentitypiston.isExtending() && (tileentitypiston.getProgress(0.0F) < 0.5F || world.getRedstoneGameTime() == tileentitypiston.getLastTicked() || ((ServerLevel) world).isHandlingTick())) { //Luminol - Piston fixes from molean server
b0 = 2;
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
index 1c23597f172f46eec714b510acfedb415bb01bff..3262398db1b053115b83ed6aab15f9fef511d5d3 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -277,7 +277,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
}
public static void tick(Level world, BlockPos pos, BlockState state, PistonMovingBlockEntity blockEntity) {
- blockEntity.lastTicked = world.getGameTime();
+ blockEntity.lastTicked = world.getRedstoneGameTime(); //Luminol - Piston fixes from molean server
blockEntity.progressO = blockEntity.progress;
if (blockEntity.progressO >= 1.0F) {
if (world.isClientSide && blockEntity.deathTicks < 5) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Kaiiju Vanilla end portal teleportation
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 13b1bf1d3dea42d0d0d45ebd2c9ccbf6928c395b..24c05e40c9eeeb4a181d2f9994b0e786393046b9 100644
index 09cdd28dcb2357ba3d7be316b7ca94dc93ac5dd0..d955a555d260d39812b84eb5319db619ec0f8d28 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4176,12 +4176,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4195,12 +4195,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH,
(chunks) -> {
@@ -28,7 +28,7 @@ index 13b1bf1d3dea42d0d0d45ebd2c9ccbf6928c395b..24c05e40c9eeeb4a181d2f9994b0e786
);
}
);
@@ -4368,6 +4373,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4387,6 +4392,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (!this.canPortalAsync(takePassengers)) {
return false;
}
@@ -39,7 +39,7 @@ index 13b1bf1d3dea42d0d0d45ebd2c9ccbf6928c395b..24c05e40c9eeeb4a181d2f9994b0e786
Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos(
@@ -4426,7 +4435,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4445,7 +4454,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// place
passengerTree.root.placeInAsync(
originWorld, destination, Entity.TELEPORT_FLAG_LOAD_CHUNK | (takePassengers ? Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS : 0L),

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Wed, 7 Feb 2024 07:33:03 +0000
Date: Mon, 25 Mar 2024 13:47:32 +0000
Subject: [PATCH] Kaiiju Async path processing
@@ -515,10 +515,10 @@ index 0000000000000000000000000000000000000000..a5472bb9d453bbeee92738c8d1a57ef4
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index a3992e21e7d4112b9903e8d16a5e898d448eaea8..dc94c66404e9f2015119e249a560571355c92c96 100644
index 54297b9dde40fe853d873d60373cd8c0a3c9466b..67210fc018349ab0a79740dee140fb60c82c431a 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -296,6 +296,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -297,6 +297,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@Nullable
@Override
public LivingEntity getTarget() {
@@ -1191,7 +1191,7 @@ index 3049edb5a8b5967e5242a3896b23665888eb3472..0da9acd785cf785d82be7aab0a1e2bfd
return false;
} else if (o.nodes.size() != this.nodes.size()) {
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
index eb18494bd7257fa5eb00dea16cf4d5667b796f2b..3cbc29fa169350879254a90e198e6247b6ab3037 100644
index 8aa4ac3a6affbe888d6084a27b668c58dfda6c79..d8f443af840b1a4b1d2868fefd87d70dad55a764 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -24,37 +24,80 @@ public class PathFinder {
@@ -1293,11 +1293,11 @@ index eb18494bd7257fa5eb00dea16cf4d5667b796f2b..3cbc29fa169350879254a90e198e6247
for(int l = 0; l < k; ++l) {
Node node2 = this.neighbors[l];
@@ -123,6 +166,7 @@ public class PathFinder {
@@ -123,7 +166,6 @@ public class PathFinder {
if (best == null || comparator.compare(path, best) < 0)
best = path;
}
+ //noinspection ConstantConditions // Kaiiju - petal - ignore this warning, we know that the above loop always runs at least once since positions is not empty
- profiler.pop();
return best;
// Paper end - Perf: remove streams and optimize collection
}

View File

@@ -33,10 +33,10 @@ index 0000000000000000000000000000000000000000..dd45cf1fde5ee4cf8347064f106c64b8
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index dc94c66404e9f2015119e249a560571355c92c96..9636f69fab9f34f3b3f4590f151248cd5b2da089 100644
index 67210fc018349ab0a79740dee140fb60c82c431a..b90865dbfb3a4bd83e4cd3ba3b5b965036039f98 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -926,10 +926,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -927,10 +927,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
return;
}
// Paper end - Allow nerfed mobs to jump and float

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Pufferfish Optimize entity coordinate key
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index 878306271d4af280c7a086d1839c446a01da1ad6..cb22cac2b8c4eaf705b76fd4a9d8b82fb8eb0140 100644
index 08d282400644be5949f28eb879b333cc221da2cc..49ccb27a17bec1d4ff31bc8d72e4724d65adc20c 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -212,7 +212,7 @@ public final class MCUtil {
@@ -215,7 +215,7 @@ public final class MCUtil {
}
public static long getCoordinateKey(final Entity entity) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Pufferfish Cache climbing check for activation
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 24c05e40c9eeeb4a181d2f9994b0e786393046b9..a899f33c8c6033ad99d8187f29d6e9ebd99ded09 100644
index d955a555d260d39812b84eb5319db619ec0f8d28..7834646fd6a894ff85973566d9aeda98e5b0c284 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -310,7 +310,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -311,7 +311,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public double yo;
public double zo;
private Vec3 position;
@@ -18,10 +18,10 @@ index 24c05e40c9eeeb4a181d2f9994b0e786393046b9..a899f33c8c6033ad99d8187f29d6e9eb
private Vec3 deltaMovement;
private float yRot;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b640d877f924094bcabbf9618bbd9aa0a70bf94a..d38918b973f76e4b3eec5e16ea4f2473e92ae858 100644
index fdb5ef574c14fafa1af50f4f656763119695f00e..bbfbeddcba884ae1964f7421fcdf179923bd0d2b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
@@ -29,7 +29,7 @@ index b640d877f924094bcabbf9618bbd9aa0a70bf94a..d38918b973f76e4b3eec5e16ea4f2473
public abstract class LivingEntity extends Entity implements Attackable {
@@ -2027,6 +2026,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2043,6 +2042,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.lastClimbablePos;
}

View File

@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..3e48cd297b4869e5c89b6abc43c726d3
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d38918b973f76e4b3eec5e16ea4f2473e92ae858..3731013a4369dac2130045bdc2bbde170075a3df 100644
index bbfbeddcba884ae1964f7421fcdf179923bd0d2b..df789b13f57200c66ff4cc59e6b63949a6804e3d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -419,7 +419,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -428,7 +428,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
if (!this.level().isClientSide) {
@@ -43,7 +43,7 @@ index d38918b973f76e4b3eec5e16ea4f2473e92ae858..3731013a4369dac2130045bdc2bbde17
this.hurt(this.damageSources().inWall(), 1.0F);
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
@@ -1420,6 +1420,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1436,6 +1436,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.getHealth() <= 0.0F;
}
@@ -64,10 +64,10 @@ index d38918b973f76e4b3eec5e16ea4f2473e92ae858..3731013a4369dac2130045bdc2bbde17
public boolean hurt(DamageSource source, float amount) {
if (this.isInvulnerableTo(source)) {
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index ac9eaeaf7df1e84ee588f371628c0a10784d50bc..ea8883b0661e894a466eca24bfc247ac37f40a81 100644
index 12440ee2dccc0a697fb403765f2e1b987ccc0283..de2471cfa96a23944f229f33ffdff88b6b7756e4 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -150,6 +150,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@@ -151,6 +151,13 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
this.bossEvent.setName(this.getDisplayName());
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Pufferfish Reduce entity fluid lookups if no fluids
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a899f33c8c6033ad99d8187f29d6e9ebd99ded09..0b201fd79233ed0a5c2d298b283a15497dffd8e5 100644
index 7834646fd6a894ff85973566d9aeda98e5b0c284..21284dba89c8adbb46086afd9a900fb24ba3e3ea 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -5243,16 +5243,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -5262,16 +5262,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
@@ -34,7 +34,7 @@ index a899f33c8c6033ad99d8187f29d6e9ebd99ded09..0b201fd79233ed0a5c2d298b283a1549
double d1 = 0.0D;
boolean flag = this.isPushedByFluid();
boolean flag1 = false;
@@ -5260,14 +5262,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -5279,14 +5281,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -102,7 +102,7 @@ index a899f33c8c6033ad99d8187f29d6e9ebd99ded09..0b201fd79233ed0a5c2d298b283a1549
if (d2 >= axisalignedbb.minY) {
flag1 = true;
@@ -5289,9 +5338,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -5308,9 +5357,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit end
}
}

View File

@@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..15697d69659b6e1e776acf5094684b5f
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0b201fd79233ed0a5c2d298b283a15497dffd8e5..f120f977e3535847a1e3a009a25eb0137fce6ab0 100644
index 21284dba89c8adbb46086afd9a900fb24ba3e3ea..f8a410e9ed04d9a78d1a6a7e63673b1863d715f2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -798,6 +798,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -814,6 +814,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void tick() {

View File

@@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..af5893ba1f738ec9827d7b714682c314
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c06ddc99a0971be46746c767ad8ce590a8e2ee30..f3f095e6acbe50154503524b160255394f4d9ec6 100644
index da6269249a95d78f91e90416a96bf1b776fd9c97..25a2f23618cd02366f71e704638adfbaed9fa8c5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -987,6 +987,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -83,10 +83,10 @@ index c06ddc99a0971be46746c767ad8ce590a8e2ee30..f3f095e6acbe50154503524b16025539
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f120f977e3535847a1e3a009a25eb0137fce6ab0..d62734c0365af706c136274faf3e135f6ea099ee 100644
index f8a410e9ed04d9a78d1a6a7e63673b1863d715f2..4b3acc0de20b246e20e2cc91ba0eca493a675729 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -482,6 +482,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -483,6 +483,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Folia - region ticking
// Paper end - optimise entity tracking
@@ -111,10 +111,10 @@ index 8deae3e95a26f4b42b2c2134e22f9649bd7a5391..c09357c1ef84a29d972119cb496b0ae9
private String descriptionId;
@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 9636f69fab9f34f3b3f4590f151248cd5b2da089..50a144b0122c970856ef3faa3f899ee72e2a6300 100644
index b90865dbfb3a4bd83e4cd3ba3b5b965036039f98..66c581585e6ca58eba0e8b7af0fa1f0c9f924f94 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -233,10 +233,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -234,10 +234,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
@Override
public void inactiveTick() {
super.inactiveTick();
@@ -127,7 +127,7 @@ index 9636f69fab9f34f3b3f4590f151248cd5b2da089..50a144b0122c970856ef3faa3f899ee7
this.targetSelector.tick();
}
}
@@ -934,16 +934,20 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -935,16 +935,20 @@ public abstract class Mob extends LivingEntity implements Targeting {
if (i % 2 != 0 && this.tickCount > 1) {
this.level().getProfiler().push("targetSelector");
@@ -216,10 +216,10 @@ index 580da502c62ec5d669cb09932d99d1c7d711c965..b94d775e366f5cb251e9199ff5022ad5
this.level().getProfiler().pop();
this.level().getProfiler().push("frogActivityUpdate");
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 4aeab90e778629c355189dfe79c39c4b21f5f5ac..6ed4ac06c76b8d0d6e8db778cade15dbd1e3e5f5 100644
index 958816ce2166248b542c96c10c398a52d769b4db..415afe3473d9f8a50b1edab8cfda6158e59836e6 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -77,9 +77,11 @@ public class Tadpole extends AbstractFish {
@@ -80,9 +80,11 @@ public class Tadpole extends AbstractFish {
return SoundEvents.TADPOLE_FLOP;
}
@@ -298,10 +298,10 @@ index 7aadd36f0fe986635b495ab8c1426644620400cf..0c947d7509d66647327bce885ad2c605
this.level().getProfiler().pop();
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 853c777bad19656cd48e9de9015c12e2c078d940..fba0f3725ff3001decdb9efeeab50dd7ce3e4ddc 100644
index 3eeff0cd8563939c656b5ded8470cab016903f25..90d8cd94d987416a3e9f6e6d47a5b366d4687fe0 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -142,6 +142,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -143,6 +143,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
return holder.is(PoiTypes.MEETING);
});
@@ -310,7 +310,7 @@ index 853c777bad19656cd48e9de9015c12e2c078d940..fba0f3725ff3001decdb9efeeab50dd7
public Villager(EntityType<? extends Villager> entityType, Level world) {
this(entityType, world, VillagerType.PLAINS);
}
@@ -245,6 +247,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -246,6 +248,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
// Spigot End
@@ -318,7 +318,7 @@ index 853c777bad19656cd48e9de9015c12e2c078d940..fba0f3725ff3001decdb9efeeab50dd7
@Override
@Deprecated // Paper
protected void customServerAiStep() {
@@ -254,7 +257,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -255,7 +258,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
protected void customServerAiStep(final boolean inactive) {
// Paper end
this.level().getProfiler().push("villagerBrain");

View File

@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..acc032f727e605e79b688efb4873ff47
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 50a144b0122c970856ef3faa3f899ee72e2a6300..7378c9cb5eeddc7cefc409638179dfb8602ed0d0 100644
index 66c581585e6ca58eba0e8b7af0fa1f0c9f924f94..97e099eea537aea8f8ffd031063949c363820701 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -229,11 +229,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -230,11 +230,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
return this.lookControl;
}

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sat, 27 Jan 2024 11:55:08 +0000
Date: Mon, 25 Mar 2024 13:48:33 +0000
Subject: [PATCH] Pufferfish Improve container checking with a bitset
@@ -237,10 +237,10 @@ index d6cbe98e67fdbf8db46338a88ab1356dd63b50a3..20dd3a63b2f955b05a75eb240e33ae4c
int LARGE_MAX_STACK_SIZE = 64;
int DEFAULT_DISTANCE_LIMIT = 8;
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..e7115f1635821e0aab32e8aeea6914388dc24639 100644
index 756d0434472921992c9d84597d7c9c824e93614c..38c573d440946ca7ee6016ef92e9c1605031e611 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
@@ -27,7 +27,10 @@ import org.bukkit.inventory.InventoryHolder;
@@ -28,7 +28,10 @@ import org.bukkit.inventory.InventoryHolder;
public abstract class AbstractMinecartContainer extends AbstractMinecart implements ContainerEntity {
@@ -251,7 +251,7 @@ index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..e7115f1635821e0aab32e8aeea691438
@Nullable
public ResourceLocation lootTable;
public long lootTableSeed;
@@ -89,12 +92,18 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
@@ -90,12 +93,18 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
protected AbstractMinecartContainer(EntityType<?> type, Level world) {
super(type, world);
@@ -272,7 +272,7 @@ index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..e7115f1635821e0aab32e8aeea691438
}
@Override
@@ -156,6 +165,10 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
@@ -164,6 +173,10 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
protected void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt);
this.lootableData.loadNbt(nbt); // Paper
@@ -362,10 +362,10 @@ index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..3514022d898a24052c917ebf55dcef3e
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962fcb55634 100644
index 82e7e76fecceb55522b5828a56f036e42ef55201..882e27de852c89c837d7943c5a9ae6fb3c2e896b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -47,7 +47,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -48,7 +48,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public static final int MOVE_ITEM_SPEED = 8;
public static final int HOPPER_CONTAINER_SIZE = 5;
@@ -373,10 +373,10 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
private NonNullList<ItemStack> items;
+ private gg.airplane.structs.ItemListWithBitset optimizedItems; // Pufferfish
+ // Pufferfish end
private int cooldownTime;
private long tickedGameTime;
public int cooldownTime;
private long tickedGameTime = Long.MIN_VALUE; // Folia - region threading
@@ -83,14 +86,37 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -94,14 +97,37 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public HopperBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.HOPPER, pos, state);
@@ -416,7 +416,7 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
if (!this.tryLoadLootTable(nbt)) {
ContainerHelper.loadAllItems(nbt, this.items);
}
@@ -493,6 +519,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -504,6 +530,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
}
private static boolean isFullContainer(Container inventory, Direction direction) {
@@ -424,7 +424,7 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
// Paper start - Perf: Optimize Hoppers
if (inventory instanceof WorldlyContainer worldlyContainer) {
for (final int slot : worldlyContainer.getSlotsForFace(direction)) {
@@ -515,7 +542,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -526,7 +553,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
}
private static boolean isEmptyContainer(Container inv, Direction facing) {
@@ -437,7 +437,7 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
}
public static boolean suckInItems(Level world, Hopper hopper) {
@@ -716,7 +747,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -727,7 +758,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (HopperBlockEntity.canPlaceItemInContainer(to, stack, slot, side)) {
boolean flag = false;
@@ -446,7 +446,7 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
if (itemstack1.isEmpty()) {
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
@@ -911,7 +942,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -922,7 +953,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@Override
protected void setItems(NonNullList<ItemStack> list) {
@@ -459,7 +459,7 @@ index 26ff1a3d07c92f7035020d08d35116f7feede600..009263f6aab41608d7e17bebbed6f962
public static void entityInside(Level world, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
index a94300a457b25f0e33a8eeabba6dd5720ca9ab1e..b41635dd0569ff7df909df492d3e850aef7214be 100644
index f52ccd4f3e062af3c7cc6eaea5b074a3bbd21690..a5cd70b6ada2b44f64db0985483ee5eadc67003f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
@@ -94,12 +94,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc

View File

@@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..ed62d25d6cd6dfcf8c5db20ced36eb3d
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d62734c0365af706c136274faf3e135f6ea099ee..bc655e3db34630a419be883b0dcc1ba4d5bbeb90 100644
index 4b3acc0de20b246e20e2cc91ba0eca493a675729..2d78d28120af075bebee4d97428ed48cf27c9d78 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -5441,6 +5441,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -5460,6 +5460,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.feetBlockState;
}
@@ -52,10 +52,10 @@ index d62734c0365af706c136274faf3e135f6ea099ee..bc655e3db34630a419be883b0dcc1ba4
return this.chunkPosition;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 3731013a4369dac2130045bdc2bbde170075a3df..39f054b9352376336b543c1ca4e9be9a6dee79b3 100644
index df789b13f57200c66ff4cc59e6b63949a6804e3d..c2d155882c94f875c96c13746ff0c5433ab25ed0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2046,19 +2046,43 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2062,19 +2062,43 @@ public abstract class LivingEntity extends Entity implements Attackable {
public boolean onClimableCached() {
if (!this.blockPosition().equals(this.lastClimbingPosition)) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Gale Optimize sun burn tick
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index bc655e3db34630a419be883b0dcc1ba4d5bbeb90..bf530eb5e039f37b9bea37d2a61ee31fdab8c8a9 100644
index 2d78d28120af075bebee4d97428ed48cf27c9d78..a4682b8bd269f52af26a03347e8d3869d2b1ba41 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -309,7 +309,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -310,7 +310,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public double xo;
public double yo;
public double zo;
@@ -17,7 +17,7 @@ index bc655e3db34630a419be883b0dcc1ba4d5bbeb90..bf530eb5e039f37b9bea37d2a61ee31f
public BlockPos blockPosition; // Pufferfish - private->public
private ChunkPos chunkPosition;
private Vec3 deltaMovement;
@@ -2052,9 +2052,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2068,9 +2068,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
/** @deprecated */
@Deprecated
public float getLightLevelDependentMagicValue() {
@@ -37,10 +37,10 @@ index bc655e3db34630a419be883b0dcc1ba4d5bbeb90..bf530eb5e039f37b9bea37d2a61ee31f
this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0F);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 7378c9cb5eeddc7cefc409638179dfb8602ed0d0..d83a6adc34c64652f1070651f5c96579a5c45e67 100644
index 97e099eea537aea8f8ffd031063949c363820701..71b1f576aff8dcf51dd888280b5b7a25a387d197 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1749,13 +1749,29 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1750,13 +1750,29 @@ public abstract class Mob extends LivingEntity implements Targeting {
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Gale Check frozen ticks before landing block
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 39f054b9352376336b543c1ca4e9be9a6dee79b3..7ae3d5a9e44092501271b36e593fe6d7270c472b 100644
index c2d155882c94f875c96c13746ff0c5433ab25ed0..84b47e6cea7ed9730f9c450ba8ba3167d71b2cc9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -588,11 +588,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -597,11 +597,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void tryAddFrost() {
@@ -21,7 +21,7 @@ index 39f054b9352376336b543c1ca4e9be9a6dee79b3..7ae3d5a9e44092501271b36e593fe6d7
if (attributemodifiable == null) {
return;
@@ -602,7 +601,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -611,7 +610,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION));
}

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Gale Don't trigger lootable refresh for non-player
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
index b41635dd0569ff7df909df492d3e850aef7214be..7ff40b74827a52eb5daaff72e1563b044d41c6c1 100644
index a5cd70b6ada2b44f64db0985483ee5eadc67003f..e49be65c2d379027c2821c0db7f151bc3cd20a4b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
@@ -68,6 +68,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc

View File

@@ -99,10 +99,10 @@ public class Main {
```
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index cb22cac2b8c4eaf705b76fd4a9d8b82fb8eb0140..f24132f5ab6362829e88559304173bd9a259caa3 100644
index 49ccb27a17bec1d4ff31bc8d72e4724d65adc20c..34ccd489268c51c0aeecf5918878122b49c8d123 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -165,13 +165,11 @@ public final class MCUtil {
@@ -168,13 +168,11 @@ public final class MCUtil {
}
public static int fastFloor(double x) {
@@ -118,7 +118,7 @@ index cb22cac2b8c4eaf705b76fd4a9d8b82fb8eb0140..f24132f5ab6362829e88559304173bd9
}
public static float normalizeYaw(float f) {
@@ -232,11 +230,11 @@ public final class MCUtil {
@@ -235,11 +233,11 @@ public final class MCUtil {
}
public static int getChunkCoordinate(final double coordinate) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Gale Skip entity move if movement is zero
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index bf530eb5e039f37b9bea37d2a61ee31fdab8c8a9..d175f13ada111bcee977957c6fd9580e032183e9 100644
index a4682b8bd269f52af26a03347e8d3869d2b1ba41..d78ad18ac3b69c893a23b6bb9a6837b6a82ebdc2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -318,6 +318,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -319,6 +319,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public float yRotO;
public float xRotO;
private AABB bb;
@@ -16,7 +16,7 @@ index bf530eb5e039f37b9bea37d2a61ee31fdab8c8a9..d175f13ada111bcee977957c6fd9580e
public boolean onGround;
public boolean horizontalCollision;
public boolean verticalCollision;
@@ -1088,6 +1089,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -1104,6 +1105,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
//Luminol end
public void move(MoverType movementType, Vec3 movement) {
@@ -28,7 +28,7 @@ index bf530eb5e039f37b9bea37d2a61ee31fdab8c8a9..d175f13ada111bcee977957c6fd9580e
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -4938,6 +4944,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4957,6 +4963,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public final void setBoundingBox(AABB boundingBox) {

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sat, 6 Apr 2024 05:14:57 +0000
Subject: [PATCH] Gale Reduce lambda and Optional allocation in
EntityBasedExplosionDamageCalculator
diff --git a/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java b/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
index 2f9f15d99f8b31e9f13f7f32378b2a9e09bcb5e5..4e4dfb72d5a0b46917999b709c655ccfdae27183 100644
--- a/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
+++ b/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
@@ -15,9 +15,17 @@ public class EntityBasedExplosionDamageCalculator extends ExplosionDamageCalcula
@Override
public Optional<Float> getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState) {
- return super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState).map((max) -> {
- return this.source.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState, max);
- });
+ // Gale start - Lithium - reduce lambda and Optional allocation in EntityBasedExplosionDamageCalculator
+ Optional<Float> optionalBlastResistance = super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState);
+ if (optionalBlastResistance.isPresent()) {
+ float blastResistance = optionalBlastResistance.get();
+ float effectiveExplosionResistance = this.source.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState, blastResistance);
+ if (effectiveExplosionResistance != blastResistance) {
+ return Optional.of(effectiveExplosionResistance);
+ }
+ }
+ return optionalBlastResistance;
+ // Gale end - Lithium - reduce lambda and Optional allocation in EntityBasedExplosionDamageCalculator
}
@Override

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sat, 6 Apr 2024 05:17:19 +0000
Subject: [PATCH] Gale Replace AI goal set with optimized collection
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 0f53c206b4c0607e2cda5cfa4edeae5209e897bf..6313020a80cab0b8df8d775431d4aa063c51ce18 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -13,6 +13,7 @@ import java.util.function.Supplier;
import java.util.stream.Stream;
import net.minecraft.util.profiling.ProfilerFiller;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
public class GoalSelector {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -28,7 +29,7 @@ public class GoalSelector {
}
};
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
- private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
+ private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>(); // Gale - Lithium - replace AI goal set with optimized collection
private final Supplier<ProfilerFiller> profiler;
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector

View File

@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sat, 6 Apr 2024 05:17:42 +0000
Subject: [PATCH] Gale Replace AI attributes with optimized collections
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 683c9693754d1a87b7e8fccc757a0d0963351f60..d904cc2d882f62f74ff34f7e8266947798563ed4 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -1,8 +1,6 @@
package net.minecraft.world.entity.ai.attributes;
-import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
import com.mojang.logging.LogUtils;
import java.util.Collection;
import java.util.Map;
@@ -10,6 +8,9 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
+
+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
import net.minecraft.Util;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
@@ -20,8 +21,10 @@ import org.slf4j.Logger;
public class AttributeMap {
private static final Logger LOGGER = LogUtils.getLogger();
- private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
- private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
+ // Gale start - Lithium - replace AI attributes with optimized collections
+ private final Map<Attribute, AttributeInstance> attributes = new Reference2ReferenceOpenHashMap<>(0);
+ private final Set<AttributeInstance> dirtyAttributes = new ReferenceOpenHashSet<>(0);
+ // Gale end - Lithium - replace AI attributes with optimized collections
private final AttributeSupplier supplier;
private final java.util.function.Function<Attribute, AttributeInstance> createInstance; // Pufferfish

View File

@@ -0,0 +1,61 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Sat, 6 Apr 2024 05:18:00 +0000
Subject: [PATCH] Gale Replace throttle tracker map with optimized collection
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ade8be1b05 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -1,5 +1,7 @@
package net.minecraft.server.network;
+import it.unimi.dsi.fastutil.objects.Object2LongMap;
+import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
import net.minecraft.SharedConstants;
import net.minecraft.network.Connection;
import net.minecraft.network.chat.Component;
@@ -13,7 +15,8 @@ import net.minecraft.server.MinecraftServer;
// CraftBukkit start
import java.net.InetAddress;
-import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
// CraftBukkit end
public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketListener {
@@ -24,7 +27,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
static final java.util.regex.Pattern PROP_PATTERN = java.util.regex.Pattern.compile("\\w{0,16}");
// Spigot end
// CraftBukkit start - add fields
- private static final HashMap<InetAddress, Long> throttleTracker = new HashMap<InetAddress, Long>();
+ private static final Object2LongOpenHashMap<InetAddress> throttleTracker = new Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
private static int throttleCounter = 0;
// CraftBukkit end
private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request");
@@ -51,7 +54,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
- if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
+ if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.getLong(address) < connectionThrottle) { // Gale - Dionysus - replace throttle tracker map with optimized collection
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
@@ -65,13 +68,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
ServerHandshakePacketListenerImpl.throttleCounter = 0;
// Cleanup stale entries
- java.util.Iterator iter = ServerHandshakePacketListenerImpl.throttleTracker.entrySet().iterator();
- while (iter.hasNext()) {
- java.util.Map.Entry<InetAddress, Long> entry = (java.util.Map.Entry) iter.next();
- if (entry.getValue() > connectionThrottle) {
- iter.remove();
- }
- }
+ throttleTracker.object2LongEntrySet().removeIf(entry -> entry.getLongValue() > connectionThrottle); // Gale - Dionysus - replace throttle tracker map with optimized collection
}
}
} // Paper - Unix domain socket support

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Sparkly Paper Optimize canSee checks
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c212030a24174115a975604b91d03cf8ad4043de..2fc86eb396ed600154840dd6cd43b9294a34595c 100644
index 76ad4d8bce1611ead6f1596b2ba78267e3718655..d1dc02b3e4f775c9bd79073a8e96243aa5ab6c24 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1408,7 +1408,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -18,7 +18,7 @@ index c212030a24174115a975604b91d03cf8ad4043de..2fc86eb396ed600154840dd6cd43b929
}
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 830616f7a3d1c3e25133229a74e08cbb9d412179..80e0bb615ee8283b5618566c8011f06b1c84a0a8 100644
index 26f70965b45fa3c344781b569a651a4668d0621d..49f207b7e06a3f939dc6c9b4a078f6db7b779618 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -187,7 +187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Protocol Core
diff --git a/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java b/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
index fc3d332aa1c1d469cedfe2aaa7102dcd78e25642..bebaa4e7abcbd01dc57fddf2a473b846e887cc7f 100644
index 1ae61bc6603dd3ac290e3ead20416f9c5b63ff02..168ed2c21aed6a10f3aca259880b1b8bdbf98b78 100644
--- a/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
+++ b/src/main/java/io/papermc/paper/threadedregions/RegionizedServer.java
@@ -313,6 +313,8 @@ public final class RegionizedServer {
@@ -314,6 +314,8 @@ public final class RegionizedServer {
// player list
MinecraftServer.getServer().getPlayerList().tick();
@@ -56,10 +56,10 @@ index c68910b2a2eb703406fb406a86783cf6ab48651e..f935214ed80fe54038a96a5cd668a072
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d13edeff0de64cb77d7668e5b964cabcf9729388..c8c72cefba44ce8587a9ae22f5a87d3199f8ca5f 100644
index 90be312057221a5a78066d89783c5e22008d797d..0f172512085e9dfc0850451d2c6bbffb18221f8f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -433,6 +433,8 @@ public abstract class PlayerList {
@@ -441,6 +441,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
}
@@ -68,7 +68,7 @@ index d13edeff0de64cb77d7668e5b964cabcf9729388..c8c72cefba44ce8587a9ae22f5a87d31
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
@@ -688,6 +690,7 @@ public abstract class PlayerList {
@@ -696,6 +698,7 @@ public abstract class PlayerList {
return this.remove(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())));
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
@@ -77,7 +77,7 @@ index d13edeff0de64cb77d7668e5b964cabcf9729388..c8c72cefba44ce8587a9ae22f5a87d31
ServerLevel worldserver = entityplayer.serverLevel();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b9b1bcd165fb8864dda924a29d128d810b2ee7ab..e5e0f469b0fe98c18d87f3fc4fdecf6f26e33149 100644
index c70eb23d9745bdbfcc340bb554cf0bf2db71f5de..dc223b536eadd2da6cf3c758a62d0ed81b5a7b3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -471,6 +471,7 @@ public final class CraftServer implements Server {
@@ -120,10 +120,10 @@ index 0000000000000000000000000000000000000000..64a1d25973b032e8cab64bbffa6824a1
+}
diff --git a/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..055f044ce6cef4377f6f577efdbfad0ec9a2d57b
index 0000000000000000000000000000000000000000..8b7813c442733f5d4d3b2a072902099cbe596b37
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
@@ -0,0 +1,340 @@
@@ -0,0 +1,344 @@
+package top.leavesmc.leaves.protocol.core;
+
+import net.minecraft.network.FriendlyByteBuf;
@@ -167,7 +167,11 @@ index 0000000000000000000000000000000000000000..055f044ce6cef4377f6f577efdbfad0e
+ private static final Map<LeavesProtocol, Map<ProtocolHandler.MinecraftRegister, Method>> MINECRAFT_REGISTER = new HashMap<>();
+
+ public static void init() {
+ for (Class<?> clazz : getClasses("top.leavesmc.leaves.protocol")) {
+ //Luminol start - For the protocol supports of luminol
+ final Set<Class<?>> allClazz = getClasses("org.leavesmc.leaves.protocol");
+ allClazz.addAll(getClasses("me.earthme.luminol.protocols"));
+ //Luminol end
+ for (Class<?> clazz : allClazz) {
+ final LeavesProtocol protocol = clazz.getAnnotation(LeavesProtocol.class);
+ if (protocol != null) {
+ Set<Method> methods;

View File

@@ -6,21 +6,25 @@ Subject: [PATCH] Leaves Bladeren Protocol
diff --git a/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesBladerenProtocolConfig.java b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesBladerenProtocolConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..b882549a3c3bc8c192014fd6e1ac7b4f0feddafc
index 0000000000000000000000000000000000000000..4950d33288d6bc3c4ce90ae12bbf4797e3989500
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesBladerenProtocolConfig.java
@@ -0,0 +1,24 @@
@@ -0,0 +1,28 @@
+package me.earthme.luminol.config.modules.gameplay;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.HotReloadUnsupported;
+import me.earthme.luminol.config.IConfigModule;
+
+public class LeavesBladerenProtocolConfig implements IConfigModule {
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "enable_base_protocol")
+ public static boolean enableBaseProtocol = false;
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "enable_mspt_sync_protocol")
+ public static boolean msptSyncProtocol = false;
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "mspt_sync_interval")
+ public static int msptSyncTickInterval = 20;
+

View File

@@ -21,10 +21,10 @@ index 64a1d25973b032e8cab64bbffa6824a131676773..57a563b3f2d01719d490578907411d25
}
diff --git a/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
index 055f044ce6cef4377f6f577efdbfad0ec9a2d57b..18fc0e2c890020bf587f5b1d2e097126d3e19999 100644
index 8b7813c442733f5d4d3b2a072902099cbe596b37..1f5b37daa5cbb709eeacf3dc7a4f9b4a0dc05274 100644
--- a/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
+++ b/src/main/java/top/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
@@ -56,7 +56,7 @@ public class LeavesProtocolManager {
@@ -60,7 +60,7 @@ public class LeavesProtocolManager {
return;
}
@@ -33,7 +33,7 @@ index 055f044ce6cef4377f6f577efdbfad0ec9a2d57b..18fc0e2c890020bf587f5b1d2e097126
for (final Method method : methods) {
if (method.isBridge() || method.isSynthetic() || !Modifier.isStatic(method.getModifiers())) {
continue;
@@ -131,13 +131,13 @@ public class LeavesProtocolManager {
@@ -135,13 +135,13 @@ public class LeavesProtocolManager {
public static CustomPacketPayload getPayload(ResourceLocation id, FriendlyByteBuf buf) {
for (LeavesProtocol protocol : KNOWN_TYPES.keySet()) {
@@ -49,7 +49,7 @@ index 055f044ce6cef4377f6f577efdbfad0ec9a2d57b..18fc0e2c890020bf587f5b1d2e097126
try {
return map.get(receiver).newInstance(id, buf);
} catch (InvocationTargetException | InstantiationException | IllegalAccessException e) {
@@ -151,15 +151,14 @@ public class LeavesProtocolManager {
@@ -155,15 +155,14 @@ public class LeavesProtocolManager {
public static void handlePayload(ServerPlayer player, CustomPacketPayload payload) {
for (LeavesProtocol protocol : KNOW_RECEIVERS.keySet()) {
@@ -67,7 +67,7 @@ index 055f044ce6cef4377f6f577efdbfad0ec9a2d57b..18fc0e2c890020bf587f5b1d2e097126
try {
map.get(receiver).invoke(null, player, payload);
} catch (InvocationTargetException | IllegalAccessException e) {
@@ -222,7 +221,7 @@ public class LeavesProtocolManager {
@@ -226,7 +225,7 @@ public class LeavesProtocolManager {
public static void handleMinecraftRegister(String channelId, ServerPlayer player) {
for (LeavesProtocol protocol : MINECRAFT_REGISTER.keySet()) {
String[] channel = channelId.split(":");

View File

@@ -4,19 +4,21 @@ Date: Thu, 8 Feb 2024 11:57:18 +0000
Subject: [PATCH] Leaves carpet protocol support
diff --git a/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesProtocolSupportConfig.java b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesProtocolSupportConfig.java
diff --git a/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesCarpetProtocolSupportConfig.java b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesCarpetProtocolSupportConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..80d57d6262510cf7c6446e46cdd16d05461e9484
index 0000000000000000000000000000000000000000..0ef77515b213b74bdcf7dac70a02bfaa1c8804f5
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesProtocolSupportConfig.java
@@ -0,0 +1,20 @@
+++ b/src/main/java/me/earthme/luminol/config/modules/gameplay/LeavesCarpetProtocolSupportConfig.java
@@ -0,0 +1,22 @@
+package me.earthme.luminol.config.modules.gameplay;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.HotReloadUnsupported;
+import me.earthme.luminol.config.IConfigModule;
+
+public class LeavesProtocolSupportConfig implements IConfigModule {
+public class LeavesCarpetProtocolSupportConfig implements IConfigModule {
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "enabled")
+ public static boolean enabled = false;
+
@@ -32,12 +34,13 @@ index 0000000000000000000000000000000000000000..80d57d6262510cf7c6446e46cdd16d05
+}
diff --git a/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..2af49a86bf2a8bb65073c8ce088e875224916fd8
index 0000000000000000000000000000000000000000..0542d66a3dfae2aa3ccb6ca3dced6b34024017ad
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java
@@ -0,0 +1,112 @@
@@ -0,0 +1,113 @@
+package top.leavesmc.leaves.protocol;
+
+import me.earthme.luminol.config.modules.gameplay.LeavesCarpetProtocolSupportConfig;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
@@ -72,7 +75,7 @@ index 0000000000000000000000000000000000000000..2af49a86bf2a8bb65073c8ce088e8752
+
+ @ProtocolHandler.PlayerJoin
+ public static void onPlayerJoin(ServerPlayer player) {
+ if (me.earthme.luminol.config.modules.gameplay.LeavesProtocolSupportConfig.enabled) {
+ if (LeavesCarpetProtocolSupportConfig.enabled) {
+ CompoundTag data = new CompoundTag();
+ data.putString(HI, VERSION);
+ ProtocolUtils.sendPayloadPacket(player, new CarpetPayload(data));
@@ -81,7 +84,7 @@ index 0000000000000000000000000000000000000000..2af49a86bf2a8bb65073c8ce088e8752
+
+ @ProtocolHandler.PayloadReceiver(payload = CarpetPayload.class, payloadId = "hello")
+ private static void handleHello(@NotNull ServerPlayer player, @NotNull CarpetServerProtocol.CarpetPayload payload) {
+ if (me.earthme.luminol.config.modules.gameplay.LeavesProtocolSupportConfig.enabled) {
+ if (LeavesCarpetProtocolSupportConfig.enabled) {
+ if (payload.nbt.contains(HELLO)) {
+ MinecraftServer.LOGGER.info("Player " + player.getScoreboardName() + " joined with carpet " + payload.nbt.getString(HELLO));
+ CompoundTag data = new CompoundTag();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <fsjk947@gmail.com>
Date: Fri, 15 Mar 2024 03:16:22 +0800
Subject: [PATCH] Fix-MC-172047
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 2d20b2c1f58beb1ad8c9012d8124e476899e6be6..4e06908ed9759abb61a5ef5abf774874d231a83e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -52,6 +52,7 @@ import net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal;
import net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal;
import net.minecraft.world.entity.animal.horse.AbstractHorse;
import net.minecraft.world.entity.animal.horse.Llama;
+import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.monster.AbstractSkeleton;
import net.minecraft.world.entity.monster.Creeper;
import net.minecraft.world.entity.monster.Ghast;
@@ -529,13 +530,34 @@ public class Wolf extends TamableAnimal implements NeutralMob {
@Override
public boolean wantsToAttack(LivingEntity target, LivingEntity owner) {
- if (!(target instanceof Creeper) && !(target instanceof Ghast)) {
+ if (!(target instanceof Creeper) && !(target instanceof Ghast) && !(target instanceof ArmorStand)) { // Luminol - Fix MC-172047
if (target instanceof Wolf) {
Wolf entitywolf = (Wolf) target;
return !entitywolf.isTame() || entitywolf.getOwner() != owner;
} else {
- return target instanceof Player && owner instanceof Player && !((Player) owner).canHarmPlayer((Player) target) ? false : (target instanceof AbstractHorse && ((AbstractHorse) target).isTamed() ? false : !(target instanceof TamableAnimal) || !((TamableAnimal) target).isTame());
+ // Luminol start
+ if (target instanceof Player) {
+ Player targetPlayer = (Player) target;
+ if (owner instanceof Player) {
+ Player ownerPlayer = (Player) owner;
+ if (!ownerPlayer.canHarmPlayer(targetPlayer)) {
+ return false;
+ }
+ }
+ }
+ if (target instanceof AbstractHorse) {
+ AbstractHorse targetHorse = (AbstractHorse) target;
+ if (targetHorse.isTamed()) {
+ return false;
+ }
+ }
+ if (target instanceof TamableAnimal) {
+ TamableAnimal tamableAnimalTarget = (TamableAnimal) target;
+ return !tamableAnimalTarget.isTame();
+ }
+ return true;
+ // Luminol end
}
} else {
return false;

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <fsjk947@gmail.com>
Date: Fri, 15 Mar 2024 03:32:46 +0800
Subject: [PATCH] Fix-MC-2025
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d78ad18ac3b69c893a23b6bb9a6837b6a82ebdc2..8f40db062159dea7761a5663edef997a113e828b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2551,6 +2551,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
nbttagcompound.putBoolean("Paper.FreezeLock", true);
}
// Paper end
+
+ // Luminol start - Fix MC-2025
+ AABB boundingBox = getBoundingBox();
+ ListTag boundingBoxList = new ListTag();
+ for (double coord : new double[]{boundingBox.minX, boundingBox.minY, boundingBox.minZ, boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ}) {
+ boundingBoxList.add(DoubleTag.valueOf(coord));
+ }
+ nbttagcompound.put("Luminol.BoundingBox", boundingBoxList);
+ // Luminol end
+
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2628,6 +2638,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.reapplyPosition();
}
+ // Luminol start - Fix MC-2025
+ if (nbt.contains("Luminol.BoundingBox", net.minecraft.nbt.Tag.TAG_LIST)) {
+ ListTag boundingBoxList = nbt.getList("Luminol.BoundingBox", net.minecraft.nbt.Tag.TAG_DOUBLE);
+ setBoundingBox(new AABB(boundingBoxList.getDouble(0), boundingBoxList.getDouble(1), boundingBoxList.getDouble(2), boundingBoxList.getDouble(3), boundingBoxList.getDouble(4), boundingBoxList.getDouble(5)));
+ }
+ // Luminol end
+
} else {
throw new IllegalStateException("Entity has invalid rotation");
}

View File

@@ -0,0 +1,24 @@
sha256() {
sha256sum $1 | awk '{print $1}'
}
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
project_id="luminol"
mcversion_group=$(prop GroupMCV)
mcversion=$(prop mcVersion)
pre=$(prop preVersion)
if [ $pre = "true" ]; then
channel="experimental"
else
channel="default"
fi
changes=$(git log -1 --pretty='[{"commit": "%H", "message": "%s", "summary": "%b"}]')
jar_sha256=`sha256 build/libs/luminol-1.20.4-paperclip.jar`
jar_name="luminol-1.20.4-paperclip.jar"
ctime=$(date -u +"%s")"000"
# v2
echo "Authentication: $secret_v2"
echo "[DEBUG] curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}""
curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}"

18
scripts/SetENV.sh Normal file
View File

@@ -0,0 +1,18 @@
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
commitid=$(git log --pretty='%h' -1)
mcversion=$(prop mcVersion)
preVersion=$(prop preVersion)
release_tag="$mcversion-$commitid"
jarName="build/libs/luminol-1.20.4-paperclip.jar"
make_latest=$([ $preVersion = "true" ] && echo "false" || echo "true")
echo "commitid=$commitid" >> $GITHUB_ENV
echo "mcversion=$mcversion" >> $GITHUB_ENV
echo "$mcversion"
echo "tag=$release_tag" >> $GITHUB_ENV
echo "jar=$jarName" >> $GITHUB_ENV
echo "pre=$preVersion" >> $GITHUB_ENV
echo "make_latest=$make_latest" >> $GITHUB_ENV

View File

@@ -7,7 +7,7 @@ pluginManagement {
}
}
rootProject.name = "Luminol"
rootProject.name = "luminol"
for (name in listOf("Luminol-API", "Luminol-Server")) {
val projName = name.toLowerCase(Locale.ENGLISH)
include(projName)