From 34cab0d8adc197b506a4c46bed42aa113022e6b9 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Fri, 19 Feb 2016 18:32:25 +1100 Subject: [PATCH] Fixed deletion of flowers if a basket is full. Closes #685 --- .../common/handler/ItemEventHandler.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java index 1f103abfc..f97853ce8 100644 --- a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java @@ -55,12 +55,14 @@ public class ItemEventHandler { InventoryFlowerBasket inventory = new InventoryFlowerBasket(basketStack, player); - //Add the stack to the basket's inventory - inventory.func_174894_a(stack); - //Set stack size to 0 to cause it to be removed - stack.stackSize = 0; - //Prevent the stack from being added to the player's inventory - event.setResult(Result.ALLOW); + //Add the stack to the basket's inventory, if successful, don't add it to the player's regular inventory + if (inventory.func_174894_a(stack) == null) + { + //Set stack size to 0 to cause it to be removed + stack.stackSize = 0; + //Prevent the stack from being added to the player's inventory + event.setResult(Result.ALLOW); + } } } }