13
0
geforkt von Mirrors/Paper

Add recipe to cook events

Dieser Commit ist enthalten in:
Thonk 2021-01-06 12:05:29 -08:00
Ursprung d3ff89b33b
Commit c6ff2b9aee
2 geänderte Dateien mit 27 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -14,12 +14,21 @@ public class BlockCookEvent extends BlockEvent implements Cancellable {
private final ItemStack source;
private ItemStack result;
private boolean cancelled;
private final org.bukkit.inventory.CookingRecipe<?> recipe; // Paper
@Deprecated // Paper
public BlockCookEvent(@NotNull final Block block, @NotNull final ItemStack source, @NotNull final ItemStack result) {
// Paper start
this(block, source, result, null);
}
public BlockCookEvent(@NotNull final Block block, @NotNull final ItemStack source, @NotNull final ItemStack result, @org.jetbrains.annotations.Nullable org.bukkit.inventory.CookingRecipe<?> recipe) {
// Paper end
super(block);
this.source = source;
this.result = result;
this.cancelled = false;
this.recipe = recipe; // Paper
}
/**
@ -61,6 +70,18 @@ public class BlockCookEvent extends BlockEvent implements Cancellable {
this.cancelled = cancel;
}
// Paper start
/**
* Gets the cooking recipe associated with this event.
*
* @return the recipe
*/
@org.jetbrains.annotations.Nullable
public org.bukkit.inventory.CookingRecipe<?> getRecipe() {
return recipe;
}
// Paper end
@NotNull
@Override
public HandlerList getHandlers() {

Datei anzeigen

@ -12,7 +12,13 @@ import org.jetbrains.annotations.NotNull;
*/
public class FurnaceSmeltEvent extends BlockCookEvent {
@Deprecated // Paper
public FurnaceSmeltEvent(@NotNull final Block furnace, @NotNull final ItemStack source, @NotNull final ItemStack result) {
super(furnace, source, result);
}
// Paper start
public FurnaceSmeltEvent(@NotNull final Block furnace, @NotNull final ItemStack source, @NotNull final ItemStack result, @org.jetbrains.annotations.Nullable org.bukkit.inventory.CookingRecipe<?> recipe) {
super(furnace, source, result, recipe);
}
// Paper end
}