Compare commits
38 Commits
1.21.4-141
...
dev/per-vi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bf442f684 | ||
|
|
2e0339ccb4 | ||
|
|
8638f9a3c6 | ||
|
|
607b2231d3 | ||
|
|
4b89df11d1 | ||
|
|
6b9cfbec8c | ||
|
|
311c77bb16 | ||
|
|
40eb62013f | ||
|
|
1853680393 | ||
|
|
d3bdaaebb1 | ||
|
|
8441adc237 | ||
|
|
d75b16f37c | ||
|
|
977ea4ce36 | ||
|
|
417f856689 | ||
|
|
f9ac643183 | ||
|
|
dbcf43399f | ||
|
|
2e85aaf801 | ||
|
|
7bd5c4ecc4 | ||
|
|
56e7949273 | ||
|
|
7a2129c45c | ||
|
|
eb49a31dad | ||
|
|
f2fa3514bd | ||
|
|
83c54e3134 | ||
|
|
021c3666f7 | ||
|
|
860e9fbaf5 | ||
|
|
1a6a70069c | ||
|
|
1f0fc01a6e | ||
|
|
c20bbf9842 | ||
|
|
93e4d4eea1 | ||
|
|
efc5adae8b | ||
|
|
f51216d01d | ||
|
|
3ef35a1b4b | ||
|
|
c06b8444aa | ||
|
|
3e96017ed6 | ||
|
|
85e32d5d03 | ||
|
|
778c82ee0a | ||
|
|
3550274e82 | ||
|
|
e24d0fffdf |
16
.github/workflows/build_1.21.4.yml
vendored
16
.github/workflows/build_1.21.4.yml
vendored
@@ -1,10 +1,10 @@
|
||||
name: Luminol CI - dev/1.21.4-hardfork
|
||||
name: Luminol CI - dev/per-virtual-thread-tickregion
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "dev/1.21.4-hardfork" ]
|
||||
branches: [ "dev/per-virtual-thread-tickregion" ]
|
||||
pull_request:
|
||||
branches: [ "dev/1.21.4-hardfork" ]
|
||||
branches: [ "dev/per-virtual-thread-tickregion" ]
|
||||
|
||||
permissions: write-all
|
||||
|
||||
@@ -41,24 +41,28 @@ jobs:
|
||||
uses: "actions/upload-artifact@v4"
|
||||
with:
|
||||
name: "${{ env.project_id_b }} CI Artifacts"
|
||||
path: "luminol-server/build/libs/*.jar"
|
||||
path: "luminol-server/build/libs/*-paperclip-*-mojmap.jar"
|
||||
- name: SetENV
|
||||
if: github.event_name != 'pull_request'
|
||||
run: sh scripts/SetENV.sh
|
||||
- name: Create Release
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
uses: ncipollo/release-action@v1.16.0
|
||||
with:
|
||||
tag: ${{ env.tag }}
|
||||
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}
|
||||
body: |
|
||||
> [!CAUTION]
|
||||
> 🚨You are trying to download experimental builds!
|
||||
> **<u>DO NOT</u>** use these builds in production, as there may be many bugs and corruption issues.
|
||||
> Please report any and all issues you encounter!
|
||||
|
||||
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [](https://github.com/LuminolMC/${{ env.project_id }}/download/${{ env.tag }}/${{ env.jar }})
|
||||
This release is automatically compiled by GitHub Actions
|
||||
### Commit Message
|
||||
${{ env.commit_msg }}
|
||||
artifacts: |
|
||||
${{ env.jar_dir }}
|
||||
${{ env.jar_dir_bundler }}
|
||||
generateReleaseNotes: true
|
||||
prerelease: ${{ env.pre }}
|
||||
makeLatest: ${{ env.make_latest }}
|
||||
|
||||
@@ -21,23 +21,24 @@
|
||||
在开始开发之前,您首先需要拥有以下软件作为开发环境:
|
||||
|
||||
- `git`
|
||||
- `JDK 17 或更高版本`
|
||||
- `JDK 21 或更高版本`
|
||||
|
||||
## 了解补丁(Patches)
|
||||
|
||||
Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的修改分成了两个目录:
|
||||
|
||||
- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit` 进行的修改。
|
||||
- `luminol-server` - 对 Minecraft 标准服务器原有逻辑进行的修改。
|
||||
|
||||
补丁系统是基于 git 的,你可以在这里了解 git 的基本内容: <https://git-scm.com/docs/gittutorial>
|
||||
|
||||
如果你已经 Fork 了主储存库,那么下面你应该这么做:
|
||||
|
||||
1. 将你的仓库 clone 到本地;
|
||||
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyPatches`;
|
||||
3. 进入 `luminol-api` 文件夹进行修改。
|
||||
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`;
|
||||
3. 进入 仓库根目录下的 `luminol-api` 和 `luminol-server` 文件夹进行修改。
|
||||
|
||||
顺便一提,`luminol-api` 并不是正常的 git 仓库:
|
||||
顺便一提,仓库根目录下的 `luminol-api` 和 `luminol-server` 并不是正常的 git 仓库:
|
||||
|
||||
- 在应用补丁前,基点将会指向未被更改的源码
|
||||
- 在基点后的每一个提交都是一个补丁
|
||||
@@ -47,11 +48,12 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
|
||||
按照以下步骤增加一个补丁是非常简单的:
|
||||
|
||||
1. 对 `luminol-api` 进行修改;
|
||||
2. 使用 git 添加你的修改,比如 `git add .`;
|
||||
1. 对 `luminol-api` 和 `luminol-server` 进行修改;
|
||||
2. 使用 git 添加你的修改,比如 `git add .`(不要提交新建的文件的修改);
|
||||
3. 使用 `git commit -m <提交信息>` 进行提交;
|
||||
4. 运行 Gradle 任务 `rebuildPatches` 将你的提交转化为一个补丁;
|
||||
5. 将你生成的补丁文件进行推送。
|
||||
4. 运行 Gradle 任务 `rebuildAllServerPatches` 将你的提交转化为一个补丁;
|
||||
5. 运行 Gradle 任务 `fixupPaperApiFilePatches` 生成新建文件的补丁文件(注意不要提交);
|
||||
6. 将你生成的补丁文件进行推送。
|
||||
|
||||
这样做以后,你就可以将你的补丁文件进行 PR 提交。
|
||||
|
||||
@@ -60,8 +62,9 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
你可以使用以下方法来修改一个补丁的内容:
|
||||
|
||||
1. 在 HEAD 上直接进行修改;
|
||||
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;
|
||||
2. 使用 `git commit -a --fixup <hash>` 来进行一个更正提交;(不要提交对在luminol新建文件的修改)
|
||||
- 如果你想要更改提交信息,你也可以用 `--squash` 来代替 `--fixup`。
|
||||
3. 使用 `git rebase -i --autosquash base` 来进行自动变基,你只需要输入 `:q` 来关闭确认页面即可;
|
||||
4. 运行 Gradle 任务 `rebuildPatches` 来修改已被修改的补丁;
|
||||
5. 将修改后的补丁 PR 发回储存库。
|
||||
4. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
|
||||
5. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在luminol新建文件的补丁(注意不要提交);
|
||||
6. 将修改后的补丁 PR 发回储存库。
|
||||
|
||||
@@ -10,20 +10,20 @@ And if you can follow the rules below, we can complete the review faster.
|
||||
## Please fork using your personal account
|
||||
|
||||
We regularly merge existing PRs.
|
||||
If there're some small problems, we'll help you solve them by editing your PR.
|
||||
If there are some small problems, we'll help you solve them by editing your PR.
|
||||
|
||||
But, if your PR is from a organization, we can NOT edit your PR, so we must merge your PR manually.
|
||||
But, if your PR is from an organization, we can NOT edit your PR, so we must merge your PR manually.
|
||||
|
||||
So, don't use orgnization accounts for fork!
|
||||
So, don't use organization accounts for fork!
|
||||
|
||||
See also [This issue](https://github.com/isaacs/github/issues/1681), and then you'll know why we can't edit PRs from organizations.
|
||||
|
||||
## Development Environment
|
||||
|
||||
Before coding, you need these softwares / tools as Dev Environment.
|
||||
Before coding, you need these pieces of software / tools as Dev Environment.
|
||||
|
||||
- `git`
|
||||
- `JDK 17 or higher`
|
||||
- `JDK 21 or higher`
|
||||
|
||||
## Understanding "Patches"
|
||||
|
||||
@@ -31,40 +31,43 @@ Luminol uses as the same patching system as Paper,
|
||||
and has been divided into two directories for the purpose of modifying different parts of it:
|
||||
|
||||
- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit`.
|
||||
- `luminol-server` - Modifications to Minecraft Official Server's source logic.
|
||||
|
||||
The patching system is based on git, and you can learn about it at here: <https://git-scm.com/docs/gittutorial>
|
||||
|
||||
If you have forked the main repository, then you should follow the steps below:
|
||||
|
||||
1. Clone your repository to local
|
||||
2. Run Gradle's `applyPatches` task in your IDE or terminal (You can run `./gradlew applyPatches` directly in terminal.)
|
||||
3. Enter `luminol-api` directory to carry out modifications.
|
||||
2. Run Gradle's `applyAllPatches` task in your IDE or terminal (You can run `./gradlew applyAllPatches` directly in terminal.)
|
||||
3. Enter `luminol-api` and `luminol-server` directory to carry out modifications.
|
||||
|
||||
BTW, `luminol-api` and are not normal git repositories.
|
||||
BTW, `luminol-api` and `luminol-server` and are not normal git repositories.
|
||||
|
||||
- Before applying patches, the base will point to unmodified source code.
|
||||
- Every commit after the base is a patch.
|
||||
- Only commits after the last commit of Paper will be considered Luminol' patches.
|
||||
- Only commits after the last commit of Paper will be considered as Luminol patches.
|
||||
|
||||
## Adding new patches
|
||||
|
||||
It's very easy to to add patches by following the steps below:
|
||||
It's very easy to add patches by following the steps below:
|
||||
|
||||
1. Modify the code of `luminol-api`
|
||||
1. Modify the code of `luminol-api` and `luminol-server`
|
||||
2. Add these changes to the local git repository (For example, `git add .`)
|
||||
3. Commit these changes using `git commit -m <Commit Message>`
|
||||
4. Run Gradle's task `rebuildPatches` to convert your commits to a new patch
|
||||
5. Push your patches to your repository
|
||||
3. Commit these changes using `git commit -m <Commit Message>` (PS: do not commit new-created files)
|
||||
4. Run Gradle's task `rebuildAllServerPatches` to convert your commits to a new patch
|
||||
5. Run Gradle's task `fixupPaperApiFilePatches` to generate newly created files to new patches (PS: do not commit again before you run this task)
|
||||
6. Push your patches to your repository
|
||||
|
||||
After pushing, you can open a PR to submit your patches.
|
||||
|
||||
## Modifying patches
|
||||
|
||||
You can modify a existing patch by following the steps below:
|
||||
You can modify an existing patch by following the steps below:
|
||||
|
||||
1. Modify code at HEAD
|
||||
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit
|
||||
2. Run `git commit -a --fixup <hash>` in your terminal to make a fix-up commit (PS: do not commit changes of luminol-created files)
|
||||
- If you want to edit the commit message, replace `--fixup` with `--squash`.
|
||||
3. Run `git rebase -i --autosquash base` to rebase automatically, then just type `:q` to close the confirm page
|
||||
4. Run Gradle's task `rebuildPatches` to modify existing patches
|
||||
5. Push and PR again
|
||||
4. Run Gradle's task `rebuildAllServerPatches` to modify existing patches
|
||||
5. Run Gradle's task `fixupPaperApiFilePatches` to regenerate luminol-created files to patches (PS: do not commit again before you run this task)
|
||||
6. Push and PR again
|
||||
|
||||
@@ -2,7 +2,7 @@ group = me.earthme.luminol
|
||||
version=1.21.4-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.4
|
||||
|
||||
foliaRef=d3969cdc419b84e2d94c13854d4eb94ae2e0b7be
|
||||
foliaRef=80ab57dcbe5fa96cc2f7fe34ecba94162d8dd5e9
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.caching=true
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sat, 22 Mar 2025 17:36:17 +0800
|
||||
Subject: [PATCH] Luminol config base
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index 9aa664537cc37e44db46d5a2a64ae3116938c681..8d6a6534a134e99e5ee2652d7b0c858d538e69bd 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -108,6 +108,7 @@ public class Main {
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
+ me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol config
|
||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index e3b7184e20bda4983ee1fc5463d91ca0cdd8ec1f..375f4a59333ee1d75fb1acb8c2cbada7866bd48e 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -212,6 +212,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
|
||||
+ me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); //Luminol - load config file
|
||||
+ me.earthme.luminol.config.LuminolConfig.setupLatch(); //Luminol - load config file
|
||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config for server mod name
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index faf72dd6dff74296c73cb058aaabd1f9f475a072..46375fa81b36b89b79c22f0a7ac6d610ab1183d4 100644
|
||||
index be82a6b43b1f0c644c53d08a6e16bc2876c8c1e0..9261d83f28af5e057d060741ab900f8cde8f992b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1967,7 +1967,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1968,7 +1968,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -27,7 +27,7 @@ index 1fa5e6a12b943e889bde566038a632a6adcf319e..c1f6a3b3a8fa990b8e9b052341ab31bd
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index 177735cf744e564081e4c140a0f8210c3a07e037..7274f2d7df9228f34305a21abde6d114a495c1cb 100644
|
||||
index 554d75ac1374d7d93977a10e06fcf51259830c97..17c1ce4397c5953bb92aaa3b56c179b7c24a0736 100644
|
||||
--- a/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -67,6 +67,11 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
||||
@@ -17,10 +17,10 @@ index 8d67b4629c69d3039b199aaad45533d1acde114e..f7bfeca4b11b9860241d5eb80b6df420
|
||||
((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickServerLevel)(ServerLevel)chunk.getLevel()).moonrise$removeChunkForPlayerTicking(chunk); // Moonrise - chunk tick iteration
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 46375fa81b36b89b79c22f0a7ac6d610ab1183d4..f2124edb487b1d5f6bdc7fa086814f870724363a 100644
|
||||
index 9261d83f28af5e057d060741ab900f8cde8f992b..fc088edaa36e7e68ddd23c57e351ef3b31ed5ad8 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1665,7 +1665,44 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1666,7 +1666,44 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Folia end - region threading
|
||||
//this.tickCount++; // Folia - region threading
|
||||
//this.tickRateManager.tick(); // Folia - region threading
|
||||
@@ -118,10 +118,10 @@ index f2d2ddfd964bff914e41c0b4150fe1aad7866ebf..7defcd15c44601bfd2f7f55046038693
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 423534a1ff02bd0d0f9baacfe2428f45c7d9acb9..9fd3fe181df2ce6dbe695f6463d3940ac4c01167 100644
|
||||
index dbf9231b1f01576906b90a3ddf0bf2cbbeb4590a..b17ace9118c94a756fa2901621c6b2b9bd9e5764 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -393,7 +393,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -400,7 +400,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable String clientBrandName = null; // Paper - Brand support
|
||||
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||
@@ -132,7 +132,7 @@ index 423534a1ff02bd0d0f9baacfe2428f45c7d9acb9..9fd3fe181df2ce6dbe695f6463d3940a
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
private final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder viewDistanceHolder = new ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder();
|
||||
@@ -1006,8 +1008,35 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1013,8 +1015,35 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.trackEnteredOrExitedLavaOnVehicle();
|
||||
this.updatePlayerAttributes();
|
||||
this.advancements.flushDirty(this);
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config to disable entity tick catchers
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index dafd90502937019b616ac0a79465e1dbc578cf66..96daa716aa06de31b2867f09833ac8e77b6314c4 100644
|
||||
index 78f4dd7032d18b8e020a4576e4ac012c1d472e67..120e25ca0544980d1bfc1498e1386f965dae7044 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1547,6 +1547,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1,25 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 10:39:35 +0800
|
||||
Subject: [PATCH] Add fix for off region adult following ai behavior
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
index a9be3acbf4ea52d2988347abfa6f4f8c02b1da26..751f3dde8e6bc2c0365e8672f5079af0379a69de 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
@@ -25,6 +25,14 @@ public class BabyFollowAdult {
|
||||
return false;
|
||||
} else {
|
||||
LivingEntity ageableMob = instance.get(nearestVisibleAdult); // CraftBukkit - type
|
||||
+
|
||||
+ // Luminol start - Fix off world entity following which caused async issue
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ageableMob)) {
|
||||
+ nearestVisibleAdult.erase();
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
+
|
||||
if (mob.closerThan(ageableMob, followRange.getMaxValue() + 1) && !mob.closerThan(ageableMob, followRange.getMinValue())) {
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(mob, ageableMob, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
||||
Date: Mon, 24 Feb 2025 06:00:00 -0800
|
||||
Subject: [PATCH] Configurable tripwire dupe
|
||||
Subject: [PATCH] Add config for tripwire dupe
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||
@@ -0,0 +1,21 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kercute <A3167717663@hotmail.com>
|
||||
Date: Sun, 16 Mar 2025 23:31:41 +0800
|
||||
Subject: [PATCH] Add experiment config for force enabling data command
|
||||
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 009e6405a11a391adca41a7c4ecafbf3254d799d..cfb37f2e428605965a37dc1eb83f302fe1bd6299 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -162,7 +162,9 @@ public class Commands {
|
||||
ClearInventoryCommands.register(this.dispatcher, context);
|
||||
//CloneCommands.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
DamageCommand.register(this.dispatcher, context);
|
||||
- //DataCommands.register(this.dispatcher); // Folia - region threading - TODO
|
||||
+ if(me.earthme.luminol.config.modules.experiment.CommandDataConfig.enabled) {
|
||||
+ DataCommands.register(this.dispatcher); // Folia - region threading - TODO
|
||||
+ }
|
||||
//DataPackCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
DefaultGameModeCommands.register(this.dispatcher);
|
||||
@@ -55,7 +55,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..c7d4d944eb198ac53a3eeae717a25c7d
|
||||
+ public void moonrise$write(final abomination.IRegionFile regionFile) throws IOException; // Luminol - Configurable region file format
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index f2124edb487b1d5f6bdc7fa086814f870724363a..ed00a29daccfee1d631bef27c0a3a4ae83140018 100644
|
||||
index fc088edaa36e7e68ddd23c57e351ef3b31ed5ad8..5d709b3b47702e7607dafa4a38380c801b228e2d 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -986,10 +986,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -0,0 +1,512 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sun, 6 Apr 2025 12:51:11 +0800
|
||||
Subject: [PATCH] Add feature: per virtual thread per tickregion
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/PerThreadSchedulerPool.java b/io/papermc/paper/threadedregions/PerThreadSchedulerPool.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b49b4b02c3d38174a0bb8d171e1f1e65320bdeca
|
||||
--- /dev/null
|
||||
+++ b/io/papermc/paper/threadedregions/PerThreadSchedulerPool.java
|
||||
@@ -0,0 +1,183 @@
|
||||
+package io.papermc.paper.threadedregions;
|
||||
+
|
||||
+import it.unimi.dsi.fastutil.objects.Reference2ObjectLinkedOpenHashMap;
|
||||
+import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
|
||||
+import it.unimi.dsi.fastutil.objects.Reference2ObjectMaps;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.Arrays;
|
||||
+import java.util.concurrent.ThreadFactory;
|
||||
+import java.util.concurrent.atomic.AtomicBoolean;
|
||||
+import java.util.concurrent.locks.LockSupport;
|
||||
+
|
||||
+public class PerThreadSchedulerPool {
|
||||
+ private final ThreadFactory factory;
|
||||
+ private final COWArrayList<Worker> workers = new COWArrayList<>(Worker.class);
|
||||
+ private final Reference2ObjectMap<ScheduledTaskThreadPool.SchedulableTick, Worker> task2Workers = Reference2ObjectMaps.synchronize(new Reference2ObjectLinkedOpenHashMap<>());
|
||||
+
|
||||
+ public PerThreadSchedulerPool(ThreadFactory factory) {
|
||||
+ this.factory = factory;
|
||||
+ }
|
||||
+
|
||||
+ public void schedule(ScheduledTaskThreadPool.SchedulableTick task) {
|
||||
+ final Worker cretedWorker = new Worker(this.factory, task);
|
||||
+
|
||||
+ this.task2Workers.put(task, cretedWorker);
|
||||
+ this.workers.add(cretedWorker);
|
||||
+
|
||||
+ cretedWorker.active();
|
||||
+ }
|
||||
+
|
||||
+ public void notifyTasks(ScheduledTaskThreadPool.SchedulableTick task) {
|
||||
+ final Worker target = this.task2Workers.get(task);
|
||||
+
|
||||
+ if (target == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ target.notifyToTask();
|
||||
+ }
|
||||
+
|
||||
+ public void halt() {
|
||||
+ final Worker[] workers = this.workers.getArray();
|
||||
+
|
||||
+ for (Worker worker : workers) {
|
||||
+ worker.shutdown();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public int getTotalThreadCount() {
|
||||
+ return this.workers.getArray().length;
|
||||
+ }
|
||||
+
|
||||
+ public Thread[] getAllAliveThreads() {
|
||||
+ return Arrays.stream(this.workers.getArray()).map(Worker::getOwner).toArray(Thread[]::new);
|
||||
+ }
|
||||
+
|
||||
+ public boolean join(long timeoutNanos) {
|
||||
+ long deadline = System.nanoTime() + timeoutNanos;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ final Worker[] workers = this.workers.getArray();
|
||||
+
|
||||
+ if (workers.length == 0) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ Thread.yield();
|
||||
+ LockSupport.parkNanos(1);
|
||||
+
|
||||
+ if (System.nanoTime() > deadline) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public final class Worker implements Runnable {
|
||||
+ private final Thread thread;
|
||||
+ private final ScheduledTaskThreadPool.SchedulableTick task;
|
||||
+
|
||||
+ private final AtomicBoolean shutdown = new AtomicBoolean(false);
|
||||
+ private final AtomicBoolean running = new AtomicBoolean(true);
|
||||
+
|
||||
+ public Worker(@NotNull ThreadFactory threadFactory, ScheduledTaskThreadPool.SchedulableTick task) {
|
||||
+ this.thread = threadFactory.newThread(this);
|
||||
+ this.task = task;
|
||||
+
|
||||
+ if (!this.task.setScheduled()) {
|
||||
+ throw new IllegalArgumentException("Task is already scheduled");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.set(new TickThreadRunnerDataCarrier());
|
||||
+
|
||||
+ master_loop:
|
||||
+ for (;;) {
|
||||
+ if (!this.task.isScheduled() || this.shutdown.get()) {
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ final long deadline = this.task.getScheduledStart();
|
||||
+
|
||||
+ for (;; ) {
|
||||
+ final long currTime = System.nanoTime();
|
||||
+
|
||||
+ if (currTime >= deadline) {
|
||||
+ // we will use it in setting to ticking state
|
||||
+ // containing cas operations so we need to process the fallback
|
||||
+ if (this.task.upgradeToScheduledTasks()) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ final boolean hasTasks = this.task.hasTasks(); // check for tasks
|
||||
+
|
||||
+ if (hasTasks) {
|
||||
+ // containing cas operations so we need to process the fallback
|
||||
+ if (!this.task.upgradeToScheduledTasks()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // task sate and run tasks
|
||||
+ final boolean taskProcessed = this.task.tasks(() -> System.nanoTime() >= deadline);
|
||||
+
|
||||
+ // containing cas operations so we need to process the fallback
|
||||
+ // also might be cancelled
|
||||
+ if (!taskProcessed) {
|
||||
+ // check for cancelled
|
||||
+ continue master_loop;
|
||||
+ }else {
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ Thread.yield();
|
||||
+ LockSupport.parkNanos(1_000L);
|
||||
+ }
|
||||
+
|
||||
+ boolean ticked = this.task.tick();
|
||||
+
|
||||
+ if (!ticked) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.remove();
|
||||
+ PerThreadSchedulerPool.this.task2Workers.remove(this.task);
|
||||
+ PerThreadSchedulerPool.this.workers.remove(this);
|
||||
+ this.running.set(false);
|
||||
+ }
|
||||
+
|
||||
+ public void active() {
|
||||
+ this.thread.start();
|
||||
+ }
|
||||
+
|
||||
+ public Thread getOwner() {
|
||||
+ return this.thread;
|
||||
+ }
|
||||
+
|
||||
+ public void notifyToTask() {
|
||||
+ LockSupport.unpark(this.thread);
|
||||
+ }
|
||||
+
|
||||
+ public boolean running() {
|
||||
+ return this.running.get();
|
||||
+ }
|
||||
+
|
||||
+ public void shutdown() {
|
||||
+ this.shutdown.set(true);
|
||||
+ LockSupport.unpark(this.thread);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static class TickThreadRunnerDataCarrier {
|
||||
+ ThreadedRegionizer.ThreadedRegion<TickRegions.TickRegionData, TickRegions.TickRegionSectionData> currentTickingRegion;
|
||||
+ RegionizedWorldData currentTickingWorldRegionizedData;
|
||||
+ ScheduledTaskThreadPool.SchedulableTick currentTickingTask;
|
||||
+ ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE;
|
||||
+
|
||||
+ public static final ThreadLocal<TickThreadRunnerDataCarrier> CARRIER_THREAD_LOCAL = new ThreadLocal<>();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java b/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
index 5c591b0d6eac45d6094ce44bf62ad976bf995e66..2f61f72087ea07e8d29bf6d5c264e217b20eb377 100644
|
||||
--- a/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
+++ b/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
@@ -402,7 +402,7 @@ public final class ScheduledTaskThreadPool {
|
||||
|
||||
private volatile ScheduledTickTask task;
|
||||
|
||||
- private int getStateVolatile() {
|
||||
+ public int getStateVolatile() { // Luminol - Per thread for tickregion
|
||||
return (int)STATE_HANDLE.getVolatile(this);
|
||||
}
|
||||
|
||||
@@ -414,23 +414,23 @@ public final class ScheduledTaskThreadPool {
|
||||
return (int)STATE_HANDLE.compareAndExchange(this, expect, update);
|
||||
}
|
||||
|
||||
- private boolean isScheduled() {
|
||||
+ public boolean isScheduled() { // Luminol - Per thread for tickregion
|
||||
return this.getStateVolatile() == STATE_SCHEDULED;
|
||||
}
|
||||
|
||||
- private boolean upgradeToScheduledTasks() {
|
||||
+ public boolean upgradeToScheduledTasks() { // Luminol - Per thread for tickregion
|
||||
return STATE_SCHEDULED == this.compareAndExchangeStateVolatile(STATE_SCHEDULED, STATE_SCHEDULED_TASKS);
|
||||
}
|
||||
|
||||
- private boolean setScheduled() {
|
||||
+ public boolean setScheduled() { // Luminol - Per thread for tickregion
|
||||
return STATE_UNSCHEDULED == this.compareAndExchangeStateVolatile(STATE_UNSCHEDULED, STATE_SCHEDULED);
|
||||
}
|
||||
|
||||
- private boolean setScheduledTasks() {
|
||||
+ public boolean setScheduledTasks() { // Luminol - Per thread for tickregion
|
||||
return STATE_UNSCHEDULED == this.compareAndExchangeStateVolatile(STATE_UNSCHEDULED, STATE_SCHEDULED_TASKS);
|
||||
}
|
||||
|
||||
- private boolean cancel() {
|
||||
+ public boolean cancel() { // Luminol - Per thread for tickregion
|
||||
for (int currState = this.getStateVolatile();;) {
|
||||
switch (currState) {
|
||||
case STATE_UNSCHEDULED: {
|
||||
@@ -544,14 +544,14 @@ public final class ScheduledTaskThreadPool {
|
||||
}
|
||||
}
|
||||
|
||||
- protected final long getScheduledStart() {
|
||||
+ public final long getScheduledStart() { // Luminol - Per thread for tickregion
|
||||
return this.scheduledStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this task is scheduled, then this may only be invoked during {@link #runTick()}
|
||||
*/
|
||||
- protected final void setScheduledStart(final long value) {
|
||||
+ public final void setScheduledStart(final long value) { // Luminol - Per thread for tickregion
|
||||
this.scheduledStart = value;
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ public final class ScheduledTaskThreadPool {
|
||||
*/
|
||||
public abstract boolean runTick();
|
||||
|
||||
- private boolean tick() {
|
||||
+ public boolean tick() { // Luminol - Per thread for tickregion
|
||||
if (!this.markTicking()) {
|
||||
return false;
|
||||
}
|
||||
@@ -610,7 +610,7 @@ public final class ScheduledTaskThreadPool {
|
||||
*/
|
||||
public abstract boolean runTasks(final BooleanSupplier canContinue);
|
||||
|
||||
- private boolean tasks(final BooleanSupplier canContinue) {
|
||||
+ public boolean tasks(final BooleanSupplier canContinue) { // Luminol - Per thread for tickregion
|
||||
if (!this.markTasks()) {
|
||||
return false;
|
||||
}
|
||||
@@ -692,12 +692,12 @@ public final class ScheduledTaskThreadPool {
|
||||
private Thread thread;
|
||||
|
||||
// no scheduled ticks
|
||||
- private static final int STATE_IDLE = 1 << 0;
|
||||
- private static final int STATE_WAITING = 1 << 1;
|
||||
- private static final int STATE_TASKS = 1 << 2;
|
||||
- private static final int STATE_INTERRUPT = 1 << 3;
|
||||
- private static final int STATE_TICKING = 1 << 4;
|
||||
- private static final int STATE_HALTED = 1 << 5;
|
||||
+ public static final int STATE_IDLE = 1 << 0; // Luminol - Per thread for tickregion
|
||||
+ public static final int STATE_WAITING = 1 << 1; // Luminol - Per thread for tickregion
|
||||
+ public static final int STATE_TASKS = 1 << 2; // Luminol - Per thread for tickregion
|
||||
+ public static final int STATE_INTERRUPT = 1 << 3; // Luminol - Per thread for tickregion
|
||||
+ public static final int STATE_TICKING = 1 << 4; // Luminol - Per thread for tickregion
|
||||
+ public static final int STATE_HALTED = 1 << 5; // Luminol - Per thread for tickregion
|
||||
private volatile int state = STATE_INTERRUPT; // set to INTERRUPT initially so that tasks may be stolen on start
|
||||
private static final VarHandle STATE_HANDLE = ConcurrentUtil.getVarHandle(TickThreadRunner.class, "state", int.class);
|
||||
|
||||
@@ -720,7 +720,7 @@ public final class ScheduledTaskThreadPool {
|
||||
STATE_HANDLE.setVolatile(this, value);
|
||||
}
|
||||
|
||||
- private int compareAndExchangeStateVolatile(final int expect, final int update) {
|
||||
+ public int compareAndExchangeStateVolatile(final int expect, final int update) { // Luminol - Per thread for tickregion
|
||||
return (int)STATE_HANDLE.compareAndExchange(this, expect, update);
|
||||
}
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
index a8608e8bed64a4da4ed340ab3837b082d6715437..fc14f5780effce99a9768a1ffbb338e61228b252 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
@@ -40,65 +40,92 @@ public final class TickRegionScheduler {
|
||||
}
|
||||
// Folia end - watchdog
|
||||
|
||||
- private final ScheduledTaskThreadPool scheduler;
|
||||
+ private final PerThreadSchedulerPool scheduler; // Luminol - Per thread for tickregion
|
||||
|
||||
public TickRegionScheduler() {
|
||||
- this.scheduler = new ScheduledTaskThreadPool(new ThreadFactory() {
|
||||
+ this.scheduler = new PerThreadSchedulerPool(new ThreadFactory() { // Luminol - Per thread for tickregion
|
||||
private final AtomicInteger idGenerator = new AtomicInteger();
|
||||
|
||||
@Override
|
||||
public Thread newThread(final Runnable run) {
|
||||
- final Thread ret = new TickThreadRunner(run, "Region Scheduler Thread #" + this.idGenerator.getAndIncrement());
|
||||
- ret.setUncaughtExceptionHandler(TickRegionScheduler.this::uncaughtException);
|
||||
+ //final Thread ret = new TickThreadRunner(run, "Region Scheduler Thread #" + this.idGenerator.getAndIncrement()); // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ final Thread ret = Thread.ofVirtual()
|
||||
+ .name("Region Scheduler Thread #" + this.idGenerator.getAndIncrement())
|
||||
+ .uncaughtExceptionHandler(TickRegionScheduler.this::uncaughtException)
|
||||
+ .factory()
|
||||
+ .newThread(() -> {
|
||||
+ try {
|
||||
+ run.run();
|
||||
+ }finally {
|
||||
+ TickThread.VIRTUAL_TICK_THREAD_GROUP.remove(Thread.currentThread());
|
||||
+ }
|
||||
+ });
|
||||
+ TickThread.VIRTUAL_TICK_THREAD_GROUP.add(ret);
|
||||
+ // Luminol end
|
||||
return ret;
|
||||
}
|
||||
- }, TimeUnit.MILLISECONDS.toNanos(3L), TimeUnit.MILLISECONDS.toNanos(2L));
|
||||
+ }); // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
public void setThreads(final int threads) {
|
||||
- this.scheduler.setCoreThreads(threads);
|
||||
+ //this.scheduler.setCoreThreads(threads); // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
public int getTotalThreadCount() {
|
||||
- return this.scheduler.getAliveThreads().length;
|
||||
+ return this.scheduler.getTotalThreadCount(); // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
private static void setTickingRegion(final ThreadedRegionizer.ThreadedRegion<TickRegions.TickRegionData, TickRegions.TickRegionSectionData> region) {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
+ /*final Thread currThread = Thread.currentThread();
|
||||
if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
throw new IllegalStateException("Must be tick thread runner");
|
||||
+ }*/
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get(); // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ if (carrier == null) {
|
||||
+ throw new IllegalStateException("Must be tick thread runner");
|
||||
}
|
||||
- if (region != null && tickThreadRunner.currentTickingRegion != null) {
|
||||
+ // Luminol end
|
||||
+ var currentTickingRegion = carrier.currentTickingRegion; // Luminol - Per thread for tickregion
|
||||
+ if (region != null && currentTickingRegion != null) { // Luminol - Per thread for tickregion
|
||||
throw new IllegalStateException("Trying to double set ticking region!");
|
||||
}
|
||||
- if (region == null && tickThreadRunner.currentTickingRegion == null) {
|
||||
+ if (region == null && currentTickingRegion == null) { // Luminol - Per thread for tickregion
|
||||
throw new IllegalStateException("Trying to double unset ticking region!");
|
||||
}
|
||||
- tickThreadRunner.currentTickingRegion = region;
|
||||
+ carrier.currentTickingRegion = region; // Luminol - Per thread for tickregion
|
||||
if (region != null) {
|
||||
- tickThreadRunner.currentTickingWorldRegionizedData = region.regioniser.world.worldRegionData.get();
|
||||
+ carrier.currentTickingWorldRegionizedData = region.regioniser.world.worldRegionData.get(); // Luminol - Per thread for tickregion
|
||||
// Folia start - profiler
|
||||
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = region.getData().profiler;
|
||||
- tickThreadRunner.profiler = profiler == null ? ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE : profiler;
|
||||
+ carrier.profiler = profiler == null ? ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE : profiler; // Luminol - Per thread for tickregion
|
||||
// Folia end - profiler
|
||||
} else {
|
||||
- tickThreadRunner.currentTickingWorldRegionizedData = null;
|
||||
- tickThreadRunner.profiler = ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE; // Folia - profiler
|
||||
+ carrier.currentTickingWorldRegionizedData = null;// Luminol - Per thread for tickregion
|
||||
+ carrier.profiler = ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE; // Folia - profiler // Luminol - Per thread for tickregion
|
||||
}
|
||||
}
|
||||
|
||||
private static void setTickTask(final ScheduledTaskThreadPool.SchedulableTick task) {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
+ /*final Thread currThread = Thread.currentThread(); // Luminol - Per thread for tickregion
|
||||
if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
throw new IllegalStateException("Must be tick thread runner");
|
||||
+ }*/ // Luminol - Per thread for tickregion
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get(); // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ if (carrier == null) {
|
||||
+ throw new IllegalStateException("Must be tick thread runner");
|
||||
}
|
||||
- if (task != null && tickThreadRunner.currentTickingTask != null) {
|
||||
+ // Luminol end
|
||||
+ final ScheduledTaskThreadPool.SchedulableTick last = carrier.currentTickingTask; // Luminol - Per thread for tickregion
|
||||
+ if (task != null && last != null) { // Luminol - Per thread for tickregion
|
||||
throw new IllegalStateException("Trying to double set ticking task!");
|
||||
}
|
||||
- if (task == null && tickThreadRunner.currentTickingTask == null) {
|
||||
+ if (task == null && last == null) { // Luminol - Per thread for tickregion
|
||||
throw new IllegalStateException("Trying to double unset ticking task!");
|
||||
}
|
||||
- tickThreadRunner.currentTickingTask = task;
|
||||
+ carrier.currentTickingTask = task;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,11 +133,17 @@ public final class TickRegionScheduler {
|
||||
* If this thread is not a TickThread, then returns {@code null}.
|
||||
*/
|
||||
public static ThreadedRegionizer.ThreadedRegion<TickRegions.TickRegionData, TickRegions.TickRegionSectionData> getCurrentRegion() {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
+ /*final Thread currThread = Thread.currentThread(); // Luminol - Per thread for tickregion
|
||||
if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
return RegionShutdownThread.getRegion();
|
||||
+ }*/ // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get();
|
||||
+ if (carrier == null) {
|
||||
+ return RegionShutdownThread.getRegion();
|
||||
}
|
||||
- return tickThreadRunner.currentTickingRegion;
|
||||
+ // Luminol end
|
||||
+ return carrier.currentTickingRegion; // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,11 +152,17 @@ public final class TickRegionScheduler {
|
||||
* If this thread is not a TickThread, then returns {@code null}.
|
||||
*/
|
||||
public static RegionizedWorldData getCurrentRegionizedWorldData() {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
+ /*final Thread currThread = Thread.currentThread(); // Luminol - Per thread for tickregion
|
||||
if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
return RegionShutdownThread.getWorldData();
|
||||
+ }*/ // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get();
|
||||
+ if (carrier == null) {
|
||||
+ return RegionShutdownThread.getWorldData();
|
||||
}
|
||||
- return tickThreadRunner.currentTickingWorldRegionizedData;
|
||||
+ // Luminol end
|
||||
+ return carrier.currentTickingWorldRegionizedData; // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,20 +170,32 @@ public final class TickRegionScheduler {
|
||||
* If this thread is not a TickThread, then returns {@code null}.
|
||||
*/
|
||||
public static ScheduledTaskThreadPool.SchedulableTick getCurrentTickingTask() {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
+ /*final Thread currThread = Thread.currentThread(); // Luminol - Per thread for tickregion
|
||||
if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
return null;
|
||||
+ }*/ // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get();
|
||||
+ if (carrier == null) {
|
||||
+ return null;
|
||||
}
|
||||
- return tickThreadRunner.currentTickingTask;
|
||||
+ // Luminol end
|
||||
+ return carrier.currentTickingTask;
|
||||
}
|
||||
|
||||
// Folia start - profiler
|
||||
public static ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle getProfiler() {
|
||||
- final Thread currThread = Thread.currentThread();
|
||||
- if (!(currThread instanceof TickThreadRunner tickThreadRunner)) {
|
||||
+ /*final Thread currThread = Thread.currentThread(); // Luminol - Per thread for tickregion
|
||||
+ if (!(currThread instanceof TickThreadRunner)) { // Luminol - Per thread for tickregion
|
||||
+ return ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE;
|
||||
+ }*/ // Luminol - Per thread for tickregion
|
||||
+ // Luminol start - Per thread for tickregion
|
||||
+ var carrier = PerThreadSchedulerPool.TickThreadRunnerDataCarrier.CARRIER_THREAD_LOCAL.get();
|
||||
+ if (carrier == null) {
|
||||
return ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle.NO_OP_HANDLE;
|
||||
}
|
||||
- return tickThreadRunner.profiler;
|
||||
+ // Luminol end
|
||||
+ return carrier.profiler; // Luminol - Per thread for tickregion
|
||||
}
|
||||
// Folia end - profiler
|
||||
|
||||
@@ -171,14 +222,14 @@ public final class TickRegionScheduler {
|
||||
public boolean halt(final boolean sync, final long maxWaitNS) {
|
||||
this.scheduler.halt();
|
||||
if (!sync) {
|
||||
- return this.scheduler.getAliveThreads().length == 0;
|
||||
+ return this.scheduler.getTotalThreadCount() == 0; // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
- return this.scheduler.join(maxWaitNS == 0L ? 0L : Math.max(1L, TimeUnit.NANOSECONDS.toMillis(maxWaitNS)));
|
||||
+ return this.scheduler.join(maxWaitNS == 0L ? 0L : Math.max(1L, maxWaitNS)); // Luminol - Per thread for tickregion
|
||||
}
|
||||
|
||||
void dumpAliveThreadTraces(final String reason) {
|
||||
- for (final Thread thread : this.scheduler.getAliveThreads()) {
|
||||
+ for (final Thread thread : this.scheduler.getAllAliveThreads()) { // Luminol - Per thread for tickregion
|
||||
if (thread.isAlive()) {
|
||||
TraceUtil.dumpTraceForThread(thread, reason);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Fri, 4 Apr 2025 08:17:32 +0800
|
||||
Subject: [PATCH] Correct isWatched method in ScheduledTaskThreadPool
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java b/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
index 2f61f72087ea07e8d29bf6d5c264e217b20eb377..3694b01f0dc04f6de2df1d926a9208f5711a3a8b 100644
|
||||
--- a/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
+++ b/io/papermc/paper/threadedregions/ScheduledTaskThreadPool.java
|
||||
@@ -1229,7 +1229,7 @@ public final class ScheduledTaskThreadPool {
|
||||
}
|
||||
|
||||
public boolean isWatched() {
|
||||
- return (boolean)TAKEN_HANDLE.getVolatile(this);
|
||||
+ return (boolean)WATCHED_HANDLE.getVolatile(this); // Luminol - Try fixing scheduling call issue
|
||||
}
|
||||
|
||||
public long getLastTaskNotify() {
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 11:00:49 +0800
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sat, 22 Mar 2025 17:36:44 +0800
|
||||
Subject: [PATCH] Force disable builtin spark plugin
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index ed00a29daccfee1d631bef27c0a3a4ae83140018..330af9f4de1c72387326816065350e71fe546efe 100644
|
||||
index 5d709b3b47702e7607dafa4a38380c801b228e2d..c2027b8d4a5f9fccacb93ba108e34c36285aec7b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -783,8 +783,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -65,7 +65,7 @@ index ed00a29daccfee1d631bef27c0a3a4ae83140018..330af9f4de1c72387326816065350e71
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent((int)region.getCurrentTick()).callEvent(); // Paper - Server Tick Events // Folia - region threading
|
||||
// Folia start - region threading
|
||||
if (region != null) {
|
||||
@@ -1743,7 +1744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1744,7 +1745,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long remaining = scheduledEnd - endTime; // Folia - region ticking
|
||||
new com.destroystokyo.paper.event.server.ServerTickEndEvent((int)io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick(), ((double)(endTime - startTime) / 1000000D), remaining).callEvent(); // Folia - region ticking
|
||||
// Paper end - Server Tick Events
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix uncorrected death check of folia
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 50af953a4698a3c6e16b840fab764dd733b3fbc9..a9c058238819f3631d94ac306185e909821caf35 100644
|
||||
index acca8c51d2030c675c157b10d0bbc6af631afe61..d0b688e69979c5e7b8267ac96bd71bcd33444c41 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -679,7 +679,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -689,7 +689,7 @@ public abstract class AbstractContainerMenu {
|
||||
}
|
||||
|
||||
private static void dropOrPlaceInInventory(Player player, ItemStack stack) {
|
||||
@@ -5,6 +5,25 @@ Subject: [PATCH] Fix a series issue around entity memory typed GlobalPos and
|
||||
WalkTarget
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
index a9be3acbf4ea52d2988347abfa6f4f8c02b1da26..751f3dde8e6bc2c0365e8672f5079af0379a69de 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
@@ -25,6 +25,14 @@ public class BabyFollowAdult {
|
||||
return false;
|
||||
} else {
|
||||
LivingEntity ageableMob = instance.get(nearestVisibleAdult); // CraftBukkit - type
|
||||
+
|
||||
+ // Luminol start - Fix off world entity following which caused async issue
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ageableMob)) {
|
||||
+ nearestVisibleAdult.erase();
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
+
|
||||
if (mob.closerThan(ageableMob, followRange.getMaxValue() + 1) && !mob.closerThan(ageableMob, followRange.getMinValue())) {
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(mob, ageableMob, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
index 2664d72c3b6906d0505df2e63c0e5075eba9461b..f03c3c512ea48c2a89eebae62484922d28e4f831 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sat, 22 Mar 2025 20:48:24 +0800
|
||||
Subject: [PATCH] Use the correct list length while generating tick report
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/TickData.java b/io/papermc/paper/threadedregions/TickData.java
|
||||
index 0383e4dcd611a7568597f46308060f3d7288a564..f53c37d047856f1569b6f637c54ebad03c42006e 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickData.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickData.java
|
||||
@@ -178,7 +178,8 @@ public final class TickData {
|
||||
} else {
|
||||
long totalTickTime = 0L;
|
||||
long totalCpuTime = 0L;
|
||||
- for (int k = 0, len2 = collapsedData.size(); k < len2; ++k) {
|
||||
+ //for (int k = 0, len2 = collapsedData.size(); k < len2; ++k) {
|
||||
+ for (int k = 0, len2 = toCollapse.size(); k < len2; ++k) { // Luminol - Use the correct list length
|
||||
final TickRegionScheduler.TickTime time = toCollapse.get(k);
|
||||
totalTickTime += time.tickLength();
|
||||
totalCpuTime += time.supportCPUTime() ? time.tickCpuTime() : 0L;
|
||||
@@ -0,0 +1,124 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sun, 23 Mar 2025 15:51:35 +0800
|
||||
Subject: [PATCH] Try rewriting update queue polling
|
||||
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ThreadedTicketLevelPropagator.java b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ThreadedTicketLevelPropagator.java
|
||||
index 310a8f80debadd64c2d962ebf83b7d0505ce6e42..59d77f04fd0f1c7b7af0314e533b72e1858a7e21 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ThreadedTicketLevelPropagator.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ThreadedTicketLevelPropagator.java
|
||||
@@ -151,6 +151,15 @@ public abstract class ThreadedTicketLevelPropagator {
|
||||
private boolean performUpdate(final Section section, final UpdateQueue.UpdateQueueNode node, final Propagator propagator,
|
||||
final ReentrantAreaLock ticketLock, final ReentrantAreaLock schedulingLock,
|
||||
final List<ChunkProgressionTask> scheduledTasks, final List<NewChunkHolder> changedFullStatus) {
|
||||
+ // Luminol - Try rewriting update queue polling
|
||||
+ if (section == null) {
|
||||
+ if (node != null) {
|
||||
+ this.updateQueue.remove(node);
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Luminol end
|
||||
+
|
||||
final int sectionX = section.sectionX;
|
||||
final int sectionZ = section.sectionZ;
|
||||
|
||||
@@ -334,6 +343,7 @@ public abstract class ThreadedTicketLevelPropagator {
|
||||
|
||||
// finished
|
||||
if (node != null) {
|
||||
+ node.releaseUpdating(); // Luminol - Try rewriting update queue polling
|
||||
this.updateQueue.remove(node);
|
||||
}
|
||||
|
||||
@@ -468,7 +478,8 @@ public abstract class ThreadedTicketLevelPropagator {
|
||||
}
|
||||
}
|
||||
|
||||
- public UpdateQueueNode acquireNextOrWait(final long maxOrder) {
|
||||
+ // Luminol start - Try rewriting update queue polling
|
||||
+ /*public UpdateQueueNode acquireNextOrWait(final long maxOrder) {
|
||||
final List<UpdateQueueNode> blocking = new ArrayList<>();
|
||||
|
||||
node_search:
|
||||
@@ -502,8 +513,63 @@ public abstract class ThreadedTicketLevelPropagator {
|
||||
await(blocking.get(0));
|
||||
}
|
||||
|
||||
+ return null;
|
||||
+ }*/
|
||||
+
|
||||
+ public UpdateQueueNode acquireNextOrWait(final long maxOrder) {
|
||||
+ UpdateQueueNode firstConflict = null;
|
||||
+ UpdateQueueNode prevProcessed = null;
|
||||
+
|
||||
+ for (UpdateQueueNode curr = this.getHeadAcquire(); curr != null && curr.order <= maxOrder; curr = curr.getNextVolatile()) {
|
||||
+ if (curr.getSectionVolatile() == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!curr.tryAcquireUpdating()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (curr.getSectionVolatile() == null) {
|
||||
+ curr.releaseUpdating();
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ boolean hasConflict = false;
|
||||
+ for (UpdateQueueNode checked = prevProcessed; checked != null; checked = checked.getNextVolatile()) {
|
||||
+ if (checked != curr && curr.intersects(checked)) {
|
||||
+ hasConflict = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (hasConflict) {
|
||||
+ if (firstConflict == null) {
|
||||
+ firstConflict = curr;
|
||||
+ }
|
||||
+ curr.releaseUpdating();
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (firstConflict != null) {
|
||||
+ this.append(firstConflict);
|
||||
+ }
|
||||
+
|
||||
+ if (prevProcessed == null) {
|
||||
+ prevProcessed = curr;
|
||||
+ } else {
|
||||
+ prevProcessed.setNextPlain(curr);
|
||||
+ }
|
||||
+
|
||||
+ return curr;
|
||||
+ }
|
||||
+
|
||||
+ if (firstConflict != null) {
|
||||
+ this.append(firstConflict);
|
||||
+ }
|
||||
+
|
||||
return null;
|
||||
}
|
||||
+ // Luminol end
|
||||
|
||||
public UpdateQueueNode peek() {
|
||||
for (UpdateQueueNode head = this.getHeadOpaque(), curr = head;;) {
|
||||
@@ -689,6 +755,15 @@ public abstract class ThreadedTicketLevelPropagator {
|
||||
private final boolean getAndSetUpdatingVolatile(final boolean value) {
|
||||
return (boolean)UPDATING_HANDLE.getAndSet(this, value);
|
||||
}
|
||||
+ // Luminol - Try rewriting update queue polling
|
||||
+ public final boolean tryAcquireUpdating() {
|
||||
+ return (boolean) UPDATING_HANDLE.compareAndSet(this, false, true);
|
||||
+ }
|
||||
+
|
||||
+ public final void releaseUpdating() {
|
||||
+ UPDATING_HANDLE.setVolatile(this, false);
|
||||
+ }
|
||||
+ // Luminol end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Kaiiju Entity tick and removal limiter
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||
index c6e487a4c14e6b82533881d01f32349b9ae28728..2c747cb8a724cd25c9d724908f92b320741600de 100644
|
||||
index b8f1f042342d3fed5fa26df0de07e8e2b0937130..4d9837f11da4dc59fdb945fdb4849c4d1519f5dc 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||
@@ -354,6 +354,7 @@ public final class RegionizedWorldData {
|
||||
@@ -358,6 +358,7 @@ public final class RegionizedWorldData {
|
||||
private final IteratorSafeOrderedReferenceSet<Mob> navigatingMobs = new IteratorSafeOrderedReferenceSet<>();
|
||||
public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
||||
public final ReferenceList<Entity> trackerUnloadedEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Purpur Use alternative keep alive
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99694c1683 100644
|
||||
index f7f89695f40e4aff39d324e6a7948a8a3a8c04b3..bceef2e8cd9a84ca32f17085839dff0232f2ee31 100644
|
||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -41,6 +41,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -16,7 +16,7 @@ index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99
|
||||
private int latency;
|
||||
private volatile boolean suspendFlushingOnServerThread = false;
|
||||
// CraftBukkit start
|
||||
@@ -130,6 +131,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -131,6 +132,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
|
||||
@Override
|
||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||
@@ -33,7 +33,7 @@ index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99
|
||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||
int i = (int)(Util.getMillis() - this.keepAliveTime);
|
||||
this.latency = (this.latency * 3 + i) / 4;
|
||||
@@ -250,7 +261,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -255,7 +266,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
|
||||
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
|
||||
final long elapsedTime = millis - this.keepAliveTime;
|
||||
@@ -57,7 +57,7 @@ index 6eca15223b92aedac74233db886e2c1248750e2c..7507f32b5f0f7fbbf35eeaaf03bf9d99
|
||||
if (this.keepAlivePending) {
|
||||
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
||||
this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
|
||||
@@ -263,6 +289,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -268,6 +294,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Purpur-Barrels-and-enderchests-6-rows
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 9bf6e8240bf15f08b037b18cfeae15ebb8ea934d..79e7fcb7949fbc8e3794d481e41d5164dea0b273 100644
|
||||
index 751b011701d6ae373099226ea63ffbafcd24ce6a..e5e946462da9e56344428139768075b7bd228ec0 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1103,6 +1103,10 @@ public abstract class PlayerList {
|
||||
@@ -20,7 +20,7 @@ index 9bf6e8240bf15f08b037b18cfeae15ebb8ea934d..79e7fcb7949fbc8e3794d481e41d5164
|
||||
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index ad34d0e1ab16fb269b3cec2842bfc2f2c29b452e..40b91234fd2e4f4f134d309590ea6b605f764e83 100644
|
||||
index ae049c5c3593525b991d865fec695c00ad408a59..c6252a245e9701f69db1fe167f6590095237553a 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -200,6 +200,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Leaf Remove useless creating stats json bases on player name
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 548f7a2b0b020ff7fff27396942cc0bc9e755afe..9bf6e8240bf15f08b037b18cfeae15ebb8ea934d 100644
|
||||
index e5e946462da9e56344428139768075b7bd228ec0..9777a5b7ba9916e426ba87d6ee7cd56f0e43c195 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1411,6 +1411,8 @@ public abstract class PlayerList {
|
||||
@@ -1420,6 +1420,8 @@ public abstract class PlayerList {
|
||||
if (serverStatsCounter == null) {
|
||||
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
|
||||
File file1 = new File(file, uuid + ".json");
|
||||
@@ -18,7 +18,7 @@ index 548f7a2b0b020ff7fff27396942cc0bc9e755afe..9bf6e8240bf15f08b037b18cfeae15eb
|
||||
if (!file1.exists()) {
|
||||
File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
||||
Path path = file2.toPath();
|
||||
@@ -1418,6 +1420,8 @@ public abstract class PlayerList {
|
||||
@@ -1427,6 +1429,8 @@ public abstract class PlayerList {
|
||||
file2.renameTo(file1);
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing teleportation apis for folia
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f69f19dcec 100644
|
||||
index b17ace9118c94a756fa2901621c6b2b9bd9e5764..8a728a3af515da522cd5fab1e731bbc0607f0596 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1653,6 +1653,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1660,6 +1660,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
if (respawnComplete != null) {
|
||||
respawnComplete.accept(ServerPlayer.this);
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Disable moved wrongly threshold
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60048c7231 100644
|
||||
index a107d9ee24d0e39ce3e3e09bf27af1ea4ae35b96..225045400f152a9a8f030d6fe367764b00d99b24 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -579,7 +579,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -581,7 +581,7 @@ public class ServerGamePacketListenerImpl
|
||||
return;
|
||||
}
|
||||
// Paper end - Prevent moving into unloaded chunks
|
||||
@@ -17,7 +17,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
|
||||
// CraftBukkit end
|
||||
LOGGER.warn(
|
||||
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
||||
@@ -609,7 +609,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -611,7 +611,7 @@ public class ServerGamePacketListenerImpl
|
||||
d5 = d2 - rootVehicle.getZ();
|
||||
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
boolean flag2 = false;
|
||||
@@ -26,7 +26,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
|
||||
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
||||
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
||||
}
|
||||
@@ -1434,7 +1434,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1437,7 +1437,7 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
if (this.shouldCheckPlayerMovement(isFallFlying)) {
|
||||
float f2 = isFallFlying ? 300.0F : 100.0F;
|
||||
@@ -35,7 +35,7 @@ index 4e3cb90558533ea7ca0c838745e91ec5860c11ce..9fc72689b5021d1de2e149c1dfe5fc60
|
||||
// CraftBukkit end
|
||||
// Paper start - Add fail move event
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
||||
@@ -1506,7 +1506,8 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1509,7 +1509,8 @@ public class ServerGamePacketListenerImpl
|
||||
d5 = d2 - this.player.getZ();
|
||||
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
boolean movedWrongly = false; // Paper - Add fail move event; rename
|
||||
@@ -93,10 +93,10 @@ index d9cc1d7e56c37d5ce92544edc10e89dbc89dd15d..39e7689be243b9c99b507d665f659135
|
||||
public EntityType(
|
||||
EntityType.EntityFactory<T> factory,
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2c29b452e 100644
|
||||
index c6252a245e9701f69db1fe167f6590095237553a..40b91234fd2e4f4f134d309590ea6b605f764e83 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -210,6 +210,25 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -211,6 +211,25 @@ public abstract class Player extends LivingEntity {
|
||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -122,7 +122,7 @@ index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2
|
||||
|
||||
public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
|
||||
super(EntityType.PLAYER, level);
|
||||
@@ -262,6 +281,26 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -263,6 +282,26 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -149,7 +149,7 @@ index ae049c5c3593525b991d865fec695c00ad408a59..ad34d0e1ab16fb269b3cec2842bfc2f2
|
||||
this.noPhysics = this.isSpectator();
|
||||
if (this.isSpectator() || this.isPassenger()) {
|
||||
this.setOnGround(false);
|
||||
@@ -1504,6 +1543,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1505,6 +1544,7 @@ public abstract class Player extends LivingEntity {
|
||||
if (this.containerMenu != null && this.hasContainerOpen()) {
|
||||
this.doCloseContainer();
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Fri, 11 Apr 2025 16:53:57 +0800
|
||||
Subject: [PATCH] Leaves-Revert-raid-changes
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||
index 80f17f33f670018240c854df589cf90cdeab6e70..8672757a4d5fb5c247599782fece6b8d7d6ec921 100644
|
||||
--- a/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||
+++ b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||
@@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect {
|
||||
&& !serverPlayer.isSpectator()
|
||||
&& level.getDifficulty() != Difficulty.PEACEFUL
|
||||
&& level.isVillage(serverPlayer.blockPosition())) {
|
||||
+ // Leaves start - Revert raid changes
|
||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.trigger) {
|
||||
+ return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null;
|
||||
+ }
|
||||
+ // Leaves end - Revert raid changes
|
||||
Raid raidAt = level.getRaidAt(serverPlayer.blockPosition());
|
||||
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
|
||||
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
|
||||
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
||||
index 2f45befbb50645f1bfb5961ad725f3670ff0d592..84c6eb2c27510938f590f6c6baa5a94c4c08c4ad 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -674,7 +674,7 @@ public class Raid {
|
||||
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
|
||||
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f);
|
||||
int height = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
|
||||
- if (Mth.abs(height - this.center.getY()) <= 96) {
|
||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.height_check || Mth.abs(height - this.center.getY()) <= 96) { // Disable height check
|
||||
mutableBlockPos.set(i2, height, i3);
|
||||
if (!this.level.isVillage(mutableBlockPos) || i <= 7) {
|
||||
int i4 = 10;
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index 7c385baae81b9a987c0e1e4deb017884600331bc..a0d86c3cc86da734a3cd10d554aaecb5c0b82e59 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -125,6 +125,43 @@ public abstract class Raider extends PatrollingMonster {
|
||||
|
||||
currentRaid.removeFromRaid(this, false);
|
||||
}
|
||||
+
|
||||
+ // Leaves start - Revert raid changes
|
||||
+ if (this.level() instanceof ServerLevel serverLevel) {
|
||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.effect && !this.hasRaid()) {
|
||||
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
+ net.minecraft.world.entity.player.Player entityhuman = null;
|
||||
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
||||
+ entityhuman = player;
|
||||
+ } else if (entity instanceof net.minecraft.world.entity.animal.Wolf wolf) {
|
||||
+ LivingEntity entityliving = wolf.getOwner();
|
||||
+ if (wolf.isTame() && entityliving instanceof net.minecraft.world.entity.player.Player player) {
|
||||
+ entityhuman = player;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (entityhuman != null && !itemstack.isEmpty() && this.isCaptain()) {
|
||||
+ net.minecraft.world.effect.MobEffectInstance mobeffect = entityhuman.getEffect(net.minecraft.world.effect.MobEffects.BAD_OMEN);
|
||||
+ int i = 1;
|
||||
+
|
||||
+ if (mobeffect != null) {
|
||||
+ i += mobeffect.getAmplifier();
|
||||
+ entityhuman.removeEffectNoUpdate(net.minecraft.world.effect.MobEffects.BAD_OMEN);
|
||||
+ } else {
|
||||
+ --i;
|
||||
+ }
|
||||
+
|
||||
+ i = net.minecraft.util.Mth.clamp(i, 0, 4);
|
||||
+ net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, i, false, false, true);
|
||||
+
|
||||
+ if (!serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_DISABLE_RAIDS)) {
|
||||
+ entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit
|
||||
+ }
|
||||
+ this.setPatrolLeader(false);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - Revert raid changes
|
||||
}
|
||||
|
||||
super.die(cause);
|
||||
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
index 318f24d67be4daf6993ba547da0540be9c221a75..9a6820fce3977419fd81d802720c318ac15d07c4 100644
|
||||
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
||||
@@ -28,7 +28,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
||||
|
||||
@Override
|
||||
public void onConsume(Level level, LivingEntity entity, ItemStack stack, Consumable consumable) {
|
||||
- entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
||||
+ entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
||||
}
|
||||
|
||||
// Paper start - properly resend entities - collect packets for bundle
|
||||
@@ -40,7 +40,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
||||
|
||||
@Override
|
||||
public void addToTooltip(Item.TooltipContext context, Consumer<Component> tooltipAdder, TooltipFlag tooltipFlag) {
|
||||
- List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true));
|
||||
+ List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true));
|
||||
PotionContents.addPotionTooltip(list, tooltipAdder, 1.0F, context.tickRate());
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -108,6 +_,7 @@
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
+ me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol config
|
||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -212,6 +_,8 @@
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
+ me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); //Luminol - load config file
|
||||
+ me.earthme.luminol.config.LuminolConfig.setupLatch(); //Luminol - load config file
|
||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Tue, 11 Feb 2025 11:57:22 +0800
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sat, 22 Mar 2025 09:24:55 +0800
|
||||
Subject: [PATCH] Add tpsbar with chunkhot membar and region bar
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ index de8b9048c8395c05b8688bc9d984b8ad680f15b3..f42692cd4f0154705c3d5b030d281cfc
|
||||
+ // KioCG end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index c9afcd46f6a1b74b82ed68f1df6188369cf53a73..7cb95021f547c94eae7cef0bf5b2d8dff0a04937 100644
|
||||
index 512ef437119041b33b62ef4675bdd1b27fd9a403..628211a282ef0553a0229b6cadacd2727d967873 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2404,6 +2404,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2442,6 +2442,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
handle.expToDrop = data.getInt("expToDrop");
|
||||
handle.keepLevel = data.getBoolean("keepLevel");
|
||||
}
|
||||
@@ -41,7 +41,7 @@ index c9afcd46f6a1b74b82ed68f1df6188369cf53a73..7cb95021f547c94eae7cef0bf5b2d8df
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2425,6 +2434,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2463,6 +2472,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
data.putLong("lastPlayed", System.currentTimeMillis());
|
||||
data.putString("lastKnownName", handle.getScoreboardName());
|
||||
|
||||
@@ -57,9 +57,9 @@ index c9afcd46f6a1b74b82ed68f1df6188369cf53a73..7cb95021f547c94eae7cef0bf5b2d8df
|
||||
// Paper start - persist for use in offline save data
|
||||
if (!nbttagcompound.contains("Paper")) {
|
||||
nbttagcompound.put("Paper", new CompoundTag());
|
||||
@@ -3618,4 +3636,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setDeathScreenScore(final int score) {
|
||||
getHandle().setScore(score);
|
||||
@@ -3672,4 +3690,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setSimplifyContainerDesyncCheck(final boolean simplifyContainerDesyncCheck) {
|
||||
this.simplifyContainerDesyncCheck = simplifyContainerDesyncCheck;
|
||||
}
|
||||
+
|
||||
+ // KioCG start - ChunkHot
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <mrhua269@gmail.com>
|
||||
Date: Sun, 6 Apr 2025 12:51:21 +0800
|
||||
Subject: [PATCH] Add feature: per virtual thread per tickregion
|
||||
|
||||
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
||||
index 4efa1c057ae6cfdea7889c372bd62dc14637daa0..061492a0e172e03a0f78e4bbbec1c7010d51e207 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
||||
@@ -18,6 +18,9 @@ import org.slf4j.LoggerFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class TickThread extends Thread {
|
||||
+ // Luminol start - Bypass virtual threads
|
||||
+ public static final java.util.Set<Thread> VIRTUAL_TICK_THREAD_GROUP = java.util.Collections.newSetFromMap(it.unimi.dsi.fastutil.objects.Reference2ObjectMaps.synchronize(new it.unimi.dsi.fastutil.objects.Reference2ObjectLinkedOpenHashMap<>()));
|
||||
+ // Luminol end
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TickThread.class);
|
||||
|
||||
@@ -138,12 +141,13 @@ public class TickThread extends Thread {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
+ @Deprecated // Luminol
|
||||
public static TickThread getCurrentTickThread() {
|
||||
return (TickThread)Thread.currentThread();
|
||||
}
|
||||
|
||||
public static boolean isTickThread() {
|
||||
- return Thread.currentThread() instanceof TickThread;
|
||||
+ return Thread.currentThread() instanceof TickThread || VIRTUAL_TICK_THREAD_GROUP.contains(Thread.currentThread()); // Luminol - Bypass some virtual threads
|
||||
}
|
||||
|
||||
public static boolean isShutdownThread() {
|
||||
@@ -18,7 +18,7 @@ index a0b84535a9d3833d4df692b85b272f145559dd80..c2ba46408b5ad727d7a17f21d47b2898
|
||||
return;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 09853a5035a6cb2f9efa20a68644038f11065a9d..00b3db1c0c449e77cd365c70d0ce044c56b2dcf7 100644
|
||||
index 1a1d44c2aa89d8c7f9ec431b5b04d4c6e93a9d55..98d7542ead38ce48886c8f8dfe9a89f963d0c3fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -314,7 +314,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] SparklyPaper Optimize canSee checks
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 3e4e0dcdd4e2808aef8dd41f159a358f47450f40..450350e66ae42f234bfd3016da1434e3194259e2 100644
|
||||
index 628211a282ef0553a0229b6cadacd2727d967873..583c2acc6d620b4411c65c2b285d323d7c9c1b98 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -214,7 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -210,7 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private boolean hasPlayedBefore = false;
|
||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||
private final Set<String> channels = new HashSet<String>();
|
||||
@@ -17,7 +17,7 @@ index 3e4e0dcdd4e2808aef8dd41f159a358f47450f40..450350e66ae42f234bfd3016da1434e3
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||
private int hash = 0;
|
||||
@@ -2268,9 +2268,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2306,9 +2306,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||
@@ -23,7 +23,7 @@ index f42692cd4f0154705c3d5b030d281cfc333803ed..39cc976f65f826a00e2e637c139f9134
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 00b3db1c0c449e77cd365c70d0ce044c56b2dcf7..4e9248980ee7400d856dc30792197468559bfe9b 100644
|
||||
index 98d7542ead38ce48886c8f8dfe9a89f963d0c3fd..4cf38c929e6ccce7f25ed842d65e41913d49ccf6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1423,7 +1423,11 @@ public final class CraftServer implements Server {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Tick regions api
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 82d26889661a944e057be0c450fb5a296122ea8e..4f320a91fb8abe21cbb7b01fdc34330def5b2448 100644
|
||||
index cd6e46fa68c009deb8dfebcecb88e058dfede0b0..ac4ab407095d998b1418d740ab54e8157bce6a02 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2517,4 +2517,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -0,0 +1,23 @@
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandDataConfig.java
|
||||
@@ -1,0 +_,20 @@
|
||||
+package me.earthme.luminol.config.modules.experiment;
|
||||
+
|
||||
+import me.earthme.luminol.config.ConfigInfo;
|
||||
+import me.earthme.luminol.config.EnumConfigCategory;
|
||||
+import me.earthme.luminol.config.IConfigModule;
|
||||
+
|
||||
+public class CommandDataConfig implements IConfigModule {
|
||||
+ @ConfigInfo(baseName = "enable")
|
||||
+ public static boolean enabled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.EXPERIMENT;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "force_the_data_command_to_be_enabled";
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,44 @@
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/RaidChangesConfig.java
|
||||
@@ -1,0 +_,41 @@
|
||||
+package me.earthme.luminol.config.modules.misc;
|
||||
+
|
||||
+import me.earthme.luminol.config.ConfigInfo;
|
||||
+import me.earthme.luminol.config.EnumConfigCategory;
|
||||
+import me.earthme.luminol.config.IConfigModule;
|
||||
+
|
||||
+public class RaidChangesConfig implements IConfigModule {
|
||||
+ @ConfigInfo(baseName = "allow-bad-omen-trigger-raid", comments =
|
||||
+ """
|
||||
+ Allow players with ominous signs to\s
|
||||
+ skip a 30-second cooldown and trigger\s
|
||||
+ attacks directly""")
|
||||
+ public static boolean trigger = false;
|
||||
+
|
||||
+ @ConfigInfo(baseName = "give-bad-omen-when-kill-patrol-leader", comments =
|
||||
+ """
|
||||
+ Enable players to obtain an ominous\s
|
||||
+ omen effect when killing the patrol\s
|
||||
+ team captain""")
|
||||
+ public static boolean effect = false;
|
||||
+
|
||||
+ @ConfigInfo(baseName = "bad-omen-infinite", comments =
|
||||
+ """
|
||||
+ Enable bad omen effect infinite time.""")
|
||||
+ public static boolean infinite = false;
|
||||
+
|
||||
+ @ConfigInfo(baseName = "skip-height-check", comments =
|
||||
+ """
|
||||
+ disable y <= 96 check.""")
|
||||
+ public static boolean height_check = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.MISC;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "revert-raid-changes";
|
||||
+ }
|
||||
+}
|
||||
@@ -11,13 +11,10 @@ grdversion=$(prop version)
|
||||
preVersion=$(prop preVersion)
|
||||
release_tag="$mcversion-$commitid"
|
||||
jarName="$project_id-$mcversion-paperclip.jar"
|
||||
jarName_bundler="$project_id-$mcversion-bundler.jar"
|
||||
jarName_dir="luminol-server/build/libs/$jarName"
|
||||
jarName_bundler_dir="luminol-server/build/libs/$jarName_bundler"
|
||||
make_latest=$([ $preVersion = "true" ] && echo "false" || echo "true")
|
||||
|
||||
mv luminol-server/build/libs/$project_id-paperclip-$grdversion-mojmap.jar $jarName_dir
|
||||
mv luminol-server/build/libs/$project_id-bundler-$grdversion-mojmap.jar $jarName_bundler_dir
|
||||
|
||||
echo "project_id=$project_id" >> $GITHUB_ENV
|
||||
echo "project_id_b=$project_id_b" >> $GITHUB_ENV
|
||||
@@ -28,5 +25,4 @@ echo "pre=$preVersion" >> $GITHUB_ENV
|
||||
echo "tag=$release_tag" >> $GITHUB_ENV
|
||||
echo "jar=$jarName" >> $GITHUB_ENV
|
||||
echo "jar_dir=$jarName_dir" >> $GITHUB_ENV
|
||||
echo "jar_dir_bundler=$jarName_bundler_dir" >> $GITHUB_ENV
|
||||
echo "make_latest=$make_latest" >> $GITHUB_ENV
|
||||
|
||||
Reference in New Issue
Block a user