fix: introduced two patches from leaves to fix some bugs
update [Fix Incorrect Collision Behavior for Block Shape] to [Configurable collision behavior] fix chunk reload detector 20250604 23:22:57 UTC+8: use BLOCK_SHAPE_VANILLA as default instead of PAPER
This commit is contained in:
22
.github/workflows/build_1.21.5.yml
vendored
22
.github/workflows/build_1.21.5.yml
vendored
@@ -19,8 +19,8 @@ jobs:
|
|||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: zulu
|
||||||
java-version: '22'
|
java-version: 22
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
@@ -28,17 +28,16 @@ jobs:
|
|||||||
- name: Configure Git User Details
|
- name: Configure Git User Details
|
||||||
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
|
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
|
||||||
|
|
||||||
- name: Apply Patches
|
- name: Apply All Patches
|
||||||
run: ./gradlew applyAllPatches
|
run: ./gradlew applyAllPatches
|
||||||
|
|
||||||
- name: CreateJar
|
- name: CreateMojmapPaperclipJar
|
||||||
run: ./gradlew createMojmapPaperclipJar
|
run: ./gradlew createMojmapPaperclipJar
|
||||||
|
|
||||||
- name: Publish to repo
|
- name: Publish to repo
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: ./gradlew generateDevelopmentBundle publish -PpublishDevBundle=true
|
||||||
./gradlew generateDevelopmentBundle publish -PpublishDevBundle=true
|
|
||||||
env:
|
env:
|
||||||
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
|
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
|
||||||
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
|
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
|
||||||
@@ -46,8 +45,8 @@ jobs:
|
|||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ env.project_id_b }} CI Artifacts"
|
name: ${{ env.project_id_b }} CI Artifacts
|
||||||
path: "luminol-server/build/libs/*-paperclip-*-mojmap.jar"
|
path: luminol-server/build/libs/*-paperclip-*-mojmap.jar
|
||||||
|
|
||||||
- name: SetENV
|
- name: SetENV
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
@@ -64,9 +63,8 @@ jobs:
|
|||||||
This release is automatically compiled by GitHub Actions
|
This release is automatically compiled by GitHub Actions
|
||||||
### Commit Message
|
### Commit Message
|
||||||
${{ env.commit_msg }}
|
${{ env.commit_msg }}
|
||||||
artifacts: |
|
artifacts: ${{ env.jar_dir }}
|
||||||
${{ env.jar_dir }}
|
|
||||||
generateReleaseNotes: true
|
generateReleaseNotes: true
|
||||||
prerelease: false
|
prerelease: ${{ env.pre }}
|
||||||
makeLatest: ${{ env.make_latest }}
|
makeLatest: ${{ env.make_latest }}
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 4 Jun 2025 12:51:07 +0800
|
||||||
|
Subject: [PATCH] Leaves: Configurable collision behavior
|
||||||
|
|
||||||
|
Co-authored by: Fortern <blueten.ki@gmail.com>
|
||||||
|
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/c5f18b7864206cea4411211b51787f10affbcb9c/leaves-server/minecraft-patches/features/0111-Configurable-collision-behavior.patch)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
index e1bf7bc3cca63101b3c0550b5b4c0d28d0f3776e..d753d550b1df88ad9f2315ec3fc8f342be183c6d 100644
|
||||||
|
--- a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
+++ b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
@@ -101,6 +101,14 @@ public final class CollisionUtil {
|
||||||
|
(box1.minZ - box2.maxZ) < -COLLISION_EPSILON && (box1.maxZ - box2.minZ) > COLLISION_EPSILON;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - Configurable collision behavior
|
||||||
|
+ public static boolean voxelShapeIntersectVanilla(final AABB box1, final AABB box2) {
|
||||||
|
+ return box1.minX < box2.maxX && box1.maxX > box2.minX &&
|
||||||
|
+ box1.minY < box2.maxY && box1.maxY > box2.minY &&
|
||||||
|
+ box1.minZ < box2.maxZ && box1.maxZ > box2.minZ;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - Configurable collision behavior
|
||||||
|
+
|
||||||
|
// assume !isEmpty(target) && abs(source_move) >= COLLISION_EPSILON
|
||||||
|
public static double collideX(final AABB target, final AABB source, final double source_move) {
|
||||||
|
if ((source.minY - target.maxY) < -COLLISION_EPSILON && (source.maxY - target.minY) > COLLISION_EPSILON &&
|
||||||
|
@@ -2025,7 +2033,7 @@ public final class CollisionUtil {
|
||||||
|
AABB singleAABB = ((CollisionVoxelShape)blockCollision).moonrise$getSingleAABBRepresentation();
|
||||||
|
if (singleAABB != null) {
|
||||||
|
singleAABB = singleAABB.move((double)blockX, (double)blockY, (double)blockZ);
|
||||||
|
- if (!voxelShapeIntersect(aabb, singleAABB)) {
|
||||||
|
+ if (shouldSkip(aabb, blockCollision, singleAABB)) { // Leaves - Configurable collision behavior
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2078,6 +2086,18 @@ public final class CollisionUtil {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - Configurable collision behavior
|
||||||
|
+ private static boolean shouldSkip(AABB aabb, VoxelShape blockCollision, AABB singleAABB) {
|
||||||
|
+ boolean isBlockShape = blockCollision == Shapes.block();
|
||||||
|
+ return switch (me.earthme.luminol.config.modules.misc.CollisionBehaviorConfig.behaviorMode) {
|
||||||
|
+ case "VANILLA" -> !voxelShapeIntersectVanilla(aabb, singleAABB);
|
||||||
|
+ case "PAPER" -> !voxelShapeIntersect(aabb, singleAABB);
|
||||||
|
+ default -> isBlockShape && !voxelShapeIntersectVanilla(aabb, singleAABB) || !isBlockShape && !voxelShapeIntersect(aabb, singleAABB);
|
||||||
|
+ // All other value as BLOCK_SHAPE_VANILLA to process
|
||||||
|
+ };
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - Configurable collision behavior
|
||||||
|
+
|
||||||
|
public static boolean getEntityHardCollisions(final Level world, final Entity entity, AABB aabb,
|
||||||
|
final List<AABB> into, final int collisionFlags, final Predicate<Entity> predicate) {
|
||||||
|
final boolean checkOnly = (collisionFlags & COLLISION_FLAG_CHECK_ONLY) != 0;
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <wangxyper@163.com>
|
|
||||||
Date: Sat, 8 Feb 2025 14:25:16 +0800
|
|
||||||
Subject: [PATCH] Leaves: Fix Incorrect Collision Behavior for Block Shape
|
|
||||||
|
|
||||||
Co-authored by: Fortern <blueten.ki@gmail.com>
|
|
||||||
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/leaves-server/minecraft-patches/features/0110-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch)
|
|
||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
index e1bf7bc3cca63101b3c0550b5b4c0d28d0f3776e..ea01087967dd9ff32b23661079e97ea468d31163 100644
|
|
||||||
--- a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
@@ -101,6 +101,14 @@ public final class CollisionUtil {
|
|
||||||
(box1.minZ - box2.maxZ) < -COLLISION_EPSILON && (box1.maxZ - box2.minZ) > COLLISION_EPSILON;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Leaves start
|
|
||||||
+ public static boolean voxelShapeIntersectVanilla(final net.minecraft.world.phys.AABB box1, final net.minecraft.world.phys.AABB box2) {
|
|
||||||
+ return box1.minX < box2.maxX && box1.maxX > box2.minX &&
|
|
||||||
+ box1.minY < box2.maxY && box1.maxY > box2.minY &&
|
|
||||||
+ box1.minZ < box2.maxZ && box1.maxZ > box2.minZ;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end
|
|
||||||
+
|
|
||||||
// assume !isEmpty(target) && abs(source_move) >= COLLISION_EPSILON
|
|
||||||
public static double collideX(final AABB target, final AABB source, final double source_move) {
|
|
||||||
if ((source.minY - target.maxY) < -COLLISION_EPSILON && (source.maxY - target.minY) > COLLISION_EPSILON &&
|
|
||||||
@@ -2025,7 +2033,10 @@ public final class CollisionUtil {
|
|
||||||
AABB singleAABB = ((CollisionVoxelShape)blockCollision).moonrise$getSingleAABBRepresentation();
|
|
||||||
if (singleAABB != null) {
|
|
||||||
singleAABB = singleAABB.move((double)blockX, (double)blockY, (double)blockZ);
|
|
||||||
- if (!voxelShapeIntersect(aabb, singleAABB)) {
|
|
||||||
+ // Leaves start - Fix incorrect collision behavior for block shape
|
|
||||||
+ boolean isBlockShape = blockCollision == net.minecraft.world.phys.shapes.Shapes.block();
|
|
||||||
+ if (isBlockShape && !voxelShapeIntersectVanilla(aabb, singleAABB) || !isBlockShape && !voxelShapeIntersect(aabb, singleAABB)) {
|
|
||||||
+ // Leaves end - Fix incorrect collision behavior for block shape
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 4 Jun 2025 12:54:22 +0800
|
||||||
|
Subject: [PATCH] Leaves: Fix chunk reload detector
|
||||||
|
|
||||||
|
Co-authored by: Fortern <blueten.ki@gmail.com>
|
||||||
|
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/c5f18b7864206cea4411211b51787f10affbcb9c/leaves-server/minecraft-patches/features/0123-Fix-chunk-reload-detector.patch)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
index b118e91f1e0b5a8b8c0b2a4a32faabc5a34a5954..663bd286426537daf97ae09dc7e076a9ec6d4c9c 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
@@ -376,7 +376,7 @@ public class ServerEntity {
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
consumer.accept(new ClientboundSetEquipmentPacket(this.entity.getId(), list, true)); // Paper - data sanitization
|
||||||
|
}
|
||||||
|
- ((LivingEntity) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
|
||||||
|
+ if (this.entity.totalEntityAge == 0) ((LivingEntity) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending // Leaves - fix chunk reload detector (#492)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.entity.getPassengers().isEmpty()) {
|
||||||
@@ -8,7 +8,7 @@ As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 5564bba66959a2a280f700f6c6a05d292faced88..4492f3ab470c0bf735b6fdc69115c1ebbcd727ef 100644
|
index bcc0c3cfa5be4daeec6e95a1b63a6cd38890f04d..e83c6a81e318a05580f5c811cb2543a83435f04c 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1285,7 +1285,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1285,7 +1285,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -8,7 +8,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249
|
|||||||
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
index ab7f7846d3fc0252c6f71277b3e67d7a785a96b5..0f496f0e1c63bc3d8b17a8f0cb065138cb079334 100644
|
index 5ae08be75ca01924fc78bdd8d6bb6747ddc21aea..6e0b6304205210cc60293329fe30bd6c99cd263a 100644
|
||||||
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
@@ -300,11 +300,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
@@ -300,11 +300,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||||
@@ -8,7 +8,7 @@ Co-authored by: MrPowerGamerBR <git@mrpowergamerbr.com>
|
|||||||
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/minecraft-patches/features/0002-Skip-distanceToSqr-call-in-ServerEntity-sendChanges-.patch)
|
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/minecraft-patches/features/0002-Skip-distanceToSqr-call-in-ServerEntity-sendChanges-.patch)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
index b118e91f1e0b5a8b8c0b2a4a32faabc5a34a5954..8c232ae73a8c6500723994af3a28b36814cccae0 100644
|
index 663bd286426537daf97ae09dc7e076a9ec6d4c9c..8739b4e806878cf3a4af9ad1aef7f2a55880d503 100644
|
||||||
--- a/net/minecraft/server/level/ServerEntity.java
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/net/minecraft/server/level/ServerEntity.java
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -205,6 +205,8 @@ public class ServerEntity {
|
@@ -205,6 +205,8 @@ public class ServerEntity {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Correct player respawn place
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 4492f3ab470c0bf735b6fdc69115c1ebbcd727ef..8b9c823deed1844fa69d1456a91ac65487b8ae69 100644
|
index e83c6a81e318a05580f5c811cb2543a83435f04c..2f2726ed97658732751032b21752840702da233e 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -492,8 +492,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -492,8 +492,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/CollisionBehaviorConfig.java
|
||||||
|
@@ -1,0 +_,25 @@
|
||||||
|
+package me.earthme.luminol.config.modules.misc;
|
||||||
|
+
|
||||||
|
+import me.earthme.luminol.config.EnumConfigCategory;
|
||||||
|
+import me.earthme.luminol.config.IConfigModule;
|
||||||
|
+import me.earthme.luminol.config.flags.ConfigInfo;
|
||||||
|
+
|
||||||
|
+public class CollisionBehaviorConfig implements IConfigModule {
|
||||||
|
+ @ConfigInfo(baseName = "mode", comments =
|
||||||
|
+ """
|
||||||
|
+ Available Value:
|
||||||
|
+ VANILLA
|
||||||
|
+ BLOCK_SHAPE_VANILLA
|
||||||
|
+ PAPER""")
|
||||||
|
+ public static String behaviorMode = "BLOCK_SHAPE_VANILLA";
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public EnumConfigCategory getCategory() {
|
||||||
|
+ return EnumConfigCategory.MISC;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getBaseName() {
|
||||||
|
+ return "collision_behavior";
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
Reference in New Issue
Block a user