Skip to content

Commit

Permalink
Fix falling block's block location (LeavesMC#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china authored and Lumine1909 committed Apr 21, 2024
1 parent 6d87bff commit 6e2eb4b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions patches/server/0134-Fix-falling-block-s-block-location.patch
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;

0 comments on commit 6e2eb4b

Please sign in to comment.