Skip to content

Commit

Permalink
Cherry pick 5f92241
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandoislas committed Feb 23, 2017
1 parent 7067f40 commit 03aeaf7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/rolandoislas/multihotbar/HotbarLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.google.gson.stream.JsonReader;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -411,6 +413,7 @@ private void reorderPickedupItem() {
waitForItemTicks++;
if (player.inventory.getStackInSlot(pickupSlot.get(0)).isEmpty())
return;
waitForItemTicks = 0;
// Move the picked up item to the correct slot
int clickSlotFirst = InventoryHelper.mainInventoryToFullInventory(this.pickupSlot.get(0));
int clickSlotSecond = InventoryHelper.mainInventoryToFullInventory(getFirstEmptyStack());
Expand Down Expand Up @@ -488,7 +491,9 @@ private void checkItemPickedUp() {
// Set the inventory
if (inventory == null ||
// Ignore if inventory is open TODO check inventory movement better
Minecraft.getMinecraft().currentScreen instanceof GuiInventory) {
Minecraft.getMinecraft().currentScreen instanceof GuiInventory ||
Minecraft.getMinecraft().currentScreen instanceof GuiContainer ||
Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) {
inventory = new ArrayList<ItemStack>(player.inventory.mainInventory);
}
// Find the changed item
Expand Down

0 comments on commit 03aeaf7

Please sign in to comment.