9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0099-Fix-falling-block-s-block-location.patch
Lumine1909 f09fbb247d 1.21.5 (#470)
---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Fortern <blueten.ki@gmail.com>
Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
2025-06-05 18:41:51 +08:00

27 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Fri, 16 Feb 2024 19:50:03 +0800
Subject: [PATCH] Fix falling block's block location
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4133f8da3ca93b9519cecad68cc50f9bdf86cc94..9643754dda5f17a6cc11c892fab8bfc600cfc479 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4818,6 +4818,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
int floor = Mth.floor(x);
int floor1 = Mth.floor(y);
int floor2 = Mth.floor(z);
+
+ // Leaves start - fix falling block location
+ if (this instanceof net.minecraft.world.entity.item.FallingBlockEntity) {
+ if (y < 0.0 && y + 1e-10 > 0.0) {
+ floor1 = 0;
+ }
+ }
+ // Leaves end - fix falling block location
+
if (floor != this.blockPosition.getX() || floor1 != this.blockPosition.getY() || floor2 != this.blockPosition.getZ()) {
this.blockPosition = new BlockPos(floor, floor1, floor2);
this.inBlockState = null;