Skip to content

Commit

Permalink
Merge remote-tracking branch 'main/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hempfest committed May 26, 2021
2 parents bcfb5ca + 0d6a997 commit 7c8cd8a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions Labyrinth.iml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.10.6" level="project" />
<orderEntry type="library" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

/**
* Fluid interface menu builder
Expand Down Expand Up @@ -208,6 +209,18 @@ public ElementBuilder addElement(ItemStack item) {
return new ElementBuilder(this, new MenuElement(item));
}

/**
* Add a previously-styled ItemStack directly to the menu via Supplier.
* <p>
* This is useful if you're used to creating your own custom items.
*
* @param supplier supplier of item to add
* @return a new ElementBuilder to customize the element
*/
public ElementBuilder addElement(@NotNull Supplier<ItemStack> supplier) {
return new ElementBuilder(this, new MenuElement(supplier.get()));
}

/**
* Add an ItemStack to the menu of specified display name and lore.
* <p>
Expand All @@ -233,14 +246,24 @@ public FillerBuilder setFiller(ItemStack item) {
return new FillerBuilder(this, new MenuElement(item));
}

/**
* Fill the remaining slots of the menu with an ItemStack via Supplier.
*
* @param supplier supplier of item to add
* @return a new FillerBuilder to customize the element
*/
public FillerBuilder setFiller(@NotNull Supplier<ItemStack> supplier) {
return new FillerBuilder(this, new MenuElement(supplier.get()));
}

/**
* Fill the remaining slots of the menu with an ItemStack
* of specified display name and lore.
*
* @param item item to add
* @param text display name of item
* @param lore optional lore to add as varargs
* @return a new ElementBuilder to customize the element
* @return a new FillerBuilder to customize the element
*/
public FillerBuilder setFiller(ItemStack item, String text, String... lore) {
return new FillerBuilder(this, new MenuElement(item, text, lore));
Expand Down

0 comments on commit 7c8cd8a

Please sign in to comment.