Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ private void tryCraft(EntityPlayer player, FoodRecipe recipe, boolean isShiftDow
if (recipe.isSmeltingRecipe()) {
return;
}
craftBook.prepareRecipe(player, recipe);
if (!isShiftDown) {
if (craftBook.canMouseItemHold(player, recipe)) {
ItemStack craftingResult = craftBook.craft(player, recipe);
Expand All @@ -308,13 +307,16 @@ private void tryCraft(EntityPlayer player, FoodRecipe recipe, boolean isShiftDow
.sendPacket(new S2FPacketSetSlot(-1, 0, craftingResult));
}
}
player.inventory.markDirty();
player.inventoryContainer.detectAndSendChanges();
}
} else {
ItemStack craftingResult;
int crafted = 0;
while (crafted < 64 && (craftingResult = craftBook.craft(player, recipe)) != null) {
do {
craftingResult = craftBook.craft(player, recipe);
if (craftingResult == null) {
break;
}

crafted += craftingResult.stackSize;
if (!player.inventory.addItemStackToInventory(craftingResult)) {
if (player.inventory.getItemStack() == null) {
Expand All @@ -324,10 +326,11 @@ private void tryCraft(EntityPlayer player, FoodRecipe recipe, boolean isShiftDow
}
break;
}
}
player.inventory.markDirty();
player.inventoryContainer.detectAndSendChanges();
} while (crafted < craftingResult.getMaxStackSize());
}

player.inventory.markDirty();
player.inventoryContainer.detectAndSendChanges();
}

public void markSelectionDirty() {
Expand Down