Skip to content

Commit 18ca2b4

Browse files
committed
feat(events): Add CookingEvent.Recipe for recipe books
Since recipe books also have cooking events, these transactions are typically logged as warnings being uncaught and no events being thrown.
1 parent 3a78769 commit 18ca2b4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/main/java/org/spongepowered/api/event/block/entity/CookingEvent.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
import org.spongepowered.api.event.Cancellable;
3030
import org.spongepowered.api.event.Event;
3131
import org.spongepowered.api.event.item.inventory.AffectSlotEvent;
32+
import org.spongepowered.api.event.item.inventory.container.ClickContainerEvent;
33+
import org.spongepowered.api.item.inventory.ItemStack;
3234
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
35+
import org.spongepowered.api.item.inventory.slot.FuelSlot;
3336
import org.spongepowered.api.item.recipe.cooking.CookingRecipe;
3437

3538
import java.util.Optional;
@@ -64,6 +67,23 @@ public interface CookingEvent extends Event {
6467

6568
Optional<ResourceKey> recipeKey();
6669

70+
/**
71+
* Called when a {@link CookingRecipe} is used to place an
72+
* {@link ItemStack} into an {@link FuelSlot}
73+
*/
74+
interface Recipe extends CookingEvent, ClickContainerEvent, Cancellable {
75+
76+
/**
77+
* Fires when the Client requests a recipe to be smelted once.
78+
*/
79+
interface Single extends CookingEvent.Recipe {}
80+
81+
/**
82+
* Fires when the client requests a recipe to be cooking as much as possible.
83+
*/
84+
interface All extends CookingEvent.Recipe {}
85+
}
86+
6787
/**
6888
* The first tick of an item cooking.
6989
*/

0 commit comments

Comments
 (0)