Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandoislas committed Jan 30, 2017
1 parent 782d9ac commit 4112d1b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/rolandoislas/multihotbar/InventoryHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ public static void tick() {
*/
static void swapSlot(int firstSlot, int secondSlot) {
EntityPlayer player = Minecraft.getMinecraft().player;
// Check if current item should be changed to avoid inventory tweaks autoreplace
if (lastItem < 0 && Loader.isModLoaded("inventorytweaks")) {
if (fullInventoryToMainInventory(firstSlot) == player.inventory.currentItem ||
fullInventoryToMainInventory(secondSlot) == player.inventory.currentItem) {
lastItem = player.inventory.currentItem;
player.inventory.currentItem = lastItem + 1 <= 8 ? lastItem + 1 : 0;
waitTicks = 5;
}
}
// Move items
int window = player.inventoryContainer.windowId;
try {
Minecraft.getMinecraft().playerController.windowClick(window, firstSlot, 0, ClickType.SWAP, player);
Expand Down

0 comments on commit 4112d1b

Please sign in to comment.