MenuType API addition InventoryView Builders (#11816)

This commit is contained in:
Miles
2025-01-11 19:21:24 +00:00
committed by GitHub
parent 775002a357
commit c94922514a
27 changed files with 759 additions and 95 deletions

View File

@@ -40,6 +40,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemCraftResult;
import org.bukkit.inventory.ItemFactory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.MenuType;
import org.bukkit.inventory.Merchant;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.meta.ItemMeta;
@@ -1925,7 +1926,10 @@ public final class Bukkit {
* @param title the title of the corresponding merchant inventory, displayed
* when the merchant inventory is viewed
* @return a new merchant
* @deprecated The title parameter is no-longer needed when used with
* {@link MenuType#MERCHANT} and {@link MenuType.Typed#builder()}.
*/
@Deprecated(since = "1.21.4")
public static @NotNull Merchant createMerchant(net.kyori.adventure.text.@Nullable Component title) {
return server.createMerchant(title);
}
@@ -1936,7 +1940,8 @@ public final class Bukkit {
* @param title the title of the corresponding merchant inventory, displayed
* when the merchant inventory is viewed
* @return a new merchant
* @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)}
* @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)}. The title parameter is
* no-longer needed when used with {@link MenuType#MERCHANT} and {@link MenuType.Typed#builder()}
*/
@NotNull
@Deprecated // Paper
@@ -1944,6 +1949,16 @@ public final class Bukkit {
return server.createMerchant(title);
}
/**
* Creates an empty merchant.
*
* @return a new merchant
*/
@NotNull
public static Merchant createMerchant() {
return server.createMerchant();
}
/**
* Gets the amount of consecutive neighbor updates before skipping
* additional ones.