Commits

Y2K_ authored and md_5 committed 3d4295ccbf0
#1059: Add MenuType ViewBuilder
No tags

src/main/java/org/bukkit/inventory/view/builder/InventoryViewBuilder.java

Added
1 +package org.bukkit.inventory.view.builder;
2 +
3 +import org.bukkit.entity.HumanEntity;
4 +import org.bukkit.inventory.InventoryView;
5 +import org.jetbrains.annotations.ApiStatus;
6 +import org.jetbrains.annotations.NotNull;
7 +
8 +/**
9 + * Generic Builder for InventoryView's with no special attributes or parameters
10 + *
11 + * @param <V> the type of InventoryView created from this builder
12 + */
13 +@ApiStatus.Experimental
14 +public interface InventoryViewBuilder<V extends InventoryView> {
15 +
16 + /**
17 + * Makes a copy of this builder
18 + *
19 + * @return a copy of this builder
20 + */
21 + @NotNull
22 + InventoryViewBuilder<V> copy();
23 +
24 + /**
25 + * Sets the title of the builder
26 + *
27 + * @param title the title
28 + * @return this builder
29 + */
30 + @NotNull
31 + InventoryViewBuilder<V> title(@NotNull final String title);
32 +
33 + /**
34 + * Builds this builder into a InventoryView
35 + *
36 + * @param player the player to assign to the view
37 + * @return the created InventoryView
38 + */
39 + @NotNull
40 + V build(@NotNull final HumanEntity player);
41 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut