mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-24 01:19:19 +00:00
27 lines
1.3 KiB
Diff
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 c9787c36f083a5d8fdff033f02b9596c8b2cc866..5d13f47936069ce1577ef0eb2627d5ef6492dcd6 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -5020,6 +5020,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;
|