Fix upgrade not shift-clicking into upgrade slots
@@ -2,6 +2,7 @@ package com.jaquadro.minecraft.storagedrawers.inventory;
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawers;
import com.jaquadro.minecraft.storagedrawers.client.renderer.StorageRenderItem;
+import com.jaquadro.minecraft.storagedrawers.item.ItemUpgrade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -113,12 +114,12 @@ public class ContainerDrawers extends Container
// Try merge inventory to upgrades
else if (slotIndex >= inventoryStart && slotIndex < hotbarEnd && slotStack != null) {
- /*if (slotStack.getItem() == ModItems.upgrade || slotStack.getItem() == ModItems.upgradeStatus || slotStack.getItem() == ModItems.upgradeVoid) {
+ if (slotStack.getItem() instanceof ItemUpgrade) {
ItemStack slotStack1 = slotStack.copy();
slotStack1.stackSize = 1;
if (!mergeItemStack(slotStack1, upgradeStart, upgradeEnd, false)) {
- if (slotIndex >= inventoryStart && slotIndex < hotbarEnd) {
+ if (slotIndex >= inventoryStart && slotIndex < hotbarStart) {
if (!mergeItemStack(slotStack, hotbarStart, hotbarEnd, false))
return null;
} else if (slotIndex >= hotbarStart && slotIndex < hotbarEnd && !mergeItemStack(slotStack, inventoryStart, hotbarStart, false))
@@ -126,10 +127,15 @@ public class ContainerDrawers extends Container
}
else {
slotStack.stackSize--;
- }
- }*/
+ if (slotStack.stackSize == 0)
+ slot.putStack(null);
+ else
+ slot.onSlotChanged();
- if (slotIndex >= inventoryStart && slotIndex < hotbarStart) {
+ slot.onPickupFromSlot(player, slotStack);
+ return null;
+ }
+ } else if (slotIndex >= inventoryStart && slotIndex < hotbarStart) {
if (!mergeItemStack(slotStack, hotbarStart, hotbarEnd, false))
return null;
} else if (slotIndex >= hotbarStart && slotIndex < hotbarEnd && !mergeItemStack(slotStack, inventoryStart, hotbarStart, false))
