diff --git a/src/main/java/carpet_autocraftingtable/CraftingTableBlockEntity.java b/src/main/java/carpet_autocraftingtable/CraftingTableBlockEntity.java index 4b747e6..6ac0fe9 100644 --- a/src/main/java/carpet_autocraftingtable/CraftingTableBlockEntity.java +++ b/src/main/java/carpet_autocraftingtable/CraftingTableBlockEntity.java @@ -181,7 +181,13 @@ public void clear() { private Optional getCurrentRecipe() { if (this.world == null) return Optional.empty(); - Optional optionalRecipe = this.world.getRecipeManager().getFirstMatch(RecipeType.CRAFTING, craftingInventory, world); + Optional optionalRecipe; + if ((optionalRecipe = Optional.ofNullable((CraftingRecipe) getLastRecipe())).isPresent()) { + if (RecipeType.CRAFTING.match(optionalRecipe.get(), world, craftingInventory).isPresent()) { + return optionalRecipe; + } + } + optionalRecipe = this.world.getRecipeManager().getFirstMatch(RecipeType.CRAFTING, craftingInventory, world); optionalRecipe.ifPresent(this::setLastRecipe); return optionalRecipe; }