Skip to content

Commit

Permalink
Shorten second comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
YHDiamond committed Jul 9, 2024
1 parent 8738f99 commit 634c097
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

package org.geysermc.geyser.inventory.click;

import org.geysermc.geyser.item.Items;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerActionType;
import org.geysermc.mcprotocollib.protocol.data.game.inventory.ContainerType;
Expand Down Expand Up @@ -382,7 +383,7 @@ private void reduceCraftingGrid(boolean makeAll) {
for (int i = 0; i < gridSize; i++) {
final int slot = i + 1;
GeyserItemStack item = getItem(slot);
if (!item.isEmpty() && (!handleBookRecipe || item.getJavaId() != session.getItemMappings().getStoredItems().writtenBook().getJavaItem().javaId())) {
if (!item.isEmpty() && item.asItem() == Items.WRITTEN_BOOK) {
// These changes should be broadcasted to the server
sub(slot, item, crafted);
}
Expand Down

0 comments on commit 634c097

Please sign in to comment.