#712: Add API to get full result of crafting items

By: James Peters <email@jamesdpeters.com>
This commit is contained in:
Bukkit/Spigot
2023-11-06 20:37:32 +11:00
parent 3475839dd7
commit f2b2fd52d4
3 changed files with 183 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package org.bukkit.inventory;
import java.util.List;
import org.jetbrains.annotations.NotNull;
/**
* Container class containing the results of a Crafting event.
* <br>
* This class makes no guarantees about the nature or mutability of the returned
* values.
*/
public interface ItemCraftResult {
/**
* The resulting {@link ItemStack} that was crafted.
*
* @return {@link ItemStack} that was crafted.
*/
@NotNull
public ItemStack getResult();
/**
* Gets the resulting matrix from the crafting operation.
*
* @return resulting matrix
*/
@NotNull
public ItemStack[] getResultingMatrix();
/**
* Gets the overflowed items for items that don't fit back into the crafting
* matrix.
*
* @return overflow items
*/
@NotNull
public List<ItemStack> getOverflowItems();
}