From 19a5d6d225045594458477d839f25653257c600f Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Mon, 11 Sep 2023 12:46:02 +0800
Subject: [PATCH] Fix fixItemsMergingThroughWalls check (#9707)

---
 .../Add-option-to-fix-items-merging-through-walls.patch   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/patches/server/Add-option-to-fix-items-merging-through-walls.patch b/patches/server/Add-option-to-fix-items-merging-through-walls.patch
index 8e346e0352..7729f4e94f 100644
--- a/patches/server/Add-option-to-fix-items-merging-through-walls.patch
+++ b/patches/server/Add-option-to-fix-items-merging-through-walls.patch
@@ -13,9 +13,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
                  if (entityitem.isMergable()) {
 +                    // Paper start - Fix items merging through walls
-+                    if (this.level().clipDirect(this.position(), entityitem.position(),
-+                        net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.HitResult.Type.BLOCK) {
-+                        continue;
++                    if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) {
++                        if (this.level().clipDirect(this.position(), entityitem.position(),
++                            net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.HitResult.Type.BLOCK) {
++                            continue;
++                        }
 +                    }
 +                    // Paper end - Fix items merging through walls
                      this.tryToMerge(entityitem);