-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Fillable interface and StaticPane#fillBorder method
- Loading branch information
Showing
4 changed files
with
106 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/me/despical/inventoryframework/pane/Fillable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package me.despical.inventoryframework.pane; | ||
|
||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* An interface for panes that can be fillable | ||
* | ||
* @author Despical | ||
* @since 1.0.8 | ||
* <p> | ||
* Created at 18.01.2021 | ||
*/ | ||
public interface Fillable { | ||
|
||
/** | ||
* Fills specified row line horizontally with given {@code itemStack} | ||
* | ||
* @param itemStack The {@link ItemStack} to fill the empty space with | ||
* @param line Line to fill with {@code itemStack} | ||
* @param action The action called whenever an interaction with the item happens | ||
* @since 1.0.5 | ||
*/ | ||
void fillHorizontallyWith(@NotNull ItemStack itemStack, int line, @Nullable Consumer<InventoryClickEvent> action); | ||
|
||
/** | ||
* Fills specified row line horizontally with given {@code itemStack} | ||
* | ||
* @param itemStack The {@link ItemStack} to fill the empty space with | ||
* @param line Line to fill with {@code itemStack} | ||
* @since 1.0.5 | ||
*/ | ||
void fillHorizontallyWith(@NotNull ItemStack itemStack, int line); | ||
|
||
/** | ||
* Fills inventory borders with given {@code itemStack} | ||
* | ||
* @param itemStack The {@link ItemStack} to fill the empty space with | ||
* @param action The action called whenever an interaction with the item happens | ||
* @since 1.0.8 | ||
*/ | ||
void fillBorder(@NotNull ItemStack itemStack, @Nullable Consumer<InventoryClickEvent> action); | ||
|
||
/** | ||
* Fills inventory borders with given {@code itemStack} | ||
* | ||
* @param itemStack The {@link ItemStack} to fill the empty space with | ||
* @since 1.0.8 | ||
*/ | ||
void fillBorder(@NotNull ItemStack itemStack); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters