更新上游paper分支
All checks were successful
Java CI-CD with Gradle / build (push) Successful in 14m19s

完善readme文档
This commit is contained in:
zhangyuheng 2024-05-01 11:51:55 +08:00
parent 207146d42d
commit 5a5d7b0bc2
9 changed files with 36 additions and 76 deletions

View File

@ -2,13 +2,8 @@ name: Java CI-CD with Gradle
on: on:
push: push:
paths: tags:
- 'patches/**' - '*'
- 'gradle.properties'
- 'gradle/wrapper/gradle-wrapper.properties'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- '.gitea/**'
jobs: jobs:
build: build:
@ -43,6 +38,7 @@ jobs:
- name: "Release" - name: "Release"
uses: https://ssl.lunadeer.cn:14446/zhangyuheng/release-action@main uses: https://ssl.lunadeer.cn:14446/zhangyuheng/release-action@main
with: with:
note: "请下载 `DeerFolia-paperclip-xxx.jar` 前缀的版本。"
files: |- files: |-
staging/*.jar staging/*.jar
api_key: '${{secrets.RELEASE_TOKEN}}' api_key: '${{secrets.RELEASE_TOKEN}}'

View File

@ -14,10 +14,6 @@ DeerFolia 是一个基于 [Folia](https://papermc.io/software/folia) 的 Minecra
- 还原了 [虚空交易](patches/server/0002-Allow-void-trading.patch) - 还原了 [虚空交易](patches/server/0002-Allow-void-trading.patch)
- 还原了 [刷沙机制](patches/server/0003-Sand-duplication.patch) - 还原了 [刷沙机制](patches/server/0003-Sand-duplication.patch)
## 更新上游 Folia 修改
1. 在终端执行 `./gradlew updateFoliaRef` 更新上游 Folia 修改;
## 将补丁应用到 Folia 源码 ## 将补丁应用到 Folia 源码
1. 在终端执行 `./gradlew applyPatches` 应用补丁; 1. 在终端执行 `./gradlew applyPatches` 应用补丁;
@ -49,11 +45,11 @@ DeerFolia 是一个基于 [Folia](https://papermc.io/software/folia) 的 Minecra
1. 在 `deer-folia-server``deer-folia-api` 目录中执行 `git rebase -i base` 1. 在 `deer-folia-server``deer-folia-api` 目录中执行 `git rebase -i base`
,应该会输出 [这样的](https://gist.github.com/zachbr/21e92993cb99f62ffd7905d7b02f3159) 内容。 ,应该会输出 [这样的](https://gist.github.com/zachbr/21e92993cb99f62ffd7905d7b02f3159) 内容。
2. 将你需要修改的补丁由 `pick` 替换为 `edit` 然后保存退出; 2. 将你需要修改的补丁由 `pick` 替换为 `edit` 然后保存退出;
- 一次只能修改 **一个** 文件! - 一次只能修改 **一个** 文件!
3. 对你需要修改的补丁作出新的修改; 3. 对你需要修改的补丁作出新的修改;
4. 使用 `git add .` 添加补丁,再使用 `git commit --amend` 提交; 4. 使用 `git add .` 添加补丁,再使用 `git commit --amend` 提交;
- **确保添加了 `--amend` 选项** 否则将会创建一个新补丁而不是修改原补丁。 - **确保添加了 `--amend` 选项** 否则将会创建一个新补丁而不是修改原补丁。
- 此处提交时也可以修改补丁信息。 - 此处提交时也可以修改补丁信息。
5. 终端执行 `git rebase --continue` 应用更新; 5. 终端执行 `git rebase --continue` 应用更新;
6. 再在跟项目目录执行 `./gradlew rebuildPatches` 生成新的补丁; 6. 再在跟项目目录执行 `./gradlew rebuildPatches` 生成新的补丁;
@ -69,16 +65,23 @@ DeerFolia 是一个基于 [Folia](https://papermc.io/software/folia) 的 Minecra
2. 提交修改(可以不写提交内容); 2. 提交修改(可以不写提交内容);
3. 在 `deer-folia-server``deer-folia-api` 目录中执行 `git rebase -i base` ,将刚才的提交移动到你想要修改的补丁提交下方; 3. 在 `deer-folia-server``deer-folia-api` 目录中执行 `git rebase -i base` ,将刚才的提交移动到你想要修改的补丁提交下方;
4. 将新提交的 `pick` 修改为如下内容: 4. 将新提交的 `pick` 修改为如下内容:
- `f`/`fixup`:将你的新修改合并到补丁内,但不改变补丁信息; - `f`/`fixup`:将你的新修改合并到补丁内,但不改变补丁信息;
- `s`/`squash`:将你的新修改合并到补丁内,并用新的补丁信息替换原补丁信息; - `s`/`squash`:将你的新修改合并到补丁内,并用新的补丁信息替换原补丁信息;
5. 在跟项目目录执行 `./gradlew rebuildPatches` 应用补丁更新; 5. 在跟项目目录执行 `./gradlew rebuildPatches` 应用补丁更新;
#### 自动 #### 自动
1. 修改相应位置源码; 1. 修改相应位置源码;
2. 提交修改内容 `git commit -a --fixup <要修改的补丁 hash 值>` 2. 提交修改内容 `git commit -a --fixup <要修改的补丁 hash 值>`
- 如果希望更新补丁信息,你可以使用 `--squash` 替换 `--fixup` - 如果希望更新补丁信息,你可以使用 `--squash` 替换 `--fixup`
- 如果你不知道要修改的补丁 hash 值,你可以使用 `git log` 查看; - 如果你不知道要修改的补丁 hash 值,你可以使用 `git log` 查看;
- 如果你只知道补丁的名称,你可以使用 `git log --grep=<补丁名称>` 查看; - 如果你只知道补丁的名称,你可以使用 `git log --grep=<补丁名称>` 查看;
3. 执行 `git rebase -i --autosquash base` ,这将会自动将你的修改移动到对应的补丁下方; 3. 执行 `git rebase -i --autosquash base` ,这将会自动将你的修改移动到对应的补丁下方;
4. 在跟项目目录执行 `./gradlew rebuildPatches` 应用补丁更新; 4. 在跟项目目录执行 `./gradlew rebuildPatches` 应用补丁更新;
## 更新上游 Folia 修改
1. 在终端执行 `./gradlew updateFoliaRef` 更新上游 Folia 修改;
2. 应用更新的补丁:`./gradlew applyPatches`。
3. 如果存在冲突,解决冲突,然后运行 `git am --continue` 继续应用补丁;
4. 全部补丁应用完成后,更新补丁:`./gradlew rebuildPatches`。

View File

@ -3,7 +3,7 @@ import io.papermc.paperweight.util.*
plugins { plugins {
java java
id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.11" id("io.papermc.paperweight.patcher") version "1.5.12"
} }
allprojects { allprojects {

View File

@ -2,7 +2,7 @@ group = cn.lunadeer
version = 1.20.4-R0.1-SNAPSHOT version = 1.20.4-R0.1-SNAPSHOT
mcVersion = 1.20.4 mcVersion = 1.20.4
foliaRef = e97b1eee63b802568447d344bac5a66bf90c6c71 foliaRef = 25ee657a8290530812f5f93f62d48df541a02ccf
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -1,6 +1,6 @@
#Mon Feb 26 15:32:38 CST 2024 #Mon Feb 26 15:32:38 CST 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.5-bin.zip distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Rebranding
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 08d434023226af0d2c469055a3b2188fe8a4ed38..0e9e28445f0673f39120e50fd9c80ad0d75f4eac 100644 index 12f9f9d46c098c5c88058cb1f73ae39a7d1debd5..caf0bb80ab3b694d9a80a6044d2c43c4245a574a 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating @@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
@ -17,7 +17,7 @@ index 08d434023226af0d2c469055a3b2188fe8a4ed38..0e9e28445f0673f39120e50fd9c80ad0
implementation("io.papermc.paper:paper-mojangapi:${project.version}") { implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
exclude("io.papermc.paper", "paper-api") exclude("io.papermc.paper", "paper-api")
} }
@@ -74,7 +74,7 @@ tasks.jar { @@ -75,7 +75,7 @@ tasks.jar {
attributes( attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main", "Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit", "Implementation-Title" to "CraftBukkit",
@ -117,7 +117,7 @@ index 99c5038672b09d0874125e3df280174c1e8151e6..f44fbef4372b3c6ba3e1e6f81de469b2
stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now())); stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now()));
stringbuilder.append("\n"); stringbuilder.append("\n");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3ec07e77748ee9bb21f9d09230f935bca2217e4d..ef7f77b4643a83ae241f8bb91e2b41bbd4fa6470 100644 index 453bb595d31c6dea1cfb135f43ffe71e4ae44112..d7340fe97da3e0b0f1b8e83ba102047497d6676b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1025,7 +1025,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1025,7 +1025,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -130,7 +130,7 @@ index 3ec07e77748ee9bb21f9d09230f935bca2217e4d..ef7f77b4643a83ae241f8bb91e2b41bb
this.getRunningThread().stop(); this.getRunningThread().stop();
try { try {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 853afba9d0a814acc001ba5db5ef3653f8b16392..15ecf9e10cce687536b7aa134390263cd90e5a53 100644 index 9dd9e86a5f7f30ce37b906ebfe4bccad0e52577f..1d603ae9559152ee7ebe30f12ac012e440b4db73 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper @@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
@ -143,10 +143,10 @@ index 853afba9d0a814acc001ba5db5ef3653f8b16392..15ecf9e10cce687536b7aa134390263c
private final String bukkitVersion = Versioning.getBukkitVersion(); private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft"); private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 6abb7ee0f5d32613b2ff7da09810ae407e293838..bcf0813afaa4fcbd66a39f1db14317e53de11f97 100644 index ee1d3f33cf5f3cfc7909dbc33178df69bd656ab8..6b54d70cc35ce72cc00392233528e680ee296754 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -961,7 +961,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -977,7 +977,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return EntityCategory.WATER; return EntityCategory.WATER;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Allow void trading
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ec25610cbffe30fecaeaadf9098e187bc15b5405..1de531dcb0d5c64a5459d9057b50fadcd9089b87 100644 index 36f1af9ef5fca7c45f250470d21a4dfbf573ceac..2eea25d4912f6b88f1a5febc4227ccf6ce4158fb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -3044,10 +3044,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -3057,10 +3057,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end // Spigot end
// Spigot Start // Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Sand duplication
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0725386d7ef47171012671725ceddfe92b43b203..2ac4b3e55be9aa6d6a6e717d887bcb06c0a13e7b 100644 index 1119b6a7f307763c13ef48bcd7643539082aebdc..4db9cb498104a6b3845828991b9a6ea03ac3194a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4046,6 +4046,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4065,6 +4065,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
protected boolean tryEndPortal() { protected boolean tryEndPortal() {
io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot portal entity async"); io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
@ -16,7 +16,7 @@ index 0725386d7ef47171012671725ceddfe92b43b203..2ac4b3e55be9aa6d6a6e717d887bcb06
BlockPos pos = this.portalBlock; BlockPos pos = this.portalBlock;
ServerLevel world = this.portalWorld; ServerLevel world = this.portalWorld;
this.portalBlock = null; this.portalBlock = null;
@@ -4131,12 +4132,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4150,12 +4151,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
targetPos, 16, // load 16 blocks to be safe from block physics targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH, ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH,
(chunks) -> { (chunks) -> {
@ -36,7 +36,7 @@ index 0725386d7ef47171012671725ceddfe92b43b203..2ac4b3e55be9aa6d6a6e717d887bcb06
); );
} }
); );
@@ -4324,6 +4330,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4343,6 +4349,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return false; return false;
} }
@ -49,7 +49,7 @@ index 0725386d7ef47171012671725ceddfe92b43b203..2ac4b3e55be9aa6d6a6e717d887bcb06
Vec3 initialPosition = this.position(); Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos( ChunkPos initialPositionChunk = new ChunkPos(
io.papermc.paper.util.CoordinateUtils.getChunkX(initialPosition), io.papermc.paper.util.CoordinateUtils.getChunkX(initialPosition),
@@ -4381,7 +4393,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4400,7 +4412,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// place // place
passengerTree.root.placeInAsync( passengerTree.root.placeInAsync(
originWorld, destination, Entity.TELEPORT_FLAG_LOAD_CHUNK | (takePassengers ? Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS : 0L), originWorld, destination, Entity.TELEPORT_FLAG_LOAD_CHUNK | (takePassengers ? Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS : 0L),
@ -58,47 +58,8 @@ index 0725386d7ef47171012671725ceddfe92b43b203..2ac4b3e55be9aa6d6a6e717d887bcb06
); );
}); });
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 05b77bf1af82397c542fde19b54ee545448ce12e..86ebd1de78ffe31959035beadb41c802abd94107 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -132,11 +132,13 @@ public class FallingBlockEntity extends Entity {
@Override
public void tick() {
+ // DeerFolia start - Sand duplication
// Paper start - fix sand duping
- if (this.isRemoved()) {
- return;
- }
+ // if (this.isRemoved()) {
+ // return;
+ // }
// Paper end - fix sand duping
+ // DeerFolia end - Sand duplication
if (this.blockState.isAir()) {
this.discard();
} else {
@@ -148,12 +150,14 @@ public class FallingBlockEntity extends Entity {
}
this.move(MoverType.SELF, this.getDeltaMovement());
+ // DeerFolia Sand duplication
// Paper start - fix sand duping
- if (this.isRemoved()) {
- return;
- }
+ // if (this.isRemoved()) {
+ // return;
+ // }
// Paper end - fix sand duping
// Paper start - Configurable falling blocks height nerf
+ // DeerFolia end - Sand duplication
if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.spawnAtLocation(block);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index a0c1db8cfebaa0344012cc0af18d6231cdcdcbb8..fc9abf46b9da83255c6a30fc4e38cf09e297ee2f 100644 index afc9445941b984cc1122839e4a8a17cf27aa966e..d81fbb3a7911b06d8726c7aa2ddbb276fe541023 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java --- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -61,6 +61,13 @@ public class EndPortalBlock extends BaseEntityBlock { @@ -61,6 +61,13 @@ public class EndPortalBlock extends BaseEntityBlock {

View File

@ -6,7 +6,7 @@ pluginManagement {
} }
plugins { plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
} }
rootProject.name = "DeerFolia" rootProject.name = "DeerFolia"