PaperMC/patches/server/0217-Avoid-item-merge-if-stack-size-above-max-stack-size.patch
Jake Potrebic a90092e758
Updated Upstream (CraftBukkit/Spigot) (#7848)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
95d233dc SPIGOT-1807: PlayerTeleportEvent is called twice

Spigot Changes:
b0819150 PR-116: Slightly reduce item merge radius in Y-direction
ef2aa765 PR-119: Fix off-by-one and allow disabling max-tnt-per-tick option
2022-05-25 21:21:51 +02:00

21 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 16 Jul 2018 12:42:20 +0200
Subject: [PATCH] Avoid item merge if stack size above max stack size
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 430809523d02801088c247e11bce351a99b8bc05..df5064e69f10bb366572e5f1da197514f3067faf 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -222,6 +222,10 @@ public class ItemEntity extends Entity {
private void mergeWithNeighbours() {
if (this.isMergable()) {
+ // Paper start - avoid item merge if stack size above max stack size
+ ItemStack stack = getItem();
+ if (stack.getCount() >= stack.getMaxStackSize()) return;
+ // Paper end
// Spigot start
double radius = level.spigotConfig.itemMerge;
List<ItemEntity> list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(radius, radius - 0.5D, radius), (entityitem) -> {