Compare commits

..

83 Commits

Author SHA1 Message Date
Klop233
0461985e95 Update CI 2024-04-13 18:15:03 +08:00
Klop233
04b1668fa7 Update CI 2024-04-13 18:00:45 +08:00
Klop233
fb85fe59e6 Update CI 2024-04-13 17:47:15 +08:00
MrHua269
514fe3ca71 Rewrite linear region flush task dispatching 2024-04-13 17:45:46 +08:00
Klop233
b1f0a68b10 Fixed CI 2024-04-13 17:43:51 +08:00
Klop233
fd780f417b Fixed CI 2024-04-13 17:20:03 +08:00
Klop233
6339b2adc1 Update CI 2024-04-12 21:59:58 +08:00
Klop233
cc593b53e2 Update CI 2024-04-12 21:40:57 +08:00
Klop233
3b838086e9 Update CI 2024-04-12 21:26:42 +08:00
Klop233
9f0574db9f Update CI 2024-04-12 21:14:15 +08:00
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
29 changed files with 545 additions and 10 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

@@ -37,7 +37,7 @@ 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:

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

View File

@@ -50,7 +50,7 @@ dependencies {
## 联系方式
> 如果您对这个项目感兴趣或有任何问题,请随时向我们提问。
QQ群`368632360` | QQ频道[点击加入](https://pd.qq.com/s/eq9krf9j) | Telegram:[点击加入](https://t.me/LuminolMC)
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)
> [!WARNING]
> **此项目与Leaves无关。不要向Leaves报告任何有关协议支持的错误因为协议支持已经重构**
@@ -74,3 +74,4 @@ QQ群`368632360` | QQ频道[点击加入](https://pd.qq.com/s/eq9krf9j) |
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture>
</a>

View File

@@ -50,7 +50,7 @@ For maven
## 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) | Telegram: [Click To Join](https://t.me/LuminolMC)
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.**

View File

@@ -7,3 +7,7 @@ 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

@@ -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,7 +46,7 @@ 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;

View File

@@ -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 8bf94fcf5c46ffe6d90f8431338b768ef1a2dd61..a286d6cd2c371c135cb708f2bee9c5afa7532a92 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
@@ -201,7 +201,7 @@ public class TripWireHookBlock extends Block {
@@ -201,8 +201,13 @@ public class TripWireHookBlock extends Block {
BlockState iblockdata4 = aiblockdata[l];
if (iblockdata4 != null) {
- if (world.getBlockState(blockposition2).is(Blocks.TRIPWIRE)) { // Paper - Fix tripwire disarming not working as intended
+ if (world.getBlockState(blockposition2).is(Blocks.TRIPWIRE) || me.earthme.luminol.config.modules.fixes.IncorrectTripwireFixConfig.enabled) { // Paper - Fix tripwire disarming not working as intended //Luminol - Add config for this
+ 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

@@ -573,7 +573,7 @@ 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..7c034f65bac5aab4c46a8506efa5befe7891bc99
index 0000000000000000000000000000000000000000..5d594b606178bd26180caad49de17c0e67e89747
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/RegionFormatConfig.java
@@ -0,0 +1,58 @@
@@ -591,7 +591,7 @@ index 0000000000000000000000000000000000000000..7c034f65bac5aab4c46a8506efa5befe
+ @ConfigInfo(baseName = "formatName")
+ private static String formatName = "ANVIL";
+ @HotReloadUnsupported
+ @ConfigInfo(baseName = "linear_compression_level")
+ @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")

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

@@ -0,0 +1,120 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Fri, 12 Apr 2024 13:48:09 +0000
Subject: [PATCH] Rewrite linear region flush task dispatching
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
index e40989889f3821bb7484fc0bae5d94b033013904..dc5a5f42c9ca7a50295c18424722568a3ad33fa5 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
@@ -126,7 +126,7 @@ public class LinearRegionFile implements AbstractRegionFile, AutoCloseable {
}
public void flush() throws IOException {
- if (isMarkedToSave()) flushWrapper(); // sync
+ if (getAndResetSaveMarker()) flushWrapper(); // sync
}
private void markToSave() {
@@ -134,10 +134,18 @@ public class LinearRegionFile implements AbstractRegionFile, AutoCloseable {
markedToSave.set(true);
}
- public boolean isMarkedToSave() {
+ public boolean getAndResetSaveMarker() {
return markedToSave.getAndSet(false);
}
+ public boolean isMarkedToSave(){
+ return this.markedToSave.get();
+ }
+
+ public void resetSaveMarker(){
+ this.markedToSave.set(false);
+ }
+
public void flushWrapper() {
try {
save();
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java
index f06d7767c79e465f999b2032086cc224de95152a..65435eb666b2e1cabffc145e016faa5e3b373464 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFileFlusher.java
@@ -1,17 +1,14 @@
package dev.kaiijumc.kaiiju.region;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import java.util.Queue;
+
+import java.util.Set;
import java.util.concurrent.*;
import org.bukkit.Bukkit;
public class LinearRegionFileFlusher {
- private final Queue<LinearRegionFile> savingQueue = new LinkedBlockingQueue<>();
- private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(
- new ThreadFactoryBuilder()
- .setNameFormat("linear-flush-scheduler")
- .build()
- );
+ private final Set<LinearRegionFile> pendingSaving = ConcurrentHashMap.newKeySet();
+
private final ExecutorService executor = Executors.newFixedThreadPool(
me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushThreads,
new ThreadFactoryBuilder()
@@ -19,26 +16,42 @@ public class LinearRegionFileFlusher {
.build()
);
+ private final Executor delayedFlusher = CompletableFuture.delayedExecutor(
+ me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushFrequency,
+ TimeUnit.SECONDS,
+ executor
+ );
+
public LinearRegionFileFlusher() {
Bukkit.getLogger().info("Using " + me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushThreads + " threads for linear region flushing.");
- scheduler.scheduleAtFixedRate(this::pollAndFlush, 0L, me.earthme.luminol.config.modules.misc.RegionFormatConfig.linearFlushFrequency, TimeUnit.SECONDS);
}
public void scheduleSave(LinearRegionFile regionFile) {
- if (savingQueue.contains(regionFile)) return;
- savingQueue.add(regionFile);
- }
-
- private void pollAndFlush() {
- while (!savingQueue.isEmpty()) {
- LinearRegionFile regionFile = savingQueue.poll();
- if (!regionFile.closed && regionFile.isMarkedToSave())
- executor.execute(regionFile::flushWrapper);
+ if (this.pendingSaving.contains(regionFile) || !regionFile.isMarkedToSave()){
+ return;
}
+
+ this.pendingSaving.add(regionFile);
+ this.delayedFlusher.execute(()->{
+ try {
+ if (!regionFile.closed && regionFile.isMarkedToSave()){
+ regionFile.flushWrapper();
+ }
+ }finally {
+ regionFile.resetSaveMarker();
+ this.pendingSaving.remove(regionFile);
+ }
+ });
}
public void shutdown() {
- executor.shutdown();
- scheduler.shutdown();
+ this.executor.shutdown();
+ for (;;) {
+ try {
+ if (this.executor.awaitTermination(5_00,TimeUnit.MILLISECONDS)) break;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
}
}

View File

@@ -0,0 +1,47 @@
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\\\": \\\"%s\\\"}]")
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 "{\"version_group\":\"$mcversion_group\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"release_tag\":\"$tag\",\"time\":\"$ctime\"}" > data.json
json=$(printf "{\\\"channel\\\":\\\"%s\\\", \\\"jar_name\\\":\\\"%s\\\", \\\"sha256\\\":\\\"%s\\\", \\\"tag\\\":\\\"%s\\\", \\\"time\\\":\\\"%s\\\", \\\"changes\\\":\\\"%s\\\"}" \
"$channel" "$jar_name" "$jar_sha256" "$tag" "$ctime" "$changes")
echo "[DEBUG] $json"
echo "[DEBUG] curl --location --request POST \"https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit\" \
-H \"Content-Type: application/x-www-form-urlencoded\" \
-H \"Authorization: $secret_v2\" \
--data-urlencode \"channel=$channel\" \
--data-urlencode \"jar_name=$jar_name\" \
--data-urlencode \"sha256=$jar_sha256\" \
--data-urlencode \"release_tag=$tag\" \
--data-urlencode \"time=$ctime\" \
--data-urlencode \"changes=$changes\""
curl -L --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: $secret_v2" \
--data-urlencode "channel=$channel" \
--data-urlencode "jar_name=$jar_name" \
--data-urlencode "sha256=$jar_sha256" \
--data-urlencode "release_tag=$tag" \
--data-urlencode "time=$ctime" \
--data-urlencode "changes=$changes"

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