2021-06-11 12:02:28 +00: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
|
2022-06-07 21:45:11 +00:00
|
|
|
index a0b27bdeabcabd0bd07b1b495105f9b6af998092..ab48f572c778924354f30ff05bb45f3b235817af 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
2022-06-07 21:45:11 +00:00
|
|
|
@@ -232,6 +232,10 @@ public class ItemEntity extends Entity {
|
2021-06-11 12:02:28 +00: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;
|
2022-05-25 19:21:51 +00:00
|
|
|
List<ItemEntity> list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(radius, radius - 0.5D, radius), (entityitem) -> {
|