forked from LeavesMC/Leaves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix falling block's block location (LeavesMC#179)
- Loading branch information
1 parent
6d87bff
commit 6e2eb4b
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
patches/server/0134-Fix-falling-block-s-block-location.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <[email protected]> | ||
Date: Fri, 16 Feb 2024 19:50:03 +0800 | ||
Subject: [PATCH] Fix falling block's block location | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java | ||
index 318edf18fc2c339ac881a1e5a957154eeb330255..96b02f15e55ee9176a0301fa1b7d6cd4d10f1961 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/Entity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java | ||
@@ -4791,6 +4791,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S | ||
int j = Mth.floor(y); | ||
int k = 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) { | ||
+ j = 0; | ||
+ } | ||
+ } | ||
+ // Leaves end - fix falling block location | ||
+ | ||
if (i != this.blockPosition.getX() || j != this.blockPosition.getY() || k != this.blockPosition.getZ()) { | ||
this.blockPosition = new BlockPos(i, j, k); | ||
this.feetBlockState = null; |