geforkt von Mirrors/Paper
Add recipe to cook events
Dieser Commit ist enthalten in:
Ursprung
d3ff89b33b
Commit
c6ff2b9aee
@ -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() {
|
||||
|
@ -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
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren