9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-23 00:49:23 +00:00
Files
LeavesMC/patches/server/0083-Use-fast-item-merge-raytracing.patch
2023-09-11 12:06:30 +08:00

27 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Mon, 17 Jul 2023 22:27:12 +0800
Subject: [PATCH] Use fast item merge raytracing
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index ef6c0e51f2f971f30fce36b5502daa5b5bbf1b26..b2574d8ad26a0b3ef991a557d5865d38dd7a77fc 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -285,9 +285,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
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) { // Leaves - just fix config
+ 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);