diff --git a/gradle.properties b/gradle.properties index d71228d02..a44b0adba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G minecraft_base_version=1.12 minecraft_version=1.12.2 -mod_version=5.3.6 +mod_version=5.3.7 chameleon_version=4.1.0 chameleon_max_version=5.0.0 diff --git a/src/com/jaquadro/minecraft/storagedrawers/inventory/DrawerInventoryHelper.java b/src/com/jaquadro/minecraft/storagedrawers/inventory/DrawerInventoryHelper.java index d4d35c9b9..1c71cba72 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/inventory/DrawerInventoryHelper.java +++ b/src/com/jaquadro/minecraft/storagedrawers/inventory/DrawerInventoryHelper.java @@ -21,12 +21,16 @@ public static void dropInventoryItems (World world, BlockPos pos, IDrawerGroup g while (drawer.getStoredItemCount() > 0) { ItemStack stack = drawer.getStoredItemPrototype().copy(); - stack.setCount(drawer.getStoredItemCount()); + int storedCount = drawer.getStoredItemCount(); + int stackLimit = stack.getMaxStackSize(); + int stackSize = Math.min(storedCount, stackLimit); + + stack.setCount(stackSize); if (stack.isEmpty()) break; spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack); - drawer.setStoredItemCount(0); + drawer.adjustStoredItemCount(-stackSize); } } }