Paper/patches/server/0217-Avoid-item-merge-if-stack-size-above-max-stack-size.patch

22 Zeilen
1.2 KiB
Diff

2021-06-11 14:02:28 +02:00
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 943c2bd2a0836eda5b4da382c459ade6cbe40fea..b374d50678e92fabbf1d640729a8a276fc791c62 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
2021-11-23 16:04:41 +01:00
@@ -222,6 +222,10 @@ public class ItemEntity extends Entity {
2021-06-11 14:02:28 +02:00
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, radius), (entityitem) -> {