aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0716-Respect-despawn-rate-in-item-merge-check.patch
blob: d5cd293f4a62b4063c07368a3d8a99a636500c60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Wed, 18 Aug 2021 23:01:55 +0200
Subject: [PATCH] Respect despawn rate in item merge check


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 7897b3324bc8d5a33cd3cd144b9fae9ffdc9241e..0ac107d7a360a5812a43488c611498d12546eed9 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -261,7 +261,7 @@ public class ItemEntity extends Entity {
     private boolean isMergable() {
         ItemStack itemstack = this.getItem();
 
-        return this.isAlive() && this.pickupDelay != 32767 && this.age != -32768 && this.age < 6000 && itemstack.getCount() < itemstack.getMaxStackSize();
+        return this.isAlive() && this.pickupDelay != 32767 && this.age != -32768 && this.age < this.getDespawnRate() && itemstack.getCount() < itemstack.getMaxStackSize(); // Paper - respect despawn rate in pickup check.
     }
 
     private void tryToMerge(ItemEntity other) {