diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java index db58fa6f7..384255a91 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/researching/Research.java @@ -11,6 +11,7 @@ import org.bukkit.Keyed; import org.bukkit.NamespacedKey; import org.bukkit.Sound; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.events.ResearchUnlockEvent; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; @@ -139,7 +140,7 @@ public class Research implements Keyed { } /** - * Bind the specified Slimefun items to this {@link Research}. + * Bind the specified {@link SlimefunItem SlimefunItems} to this {@link Research}. * * @param items * Instances of {@link SlimefunItem} to bind to this {@link Research} @@ -152,6 +153,26 @@ public class Research implements Keyed { } } + /** + * Bind the specified ItemStacks to this {@link Research}. + * + * @param items + * Instances of {@link ItemStack} to bind to this {@link Research} + * + * @return The current instance of {@link Research} + */ + public Research addItems(ItemStack... items) { + for (ItemStack item : items) { + SlimefunItem sfItem = SlimefunItem.getByItem(item); + + if (sfItem != null) { + sfItem.setResearch(this); + } + } + + return this; + } + /** * Lists every {@link SlimefunItem} that is bound to this {@link Research}. *