diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java index 8fbfad91b0..f37cc5dee0 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/BrewEvent.java @@ -1,10 +1,12 @@ package org.bukkit.event.inventory; +import java.util.List; import org.bukkit.block.Block; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockEvent; import org.bukkit.inventory.BrewerInventory; +import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; /** @@ -14,18 +16,23 @@ import org.jetbrains.annotations.NotNull; public class BrewEvent extends BlockEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private BrewerInventory contents; + private final List results; private int fuelLevel; private boolean cancelled; - public BrewEvent(@NotNull Block brewer, @NotNull BrewerInventory contents, int fuelLevel) { + public BrewEvent(@NotNull Block brewer, @NotNull BrewerInventory contents, @NotNull List results, int fuelLevel) { super(brewer); this.contents = contents; + this.results = results; this.fuelLevel = fuelLevel; } /** * Gets the contents of the Brewing Stand. * + * Note: The brewer inventory still holds the items found prior to + * the finalization of the brewing process, e.g. the plain water bottles. + * * @return the contents */ @NotNull @@ -42,6 +49,21 @@ public class BrewEvent extends BlockEvent implements Cancellable { return fuelLevel; } + /** + * Gets the resulting items in the Brewing Stand. + * + * The returned list, in case of a server-created event instance, is + * mutable. Any changes in the returned list will reflect in the brewing + * result if the event is not cancelled. If the size of the list is reduced, + * remaining items will be set to air. + * + * @return List of {@link ItemStack} resulting for this operation + */ + @NotNull + public List getResults() { + return results; + } + @Override public boolean isCancelled() { return cancelled;