mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
28 lines
1.2 KiB
Diff
28 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
|
Date: Sat, 29 Nov 2025 21:01:21 +0800
|
|
Subject: [PATCH] Fix stacked container destroyed drop
|
|
|
|
|
|
diff --git a/net/minecraft/world/item/ItemUtils.java b/net/minecraft/world/item/ItemUtils.java
|
|
index 16fc5c89b652194afac64aaa29f72a25ba7ffcae..53ac755a10b2e915053feab358aa3b9fbc25547a 100644
|
|
--- a/net/minecraft/world/item/ItemUtils.java
|
|
+++ b/net/minecraft/world/item/ItemUtils.java
|
|
@@ -39,6 +39,16 @@ public class ItemUtils {
|
|
}
|
|
|
|
public static void onContainerDestroyed(ItemEntity container, Iterable<ItemStack> contents) {
|
|
+ if (org.leavesmc.leaves.LeavesConfig.fix.stackedContainerDestroyedDrop) {
|
|
+ for (int i = 0; i < container.getItem().getCount(); i++) {
|
|
+ createDroppedItem(container, contents);
|
|
+ }
|
|
+ } else {
|
|
+ createDroppedItem(container, contents);
|
|
+ }
|
|
+ }
|
|
+
|
|
+ private static void createDroppedItem(ItemEntity container, Iterable<ItemStack> contents) {
|
|
Level level = container.level();
|
|
if (!level.isClientSide()) {
|
|
// Paper start - call EntityDropItemEvent
|